CN110471622B - SD card data writing method and device, storage medium and terminal - Google Patents

SD card data writing method and device, storage medium and terminal Download PDF

Info

Publication number
CN110471622B
CN110471622B CN201910697671.0A CN201910697671A CN110471622B CN 110471622 B CN110471622 B CN 110471622B CN 201910697671 A CN201910697671 A CN 201910697671A CN 110471622 B CN110471622 B CN 110471622B
Authority
CN
China
Prior art keywords
residual space
memory
card
working state
memory residual
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
CN201910697671.0A
Other languages
Chinese (zh)
Other versions
CN110471622A (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.)
Shenzhen Zongzheng Intellectual Property Service 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 CN201910697671.0A priority Critical patent/CN110471622B/en
Publication of CN110471622A publication Critical patent/CN110471622A/en
Application granted granted Critical
Publication of CN110471622B publication Critical patent/CN110471622B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephone Function (AREA)

Abstract

The embodiment of the application discloses an SD card data writing method, an SD card data writing device, a storage medium and a terminal, wherein the SD card data writing method comprises the following steps: when the writing of data into the SD card is detected, acquiring a time difference value between the current time and the historical time when the data is written into the SD card last time; when the time difference value is smaller than a preset time difference value, setting the working state as a second working state, wherein the second working state is as follows: setting data writing speed according to the relation between the current memory residual space and the first memory residual space interval and the third memory residual space interval; when the time difference value is greater than or equal to the preset time difference value, setting the working state as a first working state, wherein the first working state is as follows: and setting the data writing speed according to the relation between the current memory residual space and the first memory residual space interval, the second memory residual space interval and the third memory residual space interval. According to the method and the device, the writing speed of the SD card can be effectively improved.

Description

SD card data writing method and device, storage medium and terminal
Technical Field
The present invention relates to the field of applications of mobile terminals, and in particular, to a method and apparatus for writing SD card data, a storage medium, and a terminal.
Background
The SD card (Secure Digital Memory Card), also called a secure digital card, is a new generation of memory device based on a semiconductor flash memory, and is widely used on portable devices such as digital cameras, personal digital assistants (abbreviated as PDA in foreign language), multimedia players, and the like. The SD card is the most widely applied memory card in the current consumer digital equipment, and has a plurality of characteristics of large capacity, high performance, safety and the like.
In the prior art, because the storage space of the mobile terminal is limited, an external SD card is often needed, when the mobile terminal reads and writes the external SD card, the data to be written into the SD card is firstly put into the memory and then further written into the SD card, and because the memory is shared by application programs of various mobile terminals, the writing speed is slower when the mobile terminal frequently writes into the SD card.
Disclosure of Invention
The embodiment of the application provides a method, a device, a storage medium and a terminal for writing SD card data, which can improve the writing speed of the SD card.
The embodiment of the application provides a data writing method of an SD card, which comprises the following steps:
when the writing of data into the SD card is detected, acquiring a time difference value between the current time and the historical time when the data is written into the SD card last time;
When the time difference value is smaller than a preset time difference value, setting the working state as a second working state, wherein the second working state is as follows: setting data writing speed according to the relation between the current memory residual space and the first memory residual space interval and the third memory residual space interval;
when the time difference value is greater than or equal to the preset time difference value, setting the working state as a first working state, wherein the first working state is as follows: and setting the data writing speed according to the relation between the current memory residual space and the first memory residual space interval, the second memory residual space interval and the third memory residual space interval.
Correspondingly, the embodiment of the application also provides an SD card writing device, which comprises:
the device comprises an acquisition unit, a storage unit and a storage unit, wherein the acquisition unit is used for acquiring a time difference value between the current time and the historical time when the data is written into the SD card last time when the data is written into the SD card;
the first setting unit is used for setting the working state to be a second working state when the time difference value is smaller than a preset time difference value, and the second working state comprises setting the writing speed according to the first memory residual space interval and the third memory residual space interval;
And the second setting unit is used for setting the working state to be a first working state when the time difference value is greater than or equal to the preset time difference value, and the first working state comprises setting the writing speed according to the first memory residual space interval, the second memory residual space interval and the third memory residual space interval.
In some embodiments, the second setting unit further comprises:
an acquisition subunit, configured to acquire the memory remaining space;
the first setting subunit is configured to set the writing speed as a first writing speed if the memory residual space is in the first memory residual space interval;
and the second setting subunit is configured to set the writing speed as a second writing speed if the memory residual space is in the second memory residual space interval.
Accordingly, the embodiments of the present application further provide a storage medium storing a plurality of instructions adapted to be loaded by a processor to perform the steps in the SD card data writing method as described above.
Correspondingly, the embodiment of the application also provides a terminal, which comprises a processor and a memory, wherein the memory stores a plurality of instructions, and the processor loads the instructions to execute the steps in the SD card data writing method.
According to the scheme, when data writing into the SD card is detected, a time difference value between the current time and the historical time when the data is written into the SD card last time is obtained; when the time difference value is smaller than a preset time difference value, setting the working state as a second working state, wherein the second working state is as follows: setting data writing speed according to the relation between the current memory residual space and the first memory residual space interval and the third memory residual space interval; when the time difference value is greater than or equal to the preset time difference value, setting the working state as a first working state, wherein the first working state is as follows: and setting the data writing speed according to the relation between the current memory residual space and the first memory residual space interval, the second memory residual space interval and the third memory residual space interval. According to the method and the device, the writing speed of the SD card can be effectively improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flow chart of an SD card data writing method according to an embodiment of the present application.
Fig. 2 is a flowchart of another method for writing SD card data according to an embodiment of the present application.
Fig. 3 is an operation interface diagram of an SD card data writing method according to an embodiment of the present application.
Fig. 4 is a block diagram of an SD card writing device according to an embodiment of the present application.
Fig. 5 is a block diagram of another SD card writing device according to an embodiment of the present application.
Fig. 6 is a schematic structural diagram of a 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 fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
Based on the above problems, embodiments of the present application provide a method, an apparatus, a storage medium, and a terminal for writing SD card data, which can effectively improve the writing speed of the SD card. The following will describe in detail. The following description of the embodiments is not intended to limit the preferred embodiments.
Referring to fig. 1, fig. 1 is a flowchart of an SD card data writing method according to an embodiment of the present disclosure. The SD card data writing method can be applied to mobile terminals such as mobile phones, tablet computers, notebook computers, palm computers, portable media players (Portable Media Player, PMP) and fixed terminals such as desktop computers. The specific flow of the SD card data writing method can be as follows:
101. when the data writing to the SD card is detected, a time difference value between the current time and the historical time when the data is written to the SD card last time is obtained.
Specifically, an instruction to write data to the SD card is initiated by a user. The writing of the data into the SD card means that the data in the memory of the terminal is moved to the SD card connected with the terminal, and the terminal is connected with the SD card through the hard interface. The written data is system memory information, and may include symbols, characters, numbers, voice, images, video, etc. Specifically, the system memory information can be displayed on the terminal interface in a file mode. For example, the user may select any one of the files in the terminal repository and then perform an operation to move to the SD card on this file. Specifically, the current time may be obtained by recording the time when the data is written into the SD card. The history time when the data is written to the SD card is obtained may be the time after the last writing of the data to the SD card is completed. The time difference between the recorded two times is calculated. For example, the last time data was written to the SD card, the time after completion may be 11 hours 30 minutes 4 seconds. The time until the data is currently written to the SD card may be 11 hours 30 minutes 6 seconds, and the time difference between the two writing of the data to the SD card is 2 seconds.
In some embodiments, the step "when writing data to the SD card is detected" may further include the following flow:
and executing the first working state when the data written into the SD card is detected to be the primary writing.
Specifically, when a user triggers an instruction of writing data into the SD card for the first time, namely, when the user performs primary data writing into the SD card, the terminal performs data writing into the SD card according to the first working state, so that the data writing into the SD card is prevented from being stopped when the history time of writing data into the SD card is not detected. The first working state may be: acquiring a current memory residual space, determining a current memory residual space interval, and setting the data writing speed into the SD card as a first SD card writing speed if the current memory residual space interval is in a first memory residual space interval; if the current memory remaining space interval is in the second memory remaining space interval or the third memory remaining space interval, the data writing speed to the SD card may be set to be the second SD card writing speed.
The memory residual space interval can be divided by the relation between the memory residual space and the preset memory residual space. For example, the preset memory residual space may include a first memory residual space and a second memory residual space, where the first memory residual space may be larger than the second memory residual space.
For example, the partitioning rule may be: if the memory residual space is larger than the first memory residual space, the memory residual space is located in a first memory residual space interval; if the memory residual space is smaller than or equal to the first memory residual space and larger than or equal to the second memory residual space, the memory residual space is located in a second memory residual space interval; and if the memory residual space is smaller than the second memory residual space, the memory residual space is positioned in a third memory residual space interval.
In some embodiments, the step "when writing data to the SD card is detected" may further include the following flow:
detecting a current memory residual space interval in which a current residual memory space is located in the process of writing data into the SD card;
determining whether the current memory residual space interval is an original memory residual space interval or not, wherein the original memory residual space interval is a memory residual space interval when data is written into the SD card;
if not, setting the writing speed according to the current memory residual space interval.
Specifically, during the process of writing data into the SD card, the current memory residual space is changed continuously, and the memory residual space interval is changed. And detecting a memory residual space interval in which the current memory residual space is located. For example, the current memory residual space can be obtained in real time, the current memory residual space is compared with the first memory residual space and the second memory residual space, and the memory residual space interval where the current memory residual space is located is determined according to the comparison result.
Specifically, the current memory residual space interval is compared with the original memory residual space interval, wherein the original memory residual space interval is the memory residual space interval where the obtained memory space is located before writing data into the SD card. If the current memory residual space is inconsistent with the original memory residual space, setting the SD card writing speed according to the relation between the current memory residual space interval and the current working state. The writing speed of the SD card can be improved by acquiring the residual space of the memory in real time and setting the writing speed of the SD card according to the residual space interval.
In some embodiments, the step of determining whether the current memory remaining space interval is the original memory remaining space interval further includes the following steps:
judging whether the current memory residual space interval is the second memory residual space interval or not;
if yes, determining whether the working state is the second working state;
if yes, maintaining the current writing speed to write data into the SD card.
Specifically, the obtained current memory residual space is compared with the first memory residual space and the second memory residual space, and a comparison result is obtained.
The comparison result may be that the current memory residual space is smaller than or equal to the first memory residual space and larger than or equal to the second memory residual space, and then the current memory residual space is determined to be in the second memory residual space interval.
Further, the current working state is detected. The current working state can be a first working state, and at this time, the data is written into the SD card according to the set writing speed of the first working state. The current working state can be the second working state, and at this time, data is continuously written into the SD card according to the current writing speed. In the step, when the memory residual space is in the second memory residual space in the second working state, the data writing of the SD card can still be continued.
102. When the time difference value is smaller than a preset time difference value, setting the working state as a second working state, wherein the second working state is as follows: and setting the data writing speed according to the relation between the current memory residual space and the first memory residual space interval and the third memory residual space interval.
Specifically, according to the calculated time difference value, the time difference value is compared with a preset time difference value. The preset time difference value can be automatically set according to the memory size system. The working state can be switched more reasonably and effectively according to the setting of the preset time difference value, and the writing speed of the SD card is set.
For example, the time difference may be smaller than the preset time difference, and at this time, the operating state is set to the second operating state. The second working state may be: acquiring a current memory residual space, determining a current memory residual space interval, and setting the data writing speed into the SD card as a first SD card writing speed if the current memory residual space interval is in a first memory residual space interval; if the current memory remaining space interval is in the third memory remaining space interval, the data writing speed to the SD card can be set to be the second SD card writing speed.
In some embodiments, the step of setting the working state to the second working state may further include the following procedures:
acquiring the residual space of the current memory;
if the current memory residual space is in the second memory residual space interval, starting timing;
and when the counted time reaches a preset time interval, switching the second working state into the first working state.
Specifically, when in the second working state, the remaining space of the memory can be obtained in real time. If the obtained memory residual space is detected to be in the second memory residual space interval, the writing speed of the current data written into the SD card is not changed, and timing is started. Specifically, when the preset time interval is reached, the current remaining space interval of the memory is still in the second remaining space interval of the memory, and the second working state can be switched to the first working state. By switching the working state at preset time intervals, the time for writing data into the SD card can be effectively saved.
103. When the time difference value is greater than or equal to the preset time difference value, setting the working state as a first working state, wherein the first working state is as follows: and setting the data writing speed according to the relation between the current memory residual space and the first memory residual space interval, the second memory residual space interval and the third memory residual space interval.
Specifically, according to the calculated time difference value, the time difference value is compared with a preset time difference value.
For example, the time difference may be equal to or greater than a preset time difference, and at this time, the operating state is set to be the first operating state.
In some embodiments, the step of setting the operation state to the first operation state may include the following procedures:
acquiring the memory residual space;
if the memory residual space is in the first memory residual space interval, setting the writing speed as a first writing speed;
and if the memory residual space is in the second memory residual space interval, setting the writing speed as a second writing speed.
Specifically acquiring a current memory residual space, determining a current memory residual space interval, and if the current memory residual space interval is in a first memory residual space interval, setting the data writing speed into the SD card as a first SD card writing speed; if the current memory remaining space interval is in the second memory remaining space interval or the third memory remaining space interval, the data writing speed to the SD card may be set to be the second SD card writing speed. When the obtained memory residual space is any value, the writing speed of the SD card can be set to write data into the SD card by executing the first working state.
In this embodiment, when data is written into the SD card by detecting, a time difference between a current time and a last time when data is written into the SD card is obtained, and when the time difference is smaller than a preset time difference, the working state is set to be a second working state, where the second working state is: setting data writing speed according to the relation between the current memory residual space and the first memory residual space interval and the third memory residual space interval; when the time difference value is greater than or equal to the preset time difference value, setting the working state as a first working state, wherein the first working state is as follows: and setting the data writing speed according to the relation between the current memory residual space and the first memory residual space interval, the second memory residual space interval and the third memory residual space interval. According to the method and the device, the time difference of the writing speed of the SD card is obtained through two continuous settings, the writing speed of the SD card is dynamically allocated according to the size of the time difference, the writing time of the SD card can be effectively saved, and the efficiency of writing data into the SD card is improved.
Referring to fig. 2, fig. 2 is a flowchart of another method for writing SD card data according to an embodiment of the present disclosure. In this embodiment, a mobile phone may be described as an example of a terminal. The specific scene application of the SD card data writing method can be as follows:
201. The terminal receives a request to write data to the SD card.
In this embodiment, it is first determined that the SD card is placed in the terminal. The user can start the instruction for writing data into the SD card, and the terminal executes corresponding operation according to the instruction after receiving the instruction for writing data into the SD card triggered by the user.
For example, referring to fig. 3, fig. 3 is an operation interface diagram provided in an embodiment of the present application. The user opens the terminal, and opens the storage folder to see the terminal screen interface shown on the left side of fig. 3, where the interface is a file list interface, and each folder in the system storage space is shown. The user may select any file to open.
For example, the user opens folder, may select folder 1, and then the terminal screen interface jumps to the interface shown on the right side of FIG. 3. The interface may present the contents of file 1 and the user may operate folder 1 by triggering a button below the screen. Specifically, the user may click on the "move to SD card" button, triggering an instruction to write data to the SD card.
202. The terminal obtains the current memory residual space according to the request, sets the data writing speed according to the first working state and records the data writing time.
In this embodiment, the terminal may set the SD card writing speed according to the first working state according to the received SD card writing data request.
For example, the current memory remaining space M is obtained, and for example, the memory remaining space M may be 500M. The memory residual space M is combined with a first memory residual space (M1) and a second memory residual space (M2), wherein the first memory residual space M1 can be 400M, and the second memory residual space M2 can be 300M. At this time, if the memory residual space M is greater than the first memory residual space M1, it may be determined that the memory residual space interval in which the memory residual space M is located is the first memory residual space interval. In the first working state, when the memory is in the first memory residual space interval, the writing speed of the SD card can be set to be the first writing speed, wherein the first writing speed can be 10M/s.
203. The terminal starts a first timer, acquires the current memory residual space at fixed time, sets the data writing speed according to a first working state and records the data writing time.
In this embodiment, when the terminal sets the SD card writing speed and starts to perform the operation of writing data to the SD card at this writing speed, the first timer may be started. For example, the time setting of the first timer may be 5 seconds. And acquiring the current memory residual space according to the time set by the first timer, setting the writing speed of the SD card according to the first working state, and recording the writing time.
For example, the terminal may start writing data to the SD card at a writing speed of 10M/sec, and at the same time, the first timer may start setting a 5-second timer. The timer may count down for 5 seconds to 0 seconds, or count up for 0 seconds to 5 seconds. After the timing is finished, the remaining memory space M3 is acquired, for example, the remaining memory space M3 may be 600M. At this time, the memory residual space M3 may still be larger than the first memory residual space M1, and then it may be determined that the memory residual space interval where the memory residual space M3 is located is the first memory residual space interval. In the first working state, when the memory is in the first memory residual space interval, the writing speed of the SD card can be set to be the first writing speed, namely 10M/s. The time when the terminal records the current data writing to SD may then be 12 hours 30 minutes 4 seconds.
204. The terminal obtains the time difference between the adjacent two data writing moments, judges whether the time difference is smaller than a preset time difference, and if yes, executes step 205; if not, go to step 206.
In this embodiment, when the terminal writes data to the SD card, the writing speed may also be changed according to the continuous change of the remaining space of the memory. The current time is recorded each time the writing speed is set. And the terminal performs subtraction calculation on two adjacent moments to obtain a time difference value.
For example, the first time the terminal records the writing speed may be 12 hours 30 minutes 4 seconds, the second time the terminal records the writing speed may be 12 hours 30 minutes 6 seconds, and the terminal subtracts the two times to obtain a time difference of 2 seconds. And then comparing the obtained time difference value with a preset time difference value, wherein the preset time difference value can be 3 seconds. By comparison, it can be determined that the time difference is smaller than the preset time difference. Step 205 may be performed based on the comparison result.
In some embodiments, another situation may also exist. For example, the time when the terminal records the first set writing speed may be 12 hours and 30 minutes and 4 seconds, the time when the terminal records the second set writing speed may be 12 hours and 30 minutes and 8 seconds, and the terminal subtracts the two times to obtain a time difference of 4 seconds. And then comparing the obtained time difference value with a preset time difference value, wherein the preset time difference value can be 3 seconds. By comparison, it can be determined that the time difference is greater than the preset time difference. Step 206 may be performed based on the comparison result.
205. And the terminal switches the current first working state to the second working state and starts a second timer to acquire the current memory residual space.
In this embodiment, when it is determined that the time difference between the two adjacent SD card writing speed settings is smaller than the preset time difference, the terminal switches the first operating state executed at this time to the second operating state. The second timer is then started, for example, in order to avoid frequent writing of data to the SD card, the set duration of the second timer may be longer than the set duration of the first timer, and the second timer may be set to 20 seconds. And the terminal closes the first timer and acquires the remaining space of the memory according to the set duration of the second timer.
For example, at this time, the remaining memory space may be 100M, and the writing speed of the terminal for writing data into the SD card may be 10M/s. The terminal can switch the first working state to the second working state, when the terminal is in the second working state, the memory residual space is smaller than the second memory residual space M2, the memory residual space interval is determined to be a third memory residual space interval, and the second writing speed can be set to write data into the SD card. Wherein the second writing speed may be 5M/sec. And starting to count according to the duration of 20 seconds set by the second timer to acquire the memory residual space.
206. The terminal sets the writing speed according to the first working state.
In this embodiment, when it is determined that the time difference between the two adjacent SD card writing speed settings is greater than the preset time difference, the terminal will continue to execute the first working state.
For example, at this time, the remaining memory space may be 100M, and the writing speed of the terminal for writing data into the SD card may be 10M/s. The terminal can continue to execute the first working state, when the terminal is in the first working state, the memory residual space is smaller than the second memory residual space M2, the memory residual space interval is determined to be a third memory residual space interval, and the second writing speed, namely the speed of 5M/s, can be set for writing data into the SD card.
207. When the terminal is in the second working state and the data writing speed is not set in the second timer, the second working state is switched to the first working state, and the second timer is closed.
In this embodiment, when the terminal is in the second operating state, and the second timer is started. And in the set time length of the timer, the memory residual space of the terminal can be always in the second memory residual space interval, and the writing speed is not set for the SD card in the second timing period. At this time, the terminal switches the second operating state to the first operating state and closes the second timer.
For example, at this time, the memory residual space of the terminal may be 100M, data is written into the SD card according to the set second writing speed of 5M/s, the second timer is started, the memory residual space interval is obtained, and the obtained memory residual space may be 450M, so that the current memory residual space interval is determined to be the second memory residual space interval according to the comparison between the memory residual space and the first memory residual space M1 and the second memory residual space M2, and according to the second working state, the SD card writing speed is not set when the current memory residual space interval is in the second memory residual space interval. At this time, the second operating state may be switched back to the first operating state and the second timer may be closed.
In this embodiment, the current memory residual space is obtained by obtaining the current memory residual space according to a request, setting the data writing speed based on the first working state and recording the data writing time, starting a first timer, obtaining the current memory residual space at regular time, setting the data writing speed according to the first working state and recording the data writing time, obtaining the time difference between two adjacent data writing times, judging whether the time difference is smaller than the preset time difference, if so, switching the current first working state to the second working state and starting the second timer to obtain the current memory residual space; if not, the writing speed is set according to the first working state, and when the first working state is in the second working state and the data writing speed is not set in the second timer, the second working state is switched to the first working state, and the second timer is closed, so that the SD card can be improved. According to the method and the device, the writing speed to the SD card can be effectively prevented from being set frequently, and the consumption of the mobile terminal is reduced.
In order to facilitate better implementation of the SD card data writing method provided by the embodiment of the present application, the embodiment of the present application further provides a device based on the SD card data writing method. The meaning of the noun is the same as that in the method for writing the SD card data, and specific implementation details can be referred to the description in the method embodiment.
Referring to fig. 4, fig. 4 is a block diagram of a writing device for an SD card according to an embodiment of the present application, including:
an obtaining unit 401, configured to obtain, when it is detected that data is written into an SD card, a time difference between a current time and a historical time when data is written into the SD card last time;
a first setting unit 402, configured to set, when the time difference is smaller than a preset time difference, an operating state to be a second operating state, where the second operating state includes setting a writing speed according to a first remaining space interval of the memory and a third remaining space interval of the memory;
and a second setting unit 403, configured to set, when the time difference is greater than or equal to the preset time difference, a working state to be a first working state, where the first working state includes setting the writing speed according to the first remaining space section, the second remaining space section, and the third remaining space section.
Referring to fig. 5, in some embodiments, the second setting unit 403 includes:
an obtaining subunit 4031, configured to obtain the remaining memory space;
a first setting subunit 4032, configured to set the writing speed to be a first writing speed if the memory remaining space is in the first memory remaining space interval;
the second setting subunit 4033 is configured to set the writing speed to be the second writing speed if the remaining memory space is in the second remaining memory space interval.
According to the embodiment, when data writing to the SD card is detected, a time difference value between the current time and the historical time when the data is written to the SD card last time is obtained; when the time difference value is smaller than a preset time difference value, setting the working state as a second working state, wherein the second working state is as follows: setting data writing speed according to the relation between the current memory residual space and the first memory residual space interval and the third memory residual space interval; when the time difference value is greater than or equal to the preset time difference value, setting the working state as a first working state, wherein the first working state is as follows: and setting the data writing speed according to the relation between the current memory residual space and the first memory residual space interval, the second memory residual space interval and the third memory residual space interval. According to the method and the device for writing the data into the SD card, the writing speed of the SD card is set through the time difference of writing the data into the SD card, so that the writing speed is effectively prevented from being set to the SD card frequently, the power consumption of the terminal can be reduced, and the writing efficiency of the SD card is further effectively improved.
The embodiment of the application also provides a terminal. As shown in fig. 6, the terminal may include Radio Frequency (RF) circuitry 601, memory 602 including one or more computer readable storage media, an input unit 603, a display unit 604, a sensor 605, audio circuitry 606, a wireless fidelity (WiFi, wireless Fidelity) module 607, a processor 608 including one or more processing cores, and a power supply 609. It will be appreciated by those skilled in the art that the terminal structure shown in fig. 6 is not limiting of the terminal and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components. Wherein:
the RF circuit 601 may be used for receiving and transmitting signals during the process of receiving and transmitting information, in particular, after receiving downlink information of a base station, the downlink information is processed by one or more processors 608; in addition, data relating to uplink is transmitted to the base station. Typically, RF circuitry 601 includes, but is not limited to, an antenna, at least one amplifier, a tuner, one or more oscillators, a subscriber identity module (SIM, subscriber Identity Module) card, a transceiver, a coupler, a low noise amplifier (LNA, low Noise Amplifier), a duplexer, and the like. In addition, the RF circuitry 601 may also communicate with networks and other devices through wireless communications.
The memory 602 may be used to store software programs and modules that are stored in the memory 602 for execution by the processor 608 to perform various functional applications and data processing. The memory 602 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, application programs required for at least one function (such as a sound playing function, an image playing function, etc.), and the like. In addition, the memory 602 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 602 may also include a memory controller to provide access to the memory 602 by the processor 608 and the input unit 603.
The input unit 603 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, in one particular embodiment, the input unit 603 may include a touch-sensitive surface, as well as other input devices. The touch-sensitive surface, 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 thereon or thereabout by a user using any suitable object or accessory such as a finger, stylus, etc.), and actuate the corresponding connection means according to a predetermined program. The input unit 603 may comprise other input devices in addition to a touch sensitive surface. In particular, other input devices may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, mouse, joystick, etc.
The display unit 604 may be used to display information input by a user or information provided to the user and various graphical user interfaces of the server, which may be composed of graphics, text, icons, video and any combination thereof. The display unit 604 may include a display panel, which may be optionally configured in the form of a liquid crystal display (LCD, liquid Crystal Display), an Organic Light-Emitting Diode (OLED), or the like. Further, the touch-sensitive surface may overlay a display panel, and upon detection of a touch operation thereon or thereabout, the touch-sensitive surface is passed to the processor 608 to determine the type of touch event, and the processor 608 then provides a corresponding visual output on the display panel based on the type of touch event. Although in fig. 6 the touch sensitive surface and the display panel are implemented as two separate components for input and output functions, in some embodiments the touch sensitive surface may be integrated with the display panel to implement the input and output functions.
The terminal may also include at least one sensor 605, 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 according to the brightness of ambient light, and a proximity sensor that may turn off the display panel and the backlight when the server moves to the ear.
Audio circuitry 606, speakers, and a microphone may provide an audio interface between the user and the server. The audio circuit 606 may transmit the received electrical signal after audio data conversion to a speaker, where the electrical signal is converted to a sound signal for output; on the other hand, the microphone converts the collected sound signals into electrical signals, which are received by the audio circuit 606 and converted into audio data, which are processed by the audio data output processor 608 for transmission to, for example, a terminal via the RF circuit 601, or which are output to the memory 602 for further processing. The audio circuit 606 may also include an ear bud jack to provide communication between the peripheral ear bud and the server.
The WiFi belongs to a short-distance wireless transmission technology, and the terminal can help the user to send and receive e-mail, browse web pages, access streaming media and the like through the WiFi module 607, so that wireless broadband internet access is provided for the user. Although fig. 6 shows a WiFi module 607, it is understood that it does not belong to the essential constitution of the terminal, and can be omitted entirely as required within a range that does not change the essence of the application.
The processor 608 is a control center of the terminal, and connects various parts of the entire mobile phone using various interfaces and lines, and performs various functions of the server and processes data by running or executing software programs and modules stored in the memory 602 and calling data stored in the memory 602, thereby performing overall monitoring of the mobile phone. Optionally, the processor 608 may include one or more processing cores; preferably, the processor 608 may integrate an application processor that primarily handles operating systems, user interfaces, applications, etc., with a modem processor that primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 608.
The terminal also includes a power supply 609 (e.g., a battery) for powering the various components, which may be logically connected to the processor 608 via a power management system so as to provide for managing charging, discharging, and power consumption by the power management system. The power supply 609 may also include one or more of any components, such as 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.
Specifically, in this embodiment, the processor 608 in the terminal loads executable files corresponding to the processes of one or more application programs into the memory 602 according to the following instructions, and the processor 608 executes the application programs stored in the memory 602, so as to implement various functions:
when the writing of data into the SD card is detected, acquiring a time difference value between the current time and the historical time when the data is written into the SD card last time;
when the time difference value is smaller than a preset time difference value, setting the working state as a second working state, wherein the second working state is as follows: setting data writing speed according to the relation between the current memory residual space and the first memory residual space interval and the third memory residual space interval;
When the time difference value is greater than or equal to the preset time difference value, setting the working state as a first working state, wherein the first working state is as follows: and setting the data writing speed according to the relation between the current memory residual space and the first memory residual space interval, the second memory residual space interval and the third memory residual space interval.
According to the scheme, when data writing into the SD card is detected, a time difference value between the current time and the historical time when the data is written into the SD card last time is obtained; when the time difference value is smaller than a preset time difference value, setting the working state as a second working state, wherein the second working state is as follows: setting data writing speed according to the relation between the current memory residual space and the first memory residual space interval and the third memory residual space interval; when the time difference value is greater than or equal to the preset time difference value, setting the working state as a first working state, wherein the first working state is as follows: the data writing speed is set according to the relation between the current memory residual space and the first memory residual space interval, the second memory residual space interval and the third memory residual space interval, so that the writing speed of the SD card can be effectively improved.
Those of ordinary skill in the art will appreciate that all or a portion of the steps in 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, the embodiments of the present application provide a storage medium having stored therein a plurality of instructions that can be loaded by a processor to perform the steps in any of the SD card data writing methods provided in the embodiments of the present application. For example, the instructions may perform the steps of:
when the writing of data into the SD card is detected, acquiring a time difference value between the current time and the historical time when the data is written into the SD card last time; when the time difference value is smaller than a preset time difference value, setting the working state as a second working state, wherein the second working state is as follows: setting data writing speed according to the relation between the current memory residual space and the first memory residual space interval and the third memory residual space interval; when the time difference value is greater than or equal to the preset time difference value, setting the working state as a first working state, wherein the first working state is as follows: and setting the data writing speed according to the relation between the current memory residual space and the first memory residual space interval, the second memory residual space interval and the third memory residual space interval.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
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 steps in any one of the SD card data writing methods provided in the embodiments of the present application may be executed due to the instructions stored in the storage medium, so that the beneficial effects that any one of the SD card data writing methods provided in the embodiments of the present application may be achieved, which are detailed in the previous embodiments and are not described herein.
The method, the device, the storage medium and the terminal for writing the SD card data provided by the embodiment of the application are described in detail, and specific examples are applied to the description of the principle and the implementation of the application, and the description of the above embodiments is only used for helping to understand the method and the core idea of the application; meanwhile, those skilled in the art will have variations in the specific embodiments and application scope in light of the ideas of the present application, and the present description should not be construed as limiting the present application in view of the above.

Claims (10)

1. A method for writing SD card data, comprising:
when the writing of data into the SD card is detected, acquiring a time difference value between the current time and the historical time when the data is written into the SD card last time;
when the time difference value is smaller than a preset time difference value, setting the working state as a second working state, wherein the second working state is as follows: setting data writing speed according to the relation between the current memory residual space and the first memory residual space interval and the third memory residual space interval;
when the time difference value is greater than or equal to the preset time difference value, setting the working state as a first working state, wherein the first working state is as follows: and setting the data writing speed according to the relation between the current memory residual space and the first memory residual space interval, the second memory residual space interval and the third memory residual space interval.
2. The method of claim 1, wherein the setting the operating state to be the second operating state further comprises:
acquiring the residual space of the current memory;
if the current memory residual space is in the second memory residual space interval, starting timing;
and when the counted time reaches a preset time interval, switching the second working state into the first working state.
3. The method of claim 1, wherein the setting the operating state to be the first operating state comprises:
acquiring the memory residual space;
if the memory residual space is in the first memory residual space interval, setting the writing speed as a first writing speed;
and if the memory residual space is in the second memory residual space interval, setting the writing speed as a second writing speed.
4. The method according to claim 1, wherein when writing data to the SD card is detected, obtaining a time difference between a current time and a history time when data was last written to the SD card, further comprising:
and executing the first working state when the data written into the SD card is detected to be the primary writing.
5. The method as recited in claim 1, further comprising:
detecting a current memory residual space interval in which a current residual memory space is located in the process of writing data into the SD card;
determining whether the current memory residual space interval is an original memory residual space interval or not, wherein the original memory residual space interval is a memory residual space interval when data is written into the SD card;
If not, setting the writing speed according to the current memory residual space interval.
6. The method of claim 5, wherein determining whether the current memory remaining space interval is an original memory remaining space interval comprises:
judging whether the current memory residual space interval is the second memory residual space interval or not;
if yes, determining whether the working state is the second working state;
if yes, maintaining the current writing speed to write data into the SD card.
7. An SD card writing device, comprising:
the device comprises an acquisition unit, a storage unit and a storage unit, wherein the acquisition unit is used for acquiring a time difference value between the current time and the historical time when the data is written into the SD card last time when the data is written into the SD card;
the first setting unit is used for setting the working state to be a second working state when the time difference value is smaller than a preset time difference value, and the second working state comprises setting the writing speed according to the first memory residual space interval and the third memory residual space interval;
and the second setting unit is used for setting the working state to be a first working state when the time difference value is greater than or equal to the preset time difference value, and the first working state comprises setting the writing speed according to the first memory residual space interval, the second memory residual space interval and the third memory residual space interval.
8. The apparatus according to claim 7, wherein the second setting unit includes: the device comprises an acquisition subunit, a first setting subunit and a second setting subunit;
the obtaining subunit is configured to obtain the remaining memory space;
the first setting subunit is configured to set a writing speed as a first writing speed if the remaining memory space is in the first remaining memory space interval;
and the second setting subunit is configured to set the writing speed as a second writing speed if the remaining memory space is in the second remaining memory space interval.
9. A storage medium storing a plurality of instructions adapted to be loaded by a processor to perform the steps of the SD card data writing method of any one of claims 1 to 6.
10. A terminal comprising a processor and a memory, the memory storing a plurality of instructions, the processor loading the instructions to perform the steps in the SD card data writing method of any one of claims 1 to 6.
CN201910697671.0A 2019-07-30 2019-07-30 SD card data writing method and device, storage medium and terminal Active CN110471622B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910697671.0A CN110471622B (en) 2019-07-30 2019-07-30 SD card data writing method and device, storage medium and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910697671.0A CN110471622B (en) 2019-07-30 2019-07-30 SD card data writing method and device, storage medium and terminal

Publications (2)

Publication Number Publication Date
CN110471622A CN110471622A (en) 2019-11-19
CN110471622B true CN110471622B (en) 2024-02-20

Family

ID=68509255

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910697671.0A Active CN110471622B (en) 2019-07-30 2019-07-30 SD card data writing method and device, storage medium and terminal

Country Status (1)

Country Link
CN (1) CN110471622B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112379834B (en) * 2020-11-11 2022-12-02 深圳市豪恩汽车电子装备股份有限公司 Memory card management device and method

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101291250A (en) * 2008-04-25 2008-10-22 北京泰得思达科技发展有限公司 Alarming method of memory space inadequate in network storage system
JP2010271977A (en) * 2009-05-22 2010-12-02 Fujitsu Ten Ltd Device, method, and program for writing data
CN103501327A (en) * 2013-09-25 2014-01-08 北京奇虎科技有限公司 Downloading method and device based on mobile terminal application
CN106371764A (en) * 2016-08-23 2017-02-01 浪潮(北京)电子信息产业有限公司 Virtual block device-based data processing method and apparatus
WO2017206403A1 (en) * 2016-05-31 2017-12-07 宇龙计算机通信科技(深圳)有限公司 Memory optimization method, optimization apparatus and terminal
CN108170376A (en) * 2017-12-21 2018-06-15 上海新案数字科技有限公司 The method and system that storage card is read and write
CN109857337A (en) * 2018-12-10 2019-06-07 浪潮(北京)电子信息产业有限公司 A kind of writing speed control method, system, device and readable storage medium storing program for executing

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101291250A (en) * 2008-04-25 2008-10-22 北京泰得思达科技发展有限公司 Alarming method of memory space inadequate in network storage system
JP2010271977A (en) * 2009-05-22 2010-12-02 Fujitsu Ten Ltd Device, method, and program for writing data
CN103501327A (en) * 2013-09-25 2014-01-08 北京奇虎科技有限公司 Downloading method and device based on mobile terminal application
WO2017206403A1 (en) * 2016-05-31 2017-12-07 宇龙计算机通信科技(深圳)有限公司 Memory optimization method, optimization apparatus and terminal
CN106371764A (en) * 2016-08-23 2017-02-01 浪潮(北京)电子信息产业有限公司 Virtual block device-based data processing method and apparatus
CN108170376A (en) * 2017-12-21 2018-06-15 上海新案数字科技有限公司 The method and system that storage card is read and write
CN109857337A (en) * 2018-12-10 2019-06-07 浪潮(北京)电子信息产业有限公司 A kind of writing speed control method, system, device and readable storage medium storing program for executing

Also Published As

Publication number Publication date
CN110471622A (en) 2019-11-19

Similar Documents

Publication Publication Date Title
CN109828688B (en) Screen damage processing method, mobile terminal and computer readable storage medium
CN111984165B (en) Method and device for displaying message and terminal equipment
CN108062190B (en) Application running state control method and mobile terminal
CN107734616B (en) Application program closing method and device, storage medium and electronic equipment
US10474507B2 (en) Terminal application process management method and apparatus
CN111158815B (en) Dynamic wallpaper blurring method, terminal and computer readable storage medium
CN110912574B (en) SIM card detection method, device, storage medium and terminal
US20220300328A1 (en) Application optimization method and device, storage medium, and electronic equipment
CN111443803A (en) Mode switching method, device, storage medium and mobile terminal
CN111970671B (en) Control method and device of near field communication module and electronic equipment
CN110688051B (en) Screen recording operation method and device, computer readable storage medium and terminal
CN110471622B (en) SD card data writing method and device, storage medium and terminal
CN109947323B (en) Terminal display method and terminal
CN111372003A (en) Camera switching method and device and terminal
CN112542867B (en) Mobile terminal power supply control method and device, terminal equipment and storage medium
CN106155733B (en) Method and device for running application program
CN111262737B (en) Port configuration management method and device, storage medium and terminal
CN110083205B (en) Page switching method, wearable device and computer-readable storage medium
CN112492554A (en) Data transmission method, device, storage medium and terminal
CN112199050A (en) Storage method, device, storage medium and terminal equipment
CN111966271B (en) Screen panorama screenshot method and device, terminal equipment and storage medium
CN113179344B (en) SIM card detection method, device, storage medium and terminal
CN112199245B (en) Mobile terminal screen detection method, system, storage medium and mobile terminal
CN111654578B (en) Mobile terminal sensor restoration method
CN112199021B (en) Application program opening 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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20240229

Address after: 907, No. 210, Tianwan Road, Tianliao Community, Yutang Street, Guangming District, Shenzhen, Guangdong 518000

Patentee after: Shenzhen Zongzheng Intellectual Property Service Co.,Ltd.

Country or region after: China

Address before: 516006 Zhongkai hi tech Zone, Huizhou, Guangdong, 86 Chang seven Road West

Patentee before: HUIZHOU TCL MOBILE COMMUNICATION Co.,Ltd.

Country or region before: China