CN109002547A - Journal file storage method, mobile terminal and computer readable storage medium - Google Patents
Journal file storage method, mobile terminal and computer readable storage medium Download PDFInfo
- Publication number
- CN109002547A CN109002547A CN201810852673.8A CN201810852673A CN109002547A CN 109002547 A CN109002547 A CN 109002547A CN 201810852673 A CN201810852673 A CN 201810852673A CN 109002547 A CN109002547 A CN 109002547A
- Authority
- CN
- China
- Prior art keywords
- subregion
- journal file
- partition holding
- log
- log partition
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3065—Monitoring arrangements determined by the means or processing involved in reporting the monitored data
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Abstract
The invention discloses a kind of journal file storage method, mobile terminal and computer readable storage mediums, this method comprises: successively downloading corresponding compiled subregion mirror image to memory space according to initial configuration subregion list file, to form each subregion, and generate subregion carry script, wherein, each subregion of formation includes a log partition holding;When starting up's system, the subregion carry script is parsed, obtains the partition information of log partition holding, and according to log partition holding described in the partition information carry;After system start completion, the journal file at each default node is read in real time, and the journal file read is stored into the log partition holding.The present invention can effectively save the journal file in test process, reduce case study difficulty, improve testing efficiency.
Description
Technical field
The present invention relates to the technical field of mobile terminal more particularly to a kind of journal file storage method, mobile terminal and
Computer readable storage medium.
Background technique
In the development process of mobile terminal, needs developer to carry out various tests to mobile terminal, only work as movement
After terminal is by various tests, it can just be sold to user.The test of mobile terminal include Monkey test, switching on and shutting down test,
Factory reset pressure test and stability test etc., when developer is carrying out Monkey test, switch to mobile terminal
During machine test, factory reset pressure test and stability test, find the problem, as mobile terminal cannot be introduced into table
When face, developer needs to check problem.
However, carrying out Monkey test, switching on and shutting down test, factory reset pressure test and stabilization to mobile terminal
Property test during, mobile terminal can not effectively save journal file, and developer is needed to expend by a large amount of test
The more time could be analyzed to obtain the reason of going wrong, and case study difficulty is larger, and testing efficiency is lower.
Therefore, the journal file in test process how is effectively saved, case study difficulty is reduced, improves testing efficiency
It is current urgent problem to be solved.
Summary of the invention
The main purpose of the present invention is to provide a kind of journal file storage method, mobile terminal and computer-readable storages
Medium, it is intended to which the effective journal file saved in test process reduces case study difficulty, improves testing efficiency.
To achieve the above object, the present invention provides a kind of journal file storage method, the journal file storage method packet
Include following steps:
Corresponding compiled subregion mirror image is successively downloaded to memory space, to be formed respectively according to initial configuration subregion list file
Subregion, and generate subregion carry script, wherein each subregion of formation includes a log partition holding;
When starting up's system, the subregion carry script is parsed, obtain the partition information of log partition holding, and according to
Log partition holding described in the partition information carry;
After system start completion, the journal file at each default node, and the journal file that will be read are read in real time
It stores into the log partition holding.
Optionally, the step of generation subregion carry script includes:
After forming each subregion, the partition information of each subregion is obtained, and generate subregion according to the partition information of each subregion
Carry script.
Optionally, the subregion carry script is parsed, obtains the partition information of log partition holding, and according to the subregion
Described in information carry the step of log partition holding after, further includes:
Continue to parse the subregion carry script, determines that the carry of each subregion in addition to the log partition holding is suitable
Sequence, and obtain the partition information of each subregion in addition to the log partition holding;
According to the partition information of the carry sequence and each subregion in addition to the log partition holding, successively carry is removed
Each subregion except the log partition holding.
Optionally, it after the journal file that will be read stores the step into the log partition holding, also wraps
It includes:
Whether it is lower than default memory capacity with the available storage that interval preset time monitors the log partition holding;
If monitoring, the available storage of the log partition holding is lower than default memory capacity, deposits to the log
The journal file stored up in subregion carries out de-redundancy operation.
Optionally, the journal file storage method further include:
The configuration subregion list file of the log partition holding of input is received, and reads day from the configuration subregion list file
First mount directory of will partition holding;
The second mount directory of log partition holding is read from the initial configuration subregion list file, and determines described the
Whether one mount directory and second mount directory are identical;
If first mount directory is identical as second mount directory, the log partition holding is deleted, and according to
According to the corresponding compiled subregion mirror image of the configuration partition table file download to memory space, to re-form log storage point
Area.
Optionally it is determined that also being wrapped after first mount directory and the whether identical step of second mount directory
It includes:
If first mount directory is different from second mount directory, according to the configuration partition table file download
Corresponding compiled subregion mirror image is to memory space, to form a new log partition holding.
Optionally, the journal file storage method further include:
When reading the journal file at each default node, determine that the available storage of the log partition holding is
It is no to be lower than preset threshold;
If the available storage of the log partition holding is lower than preset threshold, at each default node read
Journal file store to the new log partition holding.
Optionally, the journal file at each default node that will be read is stored to the new log partition holding
After step, further includes:
Whether the available storage for monitoring the new log partition holding is lower than preset threshold;
If monitoring, the available storage of the new log partition holding lower than preset threshold, is stored the log
Journal file in subregion and the new log partition holding carries out de-redundancy operation.
In addition, to achieve the above object, the present invention also provides a kind of mobile terminal, the mobile terminal include: memory,
The journal file storage program that processor and being stored in can be run on the memory and on the processor, the log text
The step of part storage program realizes journal file storage method as described above when being executed by the processor.
The present invention also provides a kind of computer readable storage mediums, which is characterized in that the computer readable storage medium
On be stored with journal file storage program, journal file storage program realizes log as described above when being executed by processor
The step of file memory method.
The present invention provides a kind of journal file storage method, mobile terminal and computer readable storage medium, according to initial
Configuration subregion list file successively downloads corresponding compiled subregion mirror image to memory space, to form each subregion, and is formed each
Subregion includes a log partition holding, and generates subregion carry script, then when starting up's system, parses the subregion carry foot
This, obtains the partition information of log partition holding, and according to the partition information carry log partition holding, finally when system opens
After the completion of dynamic, the journal file at each default node is read in real time, and the journal file read is stored to the log and is deposited
Store up in subregion, due to log partition holding in start process carry first, and journal file is stored to log deposited in real time
Subregion is stored up, the journal file in test process can be effectively saved, is convenient for during the test when something goes wrong, developer
Based on the journal file in log partition holding, quick positioning question reason effectively reduces case study difficulty, improves test
Efficiency.
Detailed description of the invention
A kind of hardware structural diagram of Fig. 1 mobile terminal of each embodiment to realize the present invention;
Fig. 2 is a kind of communications network system architecture diagram provided in an embodiment of the present invention;
Fig. 3 is the flow diagram of journal file storage method first embodiment of the present invention;
Fig. 4 is the flow diagram of journal file storage method second embodiment of the present invention;
Fig. 5 is the flow diagram of journal file storage method 3rd embodiment of the present invention.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
In subsequent description, it is only using the suffix for indicating such as " module ", " component " or " unit " of element
Be conducive to explanation of the invention, itself there is no a specific meaning.Therefore, " module ", " component " or " unit " can mix
Ground uses.
Terminal can be implemented in a variety of manners.For example, terminal described in the present invention may include such as mobile phone, plate
Computer, laptop, palm PC, personal digital assistant (Personal Digital Assistant, PDA), portable
Media player (Portable Media Player, PMP), navigation device, wearable device, Intelligent bracelet, pedometer etc. move
The fixed terminals such as dynamic terminal, and number TV, desktop computer.
It will be illustrated by taking mobile terminal as an example in subsequent descriptions, it will be appreciated by those skilled in the art that in addition to special
Except element for moving purpose, the construction of embodiment according to the present invention can also apply to the terminal of fixed type.
Referring to Fig. 1, a kind of hardware structural diagram of its mobile terminal of each embodiment to realize the present invention, the shifting
Dynamic terminal 100 may include: RF (Radio Frequency, radio frequency) unit 101, WiFi module 102, audio output unit
103, A/V (audio/video) input unit 104, sensor 105, display unit 106, user input unit 107, interface unit
108, the components such as memory 109, processor 110 and power supply 111.It will be understood by those skilled in the art that shown in Fig. 1
Mobile terminal structure does not constitute the restriction to mobile terminal, and mobile terminal may include components more more or fewer than diagram,
Perhaps certain components or different component layouts are combined.
It is specifically introduced below with reference to all parts of the Fig. 1 to mobile terminal:
Radio frequency unit 101 can be used for receiving and sending messages or communication process in, signal sends and receivees, specifically, by base station
Downlink information receive after, to processor 110 handle;In addition, the data of uplink are sent to base station.In general, radio frequency unit 101
Including but not limited to antenna, at least one amplifier, transceiver, coupler, low-noise amplifier, duplexer etc..In addition, penetrating
Frequency unit 101 can also be communicated with network and other equipment by wireless communication.Any communication can be used in above-mentioned wireless communication
Standard or agreement, including but not limited to GSM (Global System of Mobile communication, global system for mobile telecommunications
System), GPRS (General Packet Radio Service, general packet radio service), CDMA2000 (Code
Division Multiple Access 2000, CDMA 2000), WCDMA (Wideband Code Division
Multiple Access, wideband code division multiple access), TD-SCDMA (Time Division-Synchronous Code
Division Multiple Access, TD SDMA), FDD-LTE (Frequency Division
Duplexing-Long Term Evolution, frequency division duplex long term evolution) and TDD-LTE (Time Division
Duplexing-Long Term Evolution, time division duplex long term evolution) etc..
WiFi belongs to short range wireless transmission technology, and mobile terminal can help user to receive and dispatch electricity by WiFi module 102
Sub- mail, browsing webpage and access streaming video etc., it provides wireless broadband internet access for user.Although Fig. 1 shows
Go out WiFi module 102, but it is understood that, and it is not belonging to must be configured into for mobile terminal, it completely can be according to need
It to omit within the scope of not changing the essence of the invention.
Audio output unit 103 can be in call signal reception pattern, call mode, record mould in mobile terminal 100
When under the isotypes such as formula, speech recognition mode, broadcast reception mode, by radio frequency unit 101 or WiFi module 102 it is received or
The audio data stored in memory 109 is converted into audio signal and exports to be sound.Moreover, audio output unit 103
Audio output relevant to the specific function that mobile terminal 100 executes can also be provided (for example, call signal receives sound, disappears
Breath receives sound etc.).Audio output unit 103 may include loudspeaker, buzzer etc..
A/V input unit 104 is for receiving audio or video signal.A/V input unit 104 may include graphics processor
(Graphics Processing Unit, GPU) 1041 and microphone 1042, graphics processor 1041 is in video acquisition mode
Or the image data of the static images or video obtained in image capture mode by image capture apparatus (such as camera) carries out
Reason.Treated, and picture frame may be displayed on display unit 106.Through graphics processor 1041, treated that picture frame can be deposited
Storage is sent in memory 109 (or other storage mediums) or via radio frequency unit 101 or WiFi module 102.Mike
Wind 1042 can connect in telephone calling model, logging mode, speech recognition mode etc. operational mode via microphone 1042
Quiet down sound (audio data), and can be audio data by such acoustic processing.Audio that treated (voice) data can
To be converted to the format output that can be sent to mobile communication base station via radio frequency unit 101 in the case where telephone calling model.
Microphone 1042 can be implemented various types of noises elimination (or inhibition) algorithms and send and receive sound to eliminate (or inhibition)
The noise generated during frequency signal or interference.
Mobile terminal 100 further includes at least one sensor 105, such as optical sensor, motion sensor and other biographies
Sensor.Specifically, optical sensor includes ambient light sensor and proximity sensor, wherein ambient light sensor can be according to environment
The light and shade of light adjusts the brightness of display panel 1061, and proximity sensor can close when mobile terminal 100 is moved in one's ear
Display panel 1061 and/or backlight.As a kind of motion sensor, accelerometer sensor can detect in all directions (general
For three axis) size of acceleration, it can detect that size and the direction of gravity when static, can be used to identify the application of mobile phone posture
(such as horizontal/vertical screen switching, dependent game, magnetometer pose calibrating), Vibration identification correlation function (such as pedometer, percussion) etc.;
The fingerprint sensor that can also configure as mobile phone, pressure sensor, iris sensor, molecule sensor, gyroscope, barometer,
The other sensors such as hygrometer, thermometer, infrared sensor, details are not described herein.
Display unit 106 is for showing information input by user or being supplied to the information of user.Display unit 106 can wrap
Display panel 1061 is included, liquid crystal display (Liquid Crystal Display, LCD), Organic Light Emitting Diode can be used
Forms such as (Organic Light-Emitting Diode, OLED) configure display panel 1061.
User input unit 107 can be used for receiving the number or character information of input, and generate the use with mobile terminal
Family setting and the related key signals input of function control.Specifically, user input unit 107 may include touch panel 1071 with
And other input equipments 1072.Touch panel 1071, also referred to as touch screen collect the touch operation of user on it or nearby
(for example user uses any suitable objects or attachment such as finger, stylus on touch panel 1071 or in touch panel 1071
Neighbouring operation), and corresponding attachment device is driven according to preset formula.Touch panel 1071 may include touch detection
Two parts of device and touch controller.Wherein, the touch orientation of touch detecting apparatus detection user, and detect touch operation band
The signal come, transmits a signal to touch controller;Touch controller receives touch information from touch detecting apparatus, and by it
It is converted into contact coordinate, then gives processor 110, and order that processor 110 is sent can be received and executed.In addition, can
To realize touch panel 1071 using multiple types such as resistance-type, condenser type, infrared ray and surface acoustic waves.In addition to touch panel
1071, user input unit 107 can also include other input equipments 1072.Specifically, other input equipments 1072 can wrap
It includes but is not limited in physical keyboard, function key (such as volume control button, switch key etc.), trace ball, mouse, operating stick etc.
It is one or more, specifically herein without limitation.
Further, touch panel 1071 can cover display panel 1061, when touch panel 1071 detect on it or
After neighbouring touch operation, processor 110 is sent to determine the type of touch event, is followed by subsequent processing device 110 according to touch thing
The type of part provides corresponding visual output on display panel 1061.Although in Fig. 1, touch panel 1071 and display panel
1061 be the function that outputs and inputs of realizing mobile terminal as two independent components, but in certain embodiments, it can
The function that outputs and inputs of mobile terminal is realized so that touch panel 1071 and display panel 1061 is integrated, is not done herein specifically
It limits.
Interface unit 108 be used as at least one external device (ED) connect with mobile terminal 100 can by interface.For example,
External device (ED) may include wired or wireless headphone port, external power supply (or battery charger) port, wired or nothing
Line data port, memory card port, the port for connecting the device with identification module, audio input/output (I/O) end
Mouth, video i/o port, ear port etc..Interface unit 108 can be used for receiving the input from external device (ED) (for example, number
It is believed that breath, electric power etc.) and the input received is transferred to one or more elements in mobile terminal 100 or can be with
For transmitting data between mobile terminal 100 and external device (ED).
Memory 109 can be used for storing software program and various data.Memory 109 can mainly include storing program area
The storage data area and, wherein storing program area can (such as the sound of application program needed for storage program area, at least one function
Sound playing function, image player function etc.) etc.;Storage data area can store according to mobile phone use created data (such as
Audio data, phone directory etc.) etc..In addition, memory 109 may include high-speed random access memory, it can also include non-easy
The property lost memory, a for example, at least disk memory, flush memory device or other volatile solid-state parts.
Processor 110 is the control centre of mobile terminal, utilizes each of various interfaces and the entire mobile terminal of connection
A part by running or execute the software program and/or module that are stored in memory 109, and calls and is stored in storage
Data in device 109 execute the various functions and processing data of mobile terminal, to carry out integral monitoring to mobile terminal.Place
Managing device 110 may include one or more processing units;Preferably, processor 110 can integrate application processor and modulatedemodulate is mediated
Manage device, wherein the main processing operation system of application processor, user interface and application program etc., modem processor is main
Processing wireless communication.It is understood that above-mentioned modem processor can not also be integrated into processor 110.
Mobile terminal 100 can also include the power supply 111 (such as battery) powered to all parts, it is preferred that power supply 111
Can be logically contiguous by power-supply management system and processor 110, to realize management charging by power-supply management system, put
The functions such as electricity and power managed.
Although Fig. 1 is not shown, mobile terminal 100 can also be including bluetooth module etc., and details are not described herein.
As shown in Figure 1, as may include that operating system, network are logical in a kind of memory 109 of computer storage medium
Believe that module, Subscriber Interface Module SIM and journal file store program, processor 110 can be used for calling to be stored in memory 109
Journal file store program, and execute following steps:
Corresponding compiled subregion mirror image is successively downloaded to memory space, to be formed respectively according to initial configuration subregion list file
Subregion, and generate subregion carry script, wherein each subregion of formation includes a log partition holding;
When starting up's system, the subregion carry script is parsed, obtain the partition information of log partition holding, and according to
Log partition holding described in the partition information carry;
After system start completion, the journal file at each default node, and the journal file that will be read are read in real time
It stores into the log partition holding.
Further, processor 110 can be used for that the journal file stored in memory 109 is called to store program, also hold
Row following steps:
After forming each subregion, the partition information of each subregion is obtained, and generate subregion according to the partition information of each subregion
Carry script.
Further, processor 110 can be used for that the journal file stored in memory 109 is called to store program, also hold
Row following steps:
Continue to parse the subregion carry script, determines that the carry of each subregion in addition to the log partition holding is suitable
Sequence, and obtain the partition information of each subregion in addition to the log partition holding;
According to the partition information of the carry sequence and each subregion in addition to the log partition holding, successively carry is removed
Each subregion except the log partition holding.
Further, processor 110 can be used for that the journal file stored in memory 109 is called to store program, also hold
Row following steps:
Whether it is lower than default memory capacity with the available storage that interval preset time monitors the log partition holding;
If monitoring, the available storage of the log partition holding is lower than default memory capacity, deposits to the log
The journal file stored up in subregion carries out de-redundancy operation.
Further, processor 110 can be used for that the journal file stored in memory 109 is called to store program, also hold
Row following steps:
The configuration subregion list file of the log partition holding of input is received, and reads day from the configuration subregion list file
First mount directory of will partition holding;
The second mount directory of log partition holding is read from the initial configuration subregion list file, and determines described the
Whether one mount directory and second mount directory are identical;
If first mount directory is identical as second mount directory, the log partition holding is deleted, and according to
According to the corresponding compiled subregion mirror image of the configuration partition table file download to memory space, to re-form log storage point
Area.
Further, processor 110 can be used for that the journal file stored in memory 109 is called to store program, also hold
Row following steps:
If first mount directory is different from second mount directory, according to the configuration partition table file download
Corresponding compiled subregion mirror image is to memory space, to form a new log partition holding.
Further, processor 110 can be used for that the journal file stored in memory 109 is called to store program, also hold
Row following steps:
When reading the journal file at each default node, determine that the available storage of the log partition holding is
It is no to be lower than preset threshold;
If the available storage of the log partition holding is lower than preset threshold, at each default node read
Journal file store to the new log partition holding.
Further, processor 110 can be used for that the journal file stored in memory 109 is called to store program, also hold
Row following steps:
Whether the available storage for monitoring the new log partition holding is lower than preset threshold;
If monitoring, the available storage of the new log partition holding lower than preset threshold, is stored the log
Journal file in subregion and the new log partition holding carries out de-redundancy operation.
Embodiment to facilitate the understanding of the present invention, the communications network system that mobile terminal of the invention is based below into
Row description.
Referring to Fig. 2, Fig. 2 is a kind of communications network system architecture diagram provided in an embodiment of the present invention, the communication network system
System is the LTE system of universal mobile communications technology, which includes UE (User Equipment, the use of successively communication connection
Family equipment) (the land Evolved UMTS Terrestrial Radio Access Network, evolved UMTS 201, E-UTRAN
Ground wireless access network) 202, EPC (Evolved Packet Core, evolved packet-based core networks) 203 and operator IP operation
204。
Specifically, UE201 can be above-mentioned terminal 100, and details are not described herein again.
E-UTRAN202 includes eNodeB2021 and other eNodeB2022 etc..Wherein, eNodeB2021 can be by returning
Journey (backhaul) (such as X2 interface) is connect with other eNodeB2022, and eNodeB2021 is connected to EPC203,
ENodeB2021 can provide the access of UE201 to EPC203.
EPC203 may include MME (Mobility Management Entity, mobility management entity) 2031, HSS
(Home Subscriber Server, home subscriber server) 2032, other MME2033, SGW (Serving Gate Way,
Gateway) 2034, PGW (PDN Gate Way, grouped data network gateway) 2035 and PCRF (Policy and
Charging Rules Function, policy and rate functional entity) 2036 etc..Wherein, MME2031 be processing UE201 and
The control node of signaling, provides carrying and connection management between EPC203.HSS2032 is all to manage for providing some registers
Such as the function of home location register (not shown) etc, and preserves some related service features, data rates etc. and use
The dedicated information in family.All customer data can be sent by SGW2034, and PGW2035 can provide the IP of UE 201
Address distribution and other functions, PCRF2036 are strategy and the charging control strategic decision-making of business data flow and IP bearing resource
Point, it selects and provides available strategy and charging control decision with charge execution function unit (not shown) for strategy.
IP operation 204 may include internet, Intranet, IMS (IP Multimedia Subsystem, IP multimedia
System) or other IP operations etc..
Although above-mentioned be described by taking LTE system as an example, those skilled in the art should know the present invention is not only
Suitable for LTE system, be readily applicable to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA with
And the following new network system etc., herein without limitation.
Based on above-mentioned mobile terminal hardware configuration and communications network system, journal file storage method of the present invention is proposed
Each embodiment.
It is the flow diagram of journal file storage method first embodiment of the present invention referring to Fig. 3, Fig. 3;
In the present embodiment, which includes:
Step S101 successively downloads corresponding compiled subregion mirror image to storing sky according to initial configuration subregion list file
Between, to form each subregion, and generate subregion carry script, wherein each subregion of formation includes a log partition holding;
The journal file storage method is applied to mobile terminal, can be selected as mobile terminal shown in FIG. 1, the mobile terminal
Operating system be Android system, for using Android operation system mobile terminal, require pre-production and correspond to subregion
Image file is stored with initial configuration subregion list file, i.e. partition.xml table in mobile terminal.The initial configuration subregion
List file is configured by developer, carries out zone configuration for the memory to mobile terminal.Include in partition.xml table
Multiple subregion entries especially include that log partition holding entry, the corresponding subregion of each entry, including each subregion are corresponding
Filename, file size and file attribute information.Wherein, each subregion includes but is not limited to ramdisk.img (root file mirror
Picture), system.img (system image), userdata.img (user data mirror image), bootloader subregion, boot subregion,
System subregion, userdata subregion and log partition holding.Wherein, ramdisk.img is root file system, system.img
It include the files such as main packet, library, userdata.img includes some user data.It is with above three image file
System and userdata after Android system loads this 3 image files, can be loaded into respectively ramdisk file system by example
In system and data catalogue under.
Since system.img and userdata.img is constructed using Ext4 (forth generation extension file system) format, according to
Standard regulation, the mirror image constructed using Ext4 format need prespecified mirror image size, so as in mirror image loading procedure, root
According to prespecified mirror image size, the total data for including in the subregion mirror image is loaded under the mount directory of the subregion,
In the prior art, the size of image file determines the size of subregion, meanwhile, it is each in the sequence of subregion and configuration subregion list file
Putting in order for subregion corresponding entry is corresponding.
In the present embodiment, when using tool entirely wipes downloading when, mobile terminal foundation initial configuration subregion list file successively under
Corresponding compiled subregion mirror image is carried to memory space, to form each subregion, i.e., according to initial configuration partition table, from mobile terminal
The head of memory start, sequentially in the corresponding compiled subregion mirror image programming to memory of each subregion entry, successively
Each subregion is formed, and includes a log partition holding in each subregion formed, then generates subregion carry script, specifically,
The partition information of each subregion is obtained, and generates subregion carry script according to the partition information of each subregion, to record each subregion
Partition information, subsequent user start mobile terminal when, mobile terminal will by parsing subregion carry script one by one carry it is each
Under a subregion to corresponding catalogue, so that user can access each subregion on memory by accessing corresponding catalogue.Wherein,
Carry log partition holding first, the partition information include but is not limited to that mount directory, subregion path, divisional type and subregion are big
It is small.It should be noted that the size of above-mentioned log partition holding can be adjusted by developer based on actual conditions.
Step S102 when starting up's system, parses subregion carry script, obtains the partition information of log partition holding,
And according to partition information carry log partition holding;
In the present embodiment, when mobile terminal-opening activation system, according to the boot sequence of Android system, starting
Linux kernel is called after bootloader, at this point, starting to start Android system, executes late_init service, triggering
Trigger_fs executes mount_all fstab.qcom order, starts to parse the subregion carry script, and acquisition log first is deposited
The partition information of subregion is stored up, and according to the partition information carry log partition holding, i.e., reads carry mesh from the partition information
Record and subregion path, and obtain corresponding image file, then according to the mount directory and subregion path by the image file institute
It is mounted in corresponding catalogue in subregion, makes user can be by accessing the catalogue with access log partition holding.
Further, after step S102, further includes:
Step a continues to parse subregion carry script, determines the carry sequence of each subregion in addition to log partition holding,
And obtain the partition information of each subregion in addition to log partition holding;
In the present embodiment, mobile terminal continues to parse subregion carry script, determination removes after carry log partition holding
The carry sequence of each subregion except log partition holding, i.e., in inquiry subregion carry script between partition name and carry sequence
Mapping table, obtain the correspondence carry sequence of each subregion in addition to log partition holding, and obtain except log storage point
The partition information of each subregion except area.It should be noted that above-mentioned carry sequence is carried out by developer based on actual conditions
Setting, the present embodiment are not especially limited this.
Step b, according to the partition information of carry sequence and each subregion in addition to log partition holding, successively carry removes day
Each subregion except will partition holding.
In the present embodiment, mobile terminal is believed according to the subregion of carry sequence and each subregion in addition to log partition holding
Breath, successively each subregion of the carry in addition to log partition holding, wherein the carry sequence of each subregion and its in memory suitable
Sequence might not be identical, for example, position is before B subregion in memory for A subregion, but its practical carry sequence can be in B subregion
After carry.Each subregion has been preset via developer when leaving the factory in the position of memory and start-stop address.Subregion is hung
Carry script logging each partition information, the routing information including each subregion mount point, divisional type, partition size.After booting
Carry sequence has no effect on district location distribution.According to certain carry sequence, successively carry is each in addition to log partition holding
Subregion can effectively improve the carry speed of each subregion, reduce system latency time.
Step S103 reads the journal file at each default node after system start completion in real time, and will read
Journal file is stored into log partition holding.
In the present embodiment, after system start completion, i.e., the boot_compelted attribute in start process is set as 1,
Log crawl service is opened in triggering, that is, creates a finger daemon, reads the journal file at each default node in real time, and will read
To journal file store into log partition holding, wherein default node include but is not limited to logcat, kernel, ps,
Dmesg, kmsg, events and mount, journal file include but is not limited to logcat log, kernel log, ps log,
Dmesg log, kmsg log, events log and mount log.
In the present embodiment, the present invention successively downloads corresponding compiled subregion mirror image extremely according to initial configuration subregion list file
Memory space, to form each subregion, and each subregion formed includes a log partition holding, and generates subregion carry script, so
Afterwards when starting up's system, the subregion carry script is parsed, obtains the partition information of log partition holding, and believe according to the subregion
The carry log partition holding is ceased, finally after system start completion, reads the journal file at each default node in real time, and will
The journal file read is stored into the log partition holding, since log partition holding is hung first in start process
It carries, and journal file is stored to log partition holding in real time, can effectively save the journal file in test process, just
In when something goes wrong, for developer based on the journal file in log partition holding, quick positioning question is former during the test
Cause effectively reduces case study difficulty, improves testing efficiency.
Further, referring to Fig. 4, propose journal file storage method of the present invention based on previous embodiment second is implemented
Example, the difference with previous embodiment is, after step S103, further includes:
Whether step S104 is lower than default storage with the available storage of interval preset time monitoring journal partition holding
Capacity;
In the present embodiment, mobile terminal stores the journal file of reading to log partition holding, default with interval
Whether the available storage of the time supervision log partition holding is lower than default memory capacity, that is, monitors the log partition holding
Available storage it is whether enough.It should be noted that above-mentioned preset time can be based on practical feelings by those skilled in the art
Condition is configured, and the present embodiment is not especially limited this.
Step S105, if monitoring, the available storage of log partition holding is lower than default memory capacity, to log
Journal file in partition holding carries out de-redundancy operation.
In the present embodiment, if monitoring that the available storage of log partition holding is lower than default memory capacity, move
Dynamic terminal carries out de-redundancy operation to the journal file in log partition holding, i.e., divides log storage according to journal file type
Journal file in area, being divided into several journal file groups, (type of the journal file in same journal file group is identical, different
The type of journal file in journal file group is different), and the label of each journal file in each journal file group is read, then will
The identical journal file of same journal file group interior label merges into a journal file, and one journal file packet of corresponding record
Then the journal file number contained deletes the other journal files merged, only retain a journal file.
For example, the journal file in a journal file group is 1000, in this 1000 logs, there are 520 logs
Label is A label, and the label of 360 logs is B label, and the label of 120 logs is C label, then stores the day of an A label
Will, deletes the log of remaining 519 A label, and the quantity for recording the log of A label is 520;The log of a B label is stored,
The quantity deleted the log of remaining 359 B label, and record the log of B label is 360;The log for storing a C label, is deleted
Except the log of remaining 119 C label, and the quantity for recording the log of C label is 120.
In the present embodiment, when the memory capacity of log partition holding is lower than default memory capacity, to log storage point
Journal file in area carries out de-redundancy operation, improves the utilization rate of log partition holding.
Further, referring to Fig. 5, above-mentioned first or second embodiments is based on, journal file storage side of the present invention is proposed
The 3rd embodiment of method, the difference with previous embodiment be, the journal file storage method further include:
Step S106 receives the configuration subregion list file of the log partition holding of input, and from configuration subregion list file
Read the first mount directory of log partition holding;
In the present embodiment, when developer needs to adjust log partition holding, the input journal storage point into mobile terminal
The configuration subregion list file in area, mobile terminal receives the configuration subregion list file of the log partition holding of input, and divides from configuration
The first mount directory of log partition holding is read in area's list file.
Step S107 reads the second mount directory of log partition holding from initial configuration subregion list file, and determines
Whether the first mount directory is identical as the second mount directory;
Step S108 deletes log partition holding, and foundation is matched if the first mount directory is identical as the second mount directory
The corresponding compiled subregion mirror image of partition table file download is set to memory space, to re-form a log partition holding.
In the present embodiment, mobile terminal reads the second carry mesh of log partition holding from initial configuration subregion list file
Record, and determine whether the first mount directory and the second mount directory are identical, if the first mount directory and the second mount directory phase
Together, then log partition holding is deleted, and according to the corresponding compiled subregion mirror image of configuration partition table file download to memory space,
To re-form a log partition holding, if the first mount directory is different from the second mount directory, according to the configuration subregion
List file downloads corresponding compiled subregion mirror image to memory space, to form a new log partition holding, i.e. mobile terminal
Two log partition holdings are formd in memory.
In the present embodiment, the present invention can realize the adjustment of log partition holding, by configuring subregion list file convenient for exploitation
Personnel use.
Further, it is based on above-mentioned 3rd embodiment, proposes the 3rd embodiment of journal file storage method of the present invention,
Difference with previous embodiment is, the journal file storage method further include:
Step c determines the available storage of log partition holding when reading the journal file at each default node
Whether preset threshold is lower than;
In the present embodiment, when reading the journal file at each default node, mobile terminal determines log partition holding
Available storage whether be lower than preset threshold, if the available storage of log partition holding is greater than or equal to default threshold
Value, then store the journal file at each default node read to the log partition holding.
Step d, if the available storage of log partition holding is lower than preset threshold, each default node that will be read
The journal file at place is stored to new log partition holding.
It is each by what is read if the available storage of log partition holding is lower than preset threshold in the present embodiment
Journal file at default node is stored to new log partition holding.Further, new the available of log partition holding is monitored to deposit
Whether storage capacity is lower than preset threshold, if monitoring that the available storage of new log partition holding is lower than preset threshold,
De-redundancy operation is carried out to the journal file in log partition holding and new log partition holding.
In the present embodiment, there are two log partition holdings for mobile terminal setting, log memory capacity are improved, in addition, two
When the memory capacity of a log partition holding is below preset threshold, de-redundant is carried out to the journal file of two log partition holdings
Remaining operation improves the utilization rate of log partition holding.
In addition, the embodiment of the present invention also proposes a kind of computer readable storage medium, the computer readable storage medium
On be stored with journal file storage program, journal file storage program performs the steps of when being executed by processor
Corresponding compiled subregion mirror image is successively downloaded to memory space, to be formed respectively according to initial configuration subregion list file
Subregion, and generate subregion carry script, wherein each subregion of formation includes a log partition holding;
When starting up's system, the subregion carry script is parsed, obtain the partition information of log partition holding, and according to
Log partition holding described in the partition information carry;
After system start completion, the journal file at each default node, and the journal file that will be read are read in real time
It stores into the log partition holding.
Further, it is also performed the steps of when the journal file storage program is executed by processor
After forming each subregion, the partition information of each subregion is obtained, and generate subregion according to the partition information of each subregion
Carry script.
Further, it is also performed the steps of when the journal file storage program is executed by processor
Continue to parse the subregion carry script, determines that the carry of each subregion in addition to the log partition holding is suitable
Sequence, and obtain the partition information of each subregion in addition to the log partition holding;
According to the partition information of the carry sequence and each subregion in addition to the log partition holding, successively carry is removed
Each subregion except the log partition holding.
Further, it is also performed the steps of when the journal file storage program is executed by processor
Whether it is lower than default memory capacity with the available storage that interval preset time monitors the log partition holding;
If monitoring, the available storage of the log partition holding is lower than default memory capacity, deposits to the log
The journal file stored up in subregion carries out de-redundancy operation.
Further, it is also performed the steps of when the journal file storage program is executed by processor
The configuration subregion list file of the log partition holding of input is received, and reads day from the configuration subregion list file
First mount directory of will partition holding;
The second mount directory of log partition holding is read from the initial configuration subregion list file, and determines described the
Whether one mount directory and second mount directory are identical;
If first mount directory is identical as second mount directory, the log partition holding is deleted, and according to
According to the corresponding compiled subregion mirror image of the configuration partition table file download to memory space, to re-form log storage point
Area.
Further, it is also performed the steps of when the journal file storage program is executed by processor
If first mount directory is different from second mount directory, according to the configuration partition table file download
Corresponding compiled subregion mirror image is to memory space, to form a new log partition holding.
Further, it is also performed the steps of when the journal file storage program is executed by processor
When reading the journal file at each default node, determine that the available storage of the log partition holding is
It is no to be lower than preset threshold;
If the available storage of the log partition holding is lower than preset threshold, at each default node read
Journal file store to the new log partition holding.
Further, it is also performed the steps of when the journal file storage program is executed by processor
Whether the available storage for monitoring the new log partition holding is lower than preset threshold;
If monitoring, the available storage of the new log partition holding lower than preset threshold, is stored the log
Journal file in subregion and the new log partition holding carries out de-redundancy operation.
Each embodiment of the specific embodiment of computer readable storage medium of the present invention and above-mentioned journal file storage method
Essentially identical, therefore not to repeat here.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row
His property includes, so that the process, method, article or the system that include a series of elements not only include those elements, and
And further include other elements that are not explicitly listed, or further include for this process, method, article or system institute it is intrinsic
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do
There is also other identical elements in the process, method of element, article or system.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side
Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases
The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art
The part contributed out can be embodied in the form of software products, which is stored in one as described above
In storage medium (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that terminal device (it can be mobile phone,
Computer, server, air conditioner or network equipment etc.) execute method described in each embodiment of the present invention.
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair
Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills
Art field, is included within the scope of the present invention.
Claims (10)
1. a kind of journal file storage method, it is applied to mobile terminal, which is characterized in that the journal file storage method includes
Following steps:
Corresponding compiled subregion mirror image is successively downloaded to memory space, to form each point according to initial configuration subregion list file
Area, and generate subregion carry script, wherein each subregion of formation includes a log partition holding;
When starting up's system, the subregion carry script is parsed, obtains the partition information of log partition holding, and according to described
Log partition holding described in partition information carry;
After system start completion, the journal file at each default node is read in real time, and the journal file read is stored
To in the log partition holding.
2. journal file storage method as described in claim 1, which is characterized in that the step of the generation subregion carry script
Include:
After forming each subregion, the partition information of each subregion is obtained, and generate subregion carry according to the partition information of each subregion
Script.
3. journal file storage method as described in claim 1, which is characterized in that parse the subregion carry script, obtain
The partition information of log partition holding, and according to after the step of log partition holding described in the partition information carry, also wrap
It includes:
Continue to parse the subregion carry script, determines the carry sequence of each subregion in addition to the log partition holding, and
Obtain the partition information of each subregion in addition to the log partition holding;
According to the partition information of the carry sequence and each subregion in addition to the log partition holding, successively carry is except described
Each subregion except log partition holding.
4. journal file storage method as described in claim 1, which is characterized in that described to store the journal file read
To the step in the log partition holding, further includes:
Whether it is lower than default memory capacity with the available storage that interval preset time monitors the log partition holding;
If monitoring, the available storage of the log partition holding is lower than default memory capacity, to log storage point
Journal file in area carries out de-redundancy operation.
5. such as journal file storage method of any of claims 1-4, which is characterized in that the journal file storage
Method further include:
The configuration subregion list file of the log partition holding of input is received, and reads log from the configuration subregion list file and deposits
Store up the first mount directory of subregion;
The second mount directory of log partition holding is read from the initial configuration subregion list file, and determines that described first hangs
It carries catalogue and whether second mount directory is identical;
If first mount directory is identical as second mount directory, the log partition holding is deleted, and according to institute
The corresponding compiled subregion mirror image of configuration partition table file download is stated to memory space, to re-form a log partition holding.
6. journal file storage method as claimed in claim 5, which is characterized in that determine first mount directory with it is described
After the whether identical step of second mount directory, further includes:
It is corresponding according to the configuration partition table file download if first mount directory is different from second mount directory
Compiled subregion mirror image to memory space, to form a new log partition holding.
7. journal file storage method as claimed in claim 6, which is characterized in that the journal file storage method is also wrapped
It includes:
When reading the journal file at each default node, determine whether the available storage of the log partition holding is low
In preset threshold;
If the available storage of the log partition holding is lower than preset threshold, by the day at each default node read
Will file is stored to the new log partition holding.
8. journal file storage method as claimed in claim 7, which is characterized in that at each default node that will be read
Journal file the step of storing to the new log partition holding after, further includes:
Whether the available storage for monitoring the new log partition holding is lower than preset threshold;
If monitoring the available storage of the new log partition holding lower than preset threshold, to the log partition holding
De-redundancy operation is carried out with the journal file in the new log partition holding.
9. a kind of mobile terminal, which is characterized in that the mobile terminal includes: memory, processor and is stored in the storage
On device and the journal file storage program that can run on the processor, journal file storage program is by the processor
It realizes when execution such as the step of journal file storage method described in any item of the claim 1 to 8.
10. a kind of computer readable storage medium, which is characterized in that be stored with log text on the computer readable storage medium
Part stores program, and the journal file storage program is realized when being executed by processor as described in any item of the claim 1 to 8
The step of journal file storage method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810852673.8A CN109002547B (en) | 2018-07-30 | 2018-07-30 | Log file storage method, mobile terminal and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810852673.8A CN109002547B (en) | 2018-07-30 | 2018-07-30 | Log file storage method, mobile terminal and computer readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109002547A true CN109002547A (en) | 2018-12-14 |
CN109002547B CN109002547B (en) | 2023-09-01 |
Family
ID=64597408
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810852673.8A Active CN109002547B (en) | 2018-07-30 | 2018-07-30 | Log file storage method, mobile terminal and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109002547B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110147291A (en) * | 2019-03-29 | 2019-08-20 | 努比亚技术有限公司 | Terminal and its log management-control method, computer readable storage medium |
CN110716908A (en) * | 2019-09-29 | 2020-01-21 | 捷开通讯(深圳)有限公司 | Log information writing method, system, storage medium and mobile terminal |
CN111198855A (en) * | 2019-12-31 | 2020-05-26 | 深圳移航通信技术有限公司 | Method and device for processing log data |
CN113704205A (en) * | 2021-07-29 | 2021-11-26 | 荣耀终端有限公司 | Log storage method, chip, electronic device and readable storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106406768A (en) * | 2016-09-28 | 2017-02-15 | 努比亚技术有限公司 | Android system user data partitioning adjustment method and device |
US20170139944A1 (en) * | 2015-11-13 | 2017-05-18 | Xiaomi Inc. | Method, device and computer-readable medium for monitoring a file in system partition |
CN107276789A (en) * | 2017-05-19 | 2017-10-20 | 努比亚技术有限公司 | Daily record method for uploading, device and computer-readable recording medium |
CN107798099A (en) * | 2017-10-27 | 2018-03-13 | 努比亚技术有限公司 | A kind of log information grasping means, terminal and computer-readable recording medium |
CN107832191A (en) * | 2017-10-31 | 2018-03-23 | 努比亚技术有限公司 | Blank screen detection method, mobile terminal and computer-readable recording medium |
-
2018
- 2018-07-30 CN CN201810852673.8A patent/CN109002547B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170139944A1 (en) * | 2015-11-13 | 2017-05-18 | Xiaomi Inc. | Method, device and computer-readable medium for monitoring a file in system partition |
CN106406768A (en) * | 2016-09-28 | 2017-02-15 | 努比亚技术有限公司 | Android system user data partitioning adjustment method and device |
CN107276789A (en) * | 2017-05-19 | 2017-10-20 | 努比亚技术有限公司 | Daily record method for uploading, device and computer-readable recording medium |
CN107798099A (en) * | 2017-10-27 | 2018-03-13 | 努比亚技术有限公司 | A kind of log information grasping means, terminal and computer-readable recording medium |
CN107832191A (en) * | 2017-10-31 | 2018-03-23 | 努比亚技术有限公司 | Blank screen detection method, mobile terminal and computer-readable recording medium |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110147291A (en) * | 2019-03-29 | 2019-08-20 | 努比亚技术有限公司 | Terminal and its log management-control method, computer readable storage medium |
CN110716908A (en) * | 2019-09-29 | 2020-01-21 | 捷开通讯(深圳)有限公司 | Log information writing method, system, storage medium and mobile terminal |
CN111198855A (en) * | 2019-12-31 | 2020-05-26 | 深圳移航通信技术有限公司 | Method and device for processing log data |
CN111198855B (en) * | 2019-12-31 | 2023-07-25 | 深圳移航通信技术有限公司 | Log data processing method and device |
CN113704205A (en) * | 2021-07-29 | 2021-11-26 | 荣耀终端有限公司 | Log storage method, chip, electronic device and readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN109002547B (en) | 2023-09-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108536481A (en) | A kind of application program launching method, mobile terminal and computer storage media | |
CN109542689A (en) | Applied program processing method, terminal and computer readable storage medium | |
CN109002547A (en) | Journal file storage method, mobile terminal and computer readable storage medium | |
CN110087287A (en) | Terminal searches control method, device, mobile terminal and the storage medium of net | |
CN109725866A (en) | Application interface display methods, terminal and computer readable storage medium | |
CN108052412A (en) | Restart Fault Locating Method, mobile terminal and computer readable storage medium | |
CN108519886A (en) | A kind of APK application installation packages configuration method, server, system and storage medium | |
CN109739571A (en) | Application program launching method, mobile terminal and computer readable storage medium | |
CN108549826A (en) | Method of calibration, terminal, server and the readable storage medium storing program for executing of application program | |
CN108536490A (en) | A kind of application program launching method, mobile terminal and computer storage media | |
CN110113779A (en) | Test method, system, test platform, mobile terminal and the medium of eSIM card | |
CN109472157A (en) | Storage method, mobile terminal and the computer storage medium of application data | |
CN108052430A (en) | Mobile terminal restarts localization method, mobile terminal and computer readable storage medium | |
CN109254972A (en) | A kind of offline order Word library updating method, terminal and computer readable storage medium | |
CN108446134A (en) | Loophole restorative procedure, mobile terminal and the readable storage medium storing program for executing of application program | |
CN108595672A (en) | The method, apparatus and readable storage medium storing program for executing of file type are downloaded in a kind of identification | |
CN108089937A (en) | Localization method, mobile terminal and storage medium are restarted based on direct Memory Allocation | |
CN109947519A (en) | Hardware-accelerated control method, terminal and computer readable storage medium | |
CN110188249A (en) | A kind of global search method, equipment and computer readable storage medium | |
CN110099173A (en) | Method, terminal and the storage medium of touch experience pattern switching | |
CN108762848A (en) | The quick loading method of Activity data, intelligent terminal and computer readable storage medium | |
CN109062688A (en) | A kind of memory allocation method, server and mobile terminal | |
CN109739569A (en) | Method for starting up mobile terminal, mobile terminal and computer readable storage medium | |
CN110377458A (en) | Data reconstruction method, mobile terminal and computer readable storage medium | |
CN109918136A (en) | Boot LOGO processing method, mobile terminal and the storage medium of 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 |