CN102117328A - Recording data rapid storage method in Android system - Google Patents
Recording data rapid storage method in Android system Download PDFInfo
- Publication number
- CN102117328A CN102117328A CN201110051271.6A CN201110051271A CN102117328A CN 102117328 A CN102117328 A CN 102117328A CN 201110051271 A CN201110051271 A CN 201110051271A CN 102117328 A CN102117328 A CN 102117328A
- Authority
- CN
- China
- Prior art keywords
- recording
- data
- storage
- pipeline
- thread
- 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
Images
Landscapes
- Signal Processing For Digital Recording And Reproducing (AREA)
Abstract
A recording data rapid storage method in an Android system is characterized in that a data pipeline for instantaneous transmission of recording data is constructed in a recording system; the pipeline data stream manner is constructed on the basis of the data pipeline; a recording thread and a recording storage thread are started simultaneously when the recording is started; the recording data in the recording thread serve as the pipeline data input stream, and are stored in a circular buffer region of the system through a data input pipeline; the recording data in the circular buffer region serve as the pipeline data output stream, and are transmitted to the recording storage thread through a data output pipeline; the recording data are instantaneously stored in a memory of a cell phone by the recording storage thread; and the recording is stopped if the memory is full or powered off. Therefore, the method can instantaneously transmit the recording data to the memory in the pipeline data stream manner, and can obviate the recording data loss caused by power off or full storage space. The data transmission between the two threads is safe, immediate and effective.
Description
Technical field
The present invention relates to data processing field, especially a kind of being used at the portable terminal that the Android system has been installed, the instant recording data quick storage method of preserving automatically of data is used to record.
Background technology
Along with the continuous quickening of modern life rhythm and improving constantly of people's living standard, the use of mobile phone is more and more universal in people's daily life, mobile phone recording having become an indispensable critical function of mobile phone.The mobile phone sound-recording function exists some problems on the recording data storage mechanism, such as when just using mobile phone to record, run into the phone memory deficiency or the battery electric quantity deficiency causes mobile phone shutdown, the recording file of having recorded can not get preserving, the whole recording file of correcting is lost and be can not get preserving, and causes whole recording failure.Run into this situation and can bring very big trouble to the user.This is because be by the application space during storage of former recording file, create file, be placed on data temporarily in the buffer memory, just remove to read afterwards file, preserve file by filename then, then can cause recording data to store if this preserving type runs into the problems such as mobile phone power down, phone memory are full, thereby cause loss of data.The present most popular smart mobile phone that Android system is installed, the recording system of installing on it does not have yet can head it off.
Summary of the invention
Technical problem to be solved by this invention is, can not immediately preserve for existing mobile phone recording data, and the problem of losing easily, and recording data quick storage method in a kind of a kind of Android system of instant storage recording data is provided.
In order to solve the problems of the technologies described above, the invention provides the recording data quick storage method in a kind of Android system, it is characterized in that, at the inner data pipe that is used for the recording data instantaneous transmission of setting up of recording system, data pipe comprises data input channel and data output channel, set up pipeline data stream mode on the data pipe basis, pipeline data stream comprises pipeline data inlet flow and pipeline data output stream, recording data in the recording thread is as the pipeline data inlet flow, be kept at by the data input channel in the cyclic buffer of system, recording data in the cyclic buffer is as the pipeline data output stream, pass to the recording storage thread by the data output channel, recording data is kept at immediately in the memory of mobile phone by the recording storage thread; Start simultaneously recording thread and recording storage thread when starting recording.
The step that record data transmission, is saved in the mobile phone memory is as follows:
1) starts recording, set up file and file storage directory;
2) judge and to set up the whether success of file and file storage directory that if the unsuccessful step of setting up file and file storage directory of returning, if success, the recording thread writes recording data by the data input channel to cyclic buffer;
3) judge whether the recording data are saved in the cyclic buffer of pipeline;
4) if preserve recording data to the cyclic buffer failure, then judge whether deadlock, if be judged as deadlock then the storage of recording is failed; If judging does not have deadlock, the data output stream is read recording data from pipeline;
If successfully preserve recording data to cyclic buffer, then the data output stream is read recording data to pipeline;
5) recording data in the cyclic buffer is preserved recording data in the mobile phone memory immediately by storage recording thread;
6) judge whether storage space has expired or power down, if storage space, is then returned the recording thread writes the recording data to cyclic buffer by data input stream step less than also not power down;
If storage space is full or power down occurs, then finish recording.
Further, read operation and the write operation in the cyclic buffer of described interim preservation recording data all separated.
Good effect of the present invention is:
1, by pipeline data stream mode instantaneous transmission recording data to memory, can avoid losing because of the recording data that power down or memory space completely cause.
2, data can safely, in time and effectively transmission between two threads.
Description of drawings
Fig. 1 be the present invention record data transmission, be saved in the flow chart of steps in the mobile phone memory.
Embodiment
The present invention is described in further detail below in conjunction with the drawings and specific embodiments.
Recording data quick storage method in the Android of the present invention system, at the inner data pipe of setting up the data instantaneous transmission that is used to record of recording system, data pipe comprises data input channel and data output channel, on the data pipe basis, set up pipeline data stream mode, pipeline data stream comprises pipeline data inlet flow and pipeline data output stream, recording data in the recording thread are as the pipeline data inlet flow, be kept at by the data input channel in the cyclic buffer of system, recording data in the cyclic buffer are as the pipeline data output stream, pass to recording storage thread by the data output channel, be kept at immediately in the storer of mobile phone by the recording storage thread data of will recording.
As shown in Figure 1, the step that record data transmission, is saved in the mobile phone memory is as follows:
1) starts recording, set up recording file and recording file storage directory; To start recording thread and recording storage thread when starting recording simultaneously.
2) judge and to set up the whether success of recording file and recording file storage directory, if the unsuccessful step of setting up file and file storage catalogue of returning,
If success, the recording thread writes recording data by the data input channel to cyclic buffer;
3) judge whether the recording data are saved in the cyclic buffer of pipeline;
4) if preserve recording data to the cyclic buffer failure, then judge whether deadlock, if be judged as deadlock then the storage of recording is failed; If judging does not have deadlock, read recording data by the data output channel;
If successfully preserve the recording data to cyclic buffer, then read the recording data from the data output channel;
5) recording data of reading in the cyclic buffer is preserved recording data in the mobile phone memory immediately by storage recording thread;
6) judge whether storage space has expired or power down, if storage space, is then returned the recording thread writes the recording data to cyclic buffer by data input stream step less than also not power down;
If storage space is full or power down occurs, then finish recording.
The recording of startup mobile phone, recording thread and recording storage thread start simultaneously, and interior read operation and the write operation of cyclic buffer of temporarily preserving recording data all separates.By pipeline data stream mode, recording on one side, on one side the real-time storage data, under the full situation of mobile phone power down or storage space, automatically stop recording, but the recording data under recording before mobile phone power down or storage space are full all have been kept in the storer, have avoided the recording loss of data that completely causes because of power down or storage space, and this preserving type does not consume the space, storage time is short, and the efficient height need not fringe cost.If run into recording by improper interruption, the recording substance of front still is kept at interim cyclic buffer, does not affect data output channel reading out data and pass to the recording storage thread in the extra buffer.Recording thread and two threads of recording storage thread guarantee that data can safely, in time and effectively transmission between it.
Wherein two data pipelines will be realized data transfer between recording thread and the storage recording thread, rather than between a thread the transmission of data because between a thread, carry out the transmission of data, might cyclic buffer be filled and completely cause thread deadlock; Have in the buffering area restricted portion read operation and write operation are separated, be convenient to so final sense data, and pass to storage recording thread.
The above embodiment of the present invention only is to be explanation example of the present invention, and is not to be qualification to embodiments of the present invention.For those of ordinary skill in the field, can also make on the basis of the above description other multi-form variation and changes.Here can't give exhaustive to all embodiments.Everyly belong to the row that conspicuous variation that technical scheme of the present invention amplifies out or change still are in protection scope of the present invention.
Claims (3)
1. the recording data quick storage method in the Android system, it is characterized in that, at the inner data pipe that is used for the recording data instantaneous transmission of setting up of recording system, data pipe comprises data input channel and data output channel, set up pipeline data stream mode on the data pipe basis, pipeline data stream comprises pipeline data inlet flow and pipeline data output stream, recording data in the recording thread is as the pipeline data inlet flow, be kept at by the data input channel in the cyclic buffer of system, recording data in the cyclic buffer is as the pipeline data output stream, pass to the recording storage thread by the data output channel, recording data is kept at immediately in the memory of mobile phone by the recording storage thread; Start simultaneously recording thread and recording storage thread when starting recording.
2. according to the recording data quick storage method in the described Android of claim 1 system, it is characterized in that the step that record data transmission, is saved in the mobile phone memory is as follows:
1) starts recording, set up recording file and recording file storage directory;
2) judge and to set up the whether success of recording file and recording file storage directory that if the unsuccessful step of setting up file and file storage directory of returning, if success, the recording thread writes recording data by the data input channel to cyclic buffer;
3) judge whether the recording data are saved in the cyclic buffer of pipeline;
4) if preserve recording data to the cyclic buffer failure, then judge whether deadlock, if be judged as deadlock then the storage of recording is failed; If judging does not have deadlock, read recording data by the data output channel;
If successfully preserve the recording data to cyclic buffer, then read the recording data from the data output channel;
5) recording data of reading in the cyclic buffer is preserved recording data in the mobile phone memory immediately by storage recording thread;
6) judge whether storage space has expired or power down, if storage space, is then returned the recording thread writes the recording data to cyclic buffer by data input stream step less than also not power down;
If storage space is full or power down occurs, then finish recording.
3. according to the recording data quick storage method in the described Android of claim 1 system, it is characterized in that read operation and write operation in the cyclic buffer of described interim preservation recording data are all separated.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201110051271.6A CN102117328B (en) | 2011-03-03 | 2011-03-03 | Recording data rapid storage method in Android system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201110051271.6A CN102117328B (en) | 2011-03-03 | 2011-03-03 | Recording data rapid storage method in Android system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102117328A true CN102117328A (en) | 2011-07-06 |
CN102117328B CN102117328B (en) | 2013-08-14 |
Family
ID=44216098
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201110051271.6A Expired - Fee Related CN102117328B (en) | 2011-03-03 | 2011-03-03 | Recording data rapid storage method in Android system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102117328B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102881321A (en) * | 2012-09-26 | 2013-01-16 | 深圳市广和通实业发展有限公司 | Circulating continuous recording method based on GSM/GPRS module |
CN104580647A (en) * | 2014-12-31 | 2015-04-29 | 惠州Tcl移动通信有限公司 | Caching method for call record and communication device |
CN109151182A (en) * | 2018-07-30 | 2019-01-04 | 桂林电子科技大学 | A kind of ambient sound remote gathering system and method based on smart phone |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1933575A (en) * | 2006-09-30 | 2007-03-21 | 康佳集团股份有限公司 | Video recording method for photographic hand-held equipment |
CN101299781A (en) * | 2008-06-30 | 2008-11-05 | 宇龙计算机通信科技(深圳)有限公司 | Method, system and mobile terminal for storing sound-recording data |
-
2011
- 2011-03-03 CN CN201110051271.6A patent/CN102117328B/en not_active Expired - Fee Related
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1933575A (en) * | 2006-09-30 | 2007-03-21 | 康佳集团股份有限公司 | Video recording method for photographic hand-held equipment |
CN101299781A (en) * | 2008-06-30 | 2008-11-05 | 宇龙计算机通信科技(深圳)有限公司 | Method, system and mobile terminal for storing sound-recording data |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102881321A (en) * | 2012-09-26 | 2013-01-16 | 深圳市广和通实业发展有限公司 | Circulating continuous recording method based on GSM/GPRS module |
CN104580647A (en) * | 2014-12-31 | 2015-04-29 | 惠州Tcl移动通信有限公司 | Caching method for call record and communication device |
CN109151182A (en) * | 2018-07-30 | 2019-01-04 | 桂林电子科技大学 | A kind of ambient sound remote gathering system and method based on smart phone |
Also Published As
Publication number | Publication date |
---|---|
CN102117328B (en) | 2013-08-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102955720B (en) | A kind of method improving ext file system stability | |
WO2006103652A3 (en) | Computer volatile memory power backup system | |
CN104063447A (en) | Monitoring video file restoring method | |
WO2006060157A3 (en) | System and method for recording television content at a set top box | |
CN102117328B (en) | Recording data rapid storage method in Android system | |
CN103942160A (en) | Storage system, storage device and data storage method | |
EP1998246A2 (en) | Management of internal operations by a storage device | |
CN101706783A (en) | Method and device for checking and repairing files in embedded equipment | |
CN105760252A (en) | Method and device for achieving transaction log image backup | |
CN105280239A (en) | Method and device for dynamically realizing ECC check codes of solid state drives | |
CN103455391B (en) | A kind of apparatus and method of data protection of dynamic conditioning | |
CN104361029B (en) | A kind of video cycle storage of duplicate key and the method for quick-searching | |
US20070043968A1 (en) | Disk array rebuild disruption resumption handling method and system | |
CN103617008A (en) | Double-SD-card multimedia file storage system and method for vehicle-mounted video monitoring terminal | |
CN202771180U (en) | Programmable controller capable of saving when power goes off | |
CN104809214A (en) | Test-data breakpoint continuous transmission method applied to microwave automatic test system | |
CN102708062A (en) | Multimedia storage method and multimedia storage device based on data block | |
WO2010062115A3 (en) | Recording multimedia data | |
CN111885331A (en) | Novel mp4 packaging method for automatic storage of video interruption | |
CN201877127U (en) | USB (Universal Serial Bus) flash disk capable of preventing important data from being lost | |
CN102750342A (en) | Method for maintaining data consistency for cluster file system | |
WO2009031200A1 (en) | Data recording program, data recording device, data recording method, and recording medium | |
WO2013036046A3 (en) | Mobile terminal and method for managing the file system thereof | |
CN104572893A (en) | Hybrid storage method for data in database | |
CN202134001U (en) | Executable file backup device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20130814 Termination date: 20160303 |