[go: up one dir, main page]

CN102203753A - Data writing processing method, apparatus and terminal equipment - Google Patents

Data writing processing method, apparatus and terminal equipment Download PDF

Info

Publication number
CN102203753A
CN102203753A CN2011800006820A CN201180000682A CN102203753A CN 102203753 A CN102203753 A CN 102203753A CN 2011800006820 A CN2011800006820 A CN 2011800006820A CN 201180000682 A CN201180000682 A CN 201180000682A CN 102203753 A CN102203753 A CN 102203753A
Authority
CN
China
Prior art keywords
data
batch
write
writing
write data
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
Application number
CN2011800006820A
Other languages
Chinese (zh)
Other versions
CN102203753B (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Publication of CN102203753A publication Critical patent/CN102203753A/en
Application granted granted Critical
Publication of CN102203753B publication Critical patent/CN102203753B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/20Handling requests for interconnection or transfer for access to input/output bus
    • G06F13/28Handling requests for interconnection or transfer for access to input/output bus using burst mode transfer, e.g. direct memory access DMA, cycle steal
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/10Program control for peripheral devices
    • G06F13/102Program control for peripheral devices where the programme performs an interfacing function, e.g. device driver

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)
  • Stored Programmes (AREA)
  • Telephone Function (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明实施例公开了一种数据写处理方法、装置和终端设备,方法包括:从主机接收第一预设数量的第一批写入数据;执行第二预设数量的数据写入程序,以将第一批写入数据写入存储空间,并从主机接收第一预设数量的第二批写入数据,其中,第二预设数量为第一预设数量的两倍;在接收到第二批写入数据后所述第一批写入数据的写入完成时,通过数据写入程序将第二批写入数据写入存储空间。装置包括接收模块和第一写入模块。本发明实施例还提供了一种终端设备。本发明实施例优化了数据写处理的性能,提高了终端设备的写入速率。

This invention discloses a data write processing method, apparatus, and terminal device. The method includes: receiving a first batch of write data of a first preset quantity from a host; executing a second preset quantity of data write procedures to write the first batch of write data into a storage space; and receiving a second batch of write data of a first preset quantity from the host, wherein the second preset quantity is twice the first preset quantity; and writing the second batch of write data into the storage space by means of a data write procedure after the first batch of write data has been completed following the receipt of the second batch of write data. The apparatus includes a receiving module and a first writing module. This invention also provides a terminal device. This invention optimizes the performance of data write processing and improves the write rate of the terminal device.

Description

数据写处理方法、装置和终端设备Data writing processing method, device and terminal equipment

技术领域technical field

本发明实施例涉及通信技术,尤其涉及一种数据写处理方法、装置和终端设备。Embodiments of the present invention relate to communication technologies, and in particular, to a data writing processing method, device, and terminal equipment.

背景技术Background technique

随着科技的不断发展和进步,通信产品的种类越来越多样化,以不断满足用户的各种需求。其中,终端数据卡产品为一种用于数据存储、读写的通信设备,目前市场上的终端数据卡产品通常均支持迷你(mini)安全数码(Secure Digital;以下简称:SD)卡,当终端数据卡插入到个人电脑(Personal Computer;以下简称:PC)后,PC会弹出SD U盘设备,可供用户读写访问。当终端数据卡作为SD U盘功能时,读数据的性能一般比写数据的性能高,如某产品的读速度可以达到7-8MByte/s,而写速度只有3-4MByte/s,因此,写性能存在优化的必要,以提高用户体验度。With the continuous development and progress of science and technology, the types of communication products are becoming more and more diversified, so as to continuously meet the various needs of users. Among them, the terminal data card product is a communication device used for data storage, reading and writing. Currently, the terminal data card products on the market usually support mini (mini) Secure Digital (Secure Digital; hereinafter referred to as: SD) card. After the data card is inserted into a personal computer (Personal Computer; hereinafter referred to as: PC), the PC will pop up the SD U disk device, which can be read and written by the user. When the terminal data card is used as an SD U disk, the performance of reading data is generally higher than that of writing data. For example, the reading speed of a certain product can reach 7-8MByte/s, while the writing speed is only 3-4MByte/s. Performance optimization is necessary to improve user experience.

目前的通用串行总线(Universal Serial Bus;以下简称:USB)大容量存储(Mass Storage)设备均通过批处理(bulk)端点进行数据传输,通常遵循以下三个阶段:命令块包(Command Block Wrapper;以下简称:CBW)->数据(DATA)->命令状态包(Command Status Wrapper;以下简称:CSW)。其中,CBW为一个数据块,其中携带有主机发给设备的小型计算机系统接口(Small Computer System Interface;以下简称:SCSI)命令,设备根据接收到的CSW便可以确定后续DATA阶段的具体情况,即无数据需要传输、输入(IN)传输(设备到主机)或输出(OUT)传输(主机到设备),而CSW阶段则反馈传输结果到主机或设备。The current Universal Serial Bus (Universal Serial Bus; hereinafter referred to as: USB) mass storage (Mass Storage) devices all transmit data through batch (bulk) endpoints, usually following the following three stages: Command Block Wrapper ; Hereinafter referred to as: CBW)->Data (DATA)->Command Status Wrapper (Command Status Wrapper; hereinafter referred to as: CSW). Among them, CBW is a data block, which carries a small computer system interface (Small Computer System Interface; hereinafter referred to as: SCSI) command sent by the host to the device, and the device can determine the specific situation of the subsequent DATA stage according to the received CSW, that is, No data needs to be transferred, input (IN) transfer (device to host) or output (OUT) transfer (host to device), and the CSW stage feeds back the transfer result to the host or device.

在现有技术中,当PC向终端设备写入数据时,先将写入的数据长度和命令通过CBW传输给设备侧,设备侧接收到CBW后开始准备接收来自PC的数据。在Windows系统下,PC每次发给设备侧需要写入的数据长度为64KByte,对于不足64KByte的数据则一次写入。图1为现有技术中数据写入方法的执行过程和时间轴示意图,如图1所示,时间段A表示设备侧从USB接收到来自PC的64KByte数据,时间段B表示设备侧接收完成数据后再向SD接口写入该64KByte数据,时间段E表示回CSW时间,即在数据写入SD卡后通过CSW将传输结果反馈到PC,时间段F表示从CSW到PC下发下一个数据包的时间。In the prior art, when the PC writes data to the terminal device, it first transmits the written data length and command to the device side through the CBW, and the device side prepares to receive data from the PC after receiving the CBW. Under the Windows system, the length of the data that needs to be written by the PC to the device side each time is 64KByte, and the data that is less than 64KByte is written once. Figure 1 is a schematic diagram of the execution process and time axis of the data writing method in the prior art. As shown in Figure 1, time period A indicates that the device side receives 64KByte data from the PC from the USB, and time period B indicates that the device side receives the completed data Then write the 64KByte data to the SD interface. The time period E indicates the time to return to CSW, that is, after the data is written to the SD card, the transmission result is fed back to the PC through CSW. The time period F indicates that the next data packet is sent from CSW to PC time.

然而,发明人在实现本发明的过程中发现现有技术中至少存在如下缺陷:现有技术采用串行数据传输,不能利用中央处理器(Centre Processing Unit;以下简称:CPU)的多线程以及直接内存访问(Direct Memory Access;以下简称:DMA)并行搬运数据的优势,导致数据写处理的性能较低。However, the inventor finds that there are at least the following defects in the prior art in the process of realizing the present invention: the prior art adopts serial data transmission, and cannot utilize the multithreading and direct processing of the CPU (Centre Processing Unit; hereinafter referred to as: CPU) The advantage of Direct Memory Access (hereinafter referred to as: DMA) to move data in parallel leads to lower performance of data write processing.

发明内容Contents of the invention

本发明实施例在于提供一种数据写处理方法、装置和终端设备,采用数据并行写入机制,优化数据写处理的性能,提高终端设备的写入速率。Embodiments of the present invention provide a data writing processing method, device, and terminal equipment, which adopt a data parallel writing mechanism to optimize the performance of data writing processing and increase the writing rate of the terminal equipment.

为了实现上述目的,本发明实施例提供了一种数据写处理方法,包括:In order to achieve the above object, an embodiment of the present invention provides a data writing processing method, including:

从主机接收第一预设数量的第一批写入数据;receiving a first batch of write data of a first preset quantity from the host;

执行第二预设数量的数据写入程序,以将所述第一批写入数据写入存储空间,并从所述主机接收所述第一预设数量的第二批写入数据,其中,所述第二预设数量为所述第一预设数量的两倍;Executing a second preset number of data writing programs to write the first batch of write data into the storage space, and receive the first preset number of second batch of write data from the host, wherein, The second predetermined amount is twice the first predetermined amount;

在接收到所述第二批写入数据后所述第一批写入数据的写入完成时,通过所述数据写入程序将所述第二批写入数据写入所述存储空间。When the writing of the first batch of writing data is completed after receiving the second batch of writing data, write the second batch of writing data into the storage space through the data writing program.

本发明实施例提供了一种数据写处理装置,包括:An embodiment of the present invention provides a data writing processing device, including:

接收模块,用于从主机接收第一预设数量的第一批写入数据;a receiving module, configured to receive a first batch of write data of a first preset quantity from the host;

第一写入模块,用于执行第二预设数量的数据写入程序,以将所述第一批写入数据写入存储空间,并从所述主机接收所述第一预设数量的第二批写入数据,其中,所述第二预设数量为所述第一预设数量的两倍;The first writing module is configured to execute a second preset number of data writing programs, so as to write the first batch of write data into the storage space, and receive the first preset number of second programs from the host. Two batches of writing data, wherein the second preset number is twice the first preset number;

第二写入模块,用于在接收到所述第二批写入数据后所述第一批写入数据的写入完成时,通过所述数据写入程序将所述第二批写入数据写入所述存储空间。The second writing module is configured to write the second batch of write data through the data writing program when the writing of the first batch of write data is completed after receiving the second batch of write data Write to the storage space.

本发明实施例提供了一种终端设备,包括上述数据写处理装置。An embodiment of the present invention provides a terminal device, including the above data writing processing apparatus.

本发明实施例提供的一种数据写处理方法、装置和终端设备,先从主机接收第一预设数量的第一批写入数据,再执行第二预设数量的数据写入程序以将第一批写入数据写入存储空间,此时从主机接收第一预设数量的第二批写入数据,当接收到第二批写入数据后第一批写入数据的写入已完成时,再将第二批写入数据写入到存储空间;本实施例采用数据并行写入机制将后半部分写入数据的接收任务与整个写入数据的写入任务并行执行,可以有效利用CPU的多线程及DMA并行搬运数据的优势,优化了数据写处理的性能,提高了终端设备的写入速率。A data writing processing method, device, and terminal device provided by an embodiment of the present invention firstly receive a first preset amount of first batch of write data from a host, and then execute a second preset amount of data writing program to write the second batch of data A batch of write data is written into the storage space. At this time, the first preset amount of second batch of write data is received from the host. When the first batch of write data is completed after receiving the second batch of write data , and then write the second batch of written data into the storage space; this embodiment uses a data parallel writing mechanism to execute the receiving task of the second half of the written data in parallel with the writing task of the entire written data, which can effectively utilize the CPU The advantages of multi-threading and DMA parallel data transfer optimize the performance of data write processing and improve the write rate of terminal devices.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description These are some embodiments of the present invention. For those skilled in the art, other drawings can also be obtained according to these drawings without any creative effort.

图1为现有技术中数据写入方法的执行过程和时间轴示意图;FIG. 1 is a schematic diagram of an execution process and a time axis of a data writing method in the prior art;

图2为本发明数据写处理方法实施例一的流程图;FIG. 2 is a flow chart of Embodiment 1 of the data writing processing method of the present invention;

图3为本发明数据写处理方法实施例二的流程图;3 is a flow chart of Embodiment 2 of the data writing processing method of the present invention;

图4为本发明数据写处理方法实施例二中的执行过程和时间轴示意图一;FIG. 4 is a schematic diagram of the execution process and time axis in Embodiment 2 of the data writing processing method of the present invention;

图5为本发明数据写处理方法实施例二中的执行过程和时间轴示意图二;FIG. 5 is a second schematic diagram of the execution process and time axis in Embodiment 2 of the data writing processing method of the present invention;

图6为本发明数据写处理装置实施例一的结构图;6 is a structural diagram of Embodiment 1 of the data writing processing device of the present invention;

图7为本发明数据写处理装置实施例二的结构图。FIG. 7 is a structural diagram of Embodiment 2 of the data writing processing device of the present invention.

具体实施方式Detailed ways

为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments It is a part of embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.

图2为本发明数据写处理方法实施例一的流程图,如图2所示,本实施例提供了一种数据写处理方法,可以包括如下步骤:FIG. 2 is a flow chart of Embodiment 1 of the data writing processing method of the present invention. As shown in FIG. 2 , this embodiment provides a data writing processing method, which may include the following steps:

步骤201,从主机接收第一预设数量的第一批写入数据;Step 201, receiving a first batch of write data of a first preset quantity from the host;

步骤202,执行第二预设数量的数据写入程序,以将所述第一批写入数据写入存储空间,并从所述主机接收所述第一预设数量的第二批写入数据,其中,所述第二预设数量为第一预设数量的两倍;Step 202, execute a second preset number of data writing programs to write the first batch of write data into the storage space, and receive the first preset number of second batch of write data from the host , wherein the second preset number is twice the first preset number;

步骤203,在接收到所述第二批写入数据后所述第一批写入数据的写入完成时,通过所述数据写入程序将所述第二批写入数据写入存储空间。Step 203, when the writing of the first batch of writing data is completed after receiving the second batch of writing data, write the second batch of writing data into the storage space through the data writing program.

进一步的,作为优选的实施例,步骤203进一步包括:Further, as a preferred embodiment, step 203 further includes:

步骤2031:在接收到所述第二批写入数据后,判断所述第一批写入数据的写入是否完成,如果是,则执行步骤2033,否则执行步骤2032;Step 2031: After receiving the second batch of written data, judge whether the writing of the first batch of written data is completed, if yes, execute step 2033, otherwise execute step 2032;

步骤2032:如果所述第一批写入数据仍在写入,则在所述第一批写入数据的写入完成后,通过所述数据写入程序将所述第二批写入数据写入存储空间;Step 2032: If the first batch of written data is still being written, after the writing of the first batch of written data is completed, write the second batch of written data through the data writing program into the storage space;

步骤2033,如果所述第一批写入数据已经写入完成,则重启第二预设数量的数据写入程序,以将所述第二批写入数据写入存储空间。Step 2033, if the first batch of written data has been written, restart a second preset number of data writing procedures to write the second batch of written data into the storage space.

在某些情况下,数据写入的时候或会频繁出现收到接收到第二批数据的时候,第一批写入数据已经完成写入。如果这种情况频繁出现,会因为数据写入程序的不完全执行,造成写性能下降。因此,也可以在执行步骤201前先一步判断是否当前主机的写超前概率是否达到了预设的概率阈值,如果达到了概率阈值,则仍采用与第一批写入数据和第二批写入数据的大小相对应的数据写入程序来分别执行第一批写入数据和第二批写入数据的写入操作。这里的写抄写概率即每接收到100个第二批写入数据中,第一批写入数据已经写入完成的发生次数。在本发明实施例中,这个概率阈值可以为5/100。In some cases, when the data is written, or when the second batch of data is received frequently, the first batch of written data has been written. If this happens frequently, the write performance will be degraded due to incomplete execution of the data writing program. Therefore, before executing step 201, it is also possible to judge whether the write lead probability of the current host has reached the preset probability threshold, and if the probability threshold has been reached, the same method as the first batch of written data and the second batch of written data will still be used. The data writing program corresponding to the size of the data performs the writing operation of the first batch of written data and the second batch of written data respectively. The writing and transcription probability here is the number of occurrences that the first batch of written data has been written for every 100 second batch of written data received. In the embodiment of the present invention, this probability threshold may be 5/100.

本实施例中的第二预设数量由终端设备的数据处理能力来决定,第一预设数量为第二预设数量的一半,本实施例具体应用在PC向终端数据卡写入数据的场景中,其中,主机可以具体为PC,在Windows系统下,由于PC每次发送给设备侧的数据包的长度为64K比特(Byte),因此,此处将本实施例中的第二预设数量具体设置为64K Byte,第一预设数量具体设置为32K Byte。本实施例在执行数据写处理的方案前,可以先对各种PC的写超前概率进行实验统计,此处的写超前概率为在SD卡中写入第一预设数量的第一批写入数据前未接收到第一预设数量的第二批写入数据的概率,即在SD卡中写入32K Byte的第一批写入数据前未接收到PC发送的32K Byte的第二批写入数据的概率,预设的概率阈值可以为5/100,其表示每写入100个数据包只有5个数据包在收到32K Byte的写入数据时在SD卡中写入的数据已超过32K Byte,即这5个数据包在SD卡中写入32K Byte的第一批写入数据前未接收到32K Byte的第二批写入数据。通过实测发现在大部分PC上的写超前概率均极低,即低于预设的概率阈值。在本实施例中,当主机的写超前概率小于预设的概率阈值时,先接收来自主机的第一预设数量的写入数据,即先从PC上接收其发送的32K Byte的写入数据。The second preset number in this embodiment is determined by the data processing capability of the terminal device, and the first preset number is half of the second preset number. This embodiment is specifically applied to the scenario where the PC writes data to the terminal data card Among them, the host computer may specifically be a PC. Under the Windows system, since the length of the data packet sent by the PC to the device side each time is 64K bits (Byte), the second preset number in this embodiment is here The specific setting is 64K Byte, and the first preset quantity is specifically set to 32K Byte. In this embodiment, before implementing the data write processing scheme, experimental statistics can be performed on the write lead probabilities of various PCs. The write lead probability here is the first batch of writes of the first preset number written in the SD card. The probability that the second batch of written data of the first preset quantity is not received before the data, that is, the second batch of written data of 32K Byte sent by the PC is not received before the first batch of written data of 32K Byte is written in the SD card. The probability of entering data, the preset probability threshold can be 5/100, which means that for every 100 data packets written, only 5 data packets have written more than 32K Bytes of data in the SD card. 32K Byte, that is, the 5 data packets did not receive the second batch of 32K Byte write data before writing the first batch of 32K Byte write data in the SD card. Through actual measurement, it is found that the write-ahead probability on most PCs is extremely low, that is, lower than the preset probability threshold. In this embodiment, when the write lead probability of the host is less than the preset probability threshold, first receive the first preset amount of write data from the host, that is, first receive the 32K Byte write data sent from the PC .

在本实施例中,当从主机接收到第一预设数量的第一批写入数据后,开始执行第二预设数量的数据写入程序,向SD卡中直接写入第二预设数量的第一批写入数据,并同时继续从主机接收第一预设数量的第二批写入数据。In this embodiment, after receiving the first batch of write data of the first preset quantity from the host computer, the data writing procedure of the second preset quantity is started, and the second preset quantity is directly written into the SD card. The first batch of write data, and at the same time continue to receive the first preset number of second batch of write data from the host.

即在接收到32K Byte的第一批写入数据时,便直接向SD卡中写入64K Byte的第一批写入数据,同时继续从主机接收32K Byte的第二批写入数据。本实施例将主机发送的64K Byte的写入数据分成两部分,在接收到一半数据时,启动数据的写入操作,将后一半数据的接收任务与数据的写入任务并行执行,可以有效利用CPU的多线程及DMA并行搬运数据的优势,且在执行数据的写入任务时直接写入64K Byte,与分两次写入相比减少了写入时间。That is, when the first batch of 32K Byte write data is received, it will directly write the first batch of 64K Byte write data to the SD card, and at the same time continue to receive the second batch of 32K Byte write data from the host. In this embodiment, the write data of 64K Byte sent by the host is divided into two parts. When half of the data is received, the write operation of the data is started, and the receiving task of the second half of the data is executed in parallel with the writing task of the data, which can effectively utilize The advantages of CPU multi-threading and DMA parallel data transfer, and directly write 64K Byte when executing the data writing task, which reduces the writing time compared with writing twice.

本实施例提供了一种数据写处理方法,先从主机接收第一预设数量的第一批写入数据,再执行第二预设数量的数据写入程序以将第一批写入数据写入存储空间,此时从主机接收第一预设数量的第二批写入数据,当接收到第二批写入数据后第一批写入数据的写入已完成时,再将第二批写入数据写入到存储空间;本实施例采用数据并行写入机制将后半部分写入数据的接收任务与整个写入数据的写入任务并行执行,可以有效利用CPU的多线程及DMA并行搬运数据的优势,优化了数据写处理的性能,提高了终端设备的写入速率。This embodiment provides a data writing processing method. First, a first batch of write-in data of a first preset quantity is received from a host computer, and then a second preset quantity of data writing procedures are executed to write the first batch of write-in data. At this time, the second batch of write data of the first preset quantity is received from the host, and when the writing of the first batch of write data is completed after receiving the second batch of write data, the second batch of The written data is written into the storage space; this embodiment uses a data parallel writing mechanism to execute the receiving task of the second half of the written data in parallel with the writing task of the entire written data, which can effectively utilize the multi-threading and DMA parallelism of the CPU The advantage of moving data optimizes the performance of data writing processing and improves the writing rate of terminal devices.

图3为本发明数据写处理方法实施例二的流程图,如图3所示,本实施例提供了一种数据写处理方法,本实施例中的第一预设数量具体为32K Byte,第二预设数量具体为64K Byte,本实施例提供的方法可以具体包括如下步骤:Fig. 3 is the flow chart of embodiment two of the data writing processing method of the present invention, as shown in Fig. 3, this embodiment provides a kind of data writing processing method, the first preset quantity in this embodiment is specifically 32K Byte, the second The second preset quantity is specifically 64K Byte, and the method provided in this embodiment can specifically include the following steps:

步骤301,判断主机上的写超前概率是否小于预设的概率阈值,如果是,则执行步骤302,否则执行步骤307。Step 301 , judging whether the write-ahead probability on the host is less than a preset probability threshold, if yes, go to step 302 , otherwise go to step 307 .

本步骤为根据主机的类型获取主机上的写超前概率,判断其写超前概率是否小于预设的概率阈值,此处的概率阈值可以设定为5/100,如果是,则执行后续步骤302-306,否则执行步骤307-309。本实施例在执行数据写处理的方案前,可以先对各种PC的写超前概率进行实验统计,此处的写超前概率为在SD卡中写入第一预设数量的第一批写入数据前未接收到第一预设数量的第二批写入数据的概率,即在SD卡中写入32K Byte的第一批写入数据前未接收到PC发送的32K Byte的第二批写入数据的概率,预设的概率阈值可以为5/100,其表示每写入100个数据包只有5个数据包在收到32K Byte的写入数据时在SD卡中写入的数据已超过32K Byte,即这5个数据包在SD卡中写入32K Byte的第一批写入数据前未接收到32K Byte的第二批写入数据。通过实测发现在大部分PC上的写超前概率均极低,即低于预设的概率阈值。在本实施例中,当主机的写超前概率小于预设的概率阈值时,先接收来自主机的第一预设数量的写入数据,即先从PC上接收其发送的32K Byte的写入数据。This step is to obtain the write lead probability on the host according to the type of the host, and judge whether the write lead probability is less than the preset probability threshold, where the probability threshold can be set to 5/100, and if so, perform the subsequent step 302- 306, otherwise execute steps 307-309. In this embodiment, before implementing the data write processing scheme, experimental statistics can be performed on the write lead probabilities of various PCs. The write lead probability here is the first batch of writes of the first preset number written in the SD card. The probability that the second batch of written data of the first preset quantity is not received before the data, that is, the second batch of written data of 32K Byte sent by the PC is not received before the first batch of written data of 32K Byte is written in the SD card. The probability of entering data, the preset probability threshold can be 5/100, which means that for every 100 data packets written, only 5 data packets have written more than 32K Bytes of data in the SD card. 32K Byte, that is, the 5 data packets did not receive the second batch of 32K Byte write data before writing the first batch of 32K Byte write data in the SD card. Through actual measurement, it is found that the write-ahead probability on most PCs is extremely low, that is, lower than the preset probability threshold. In this embodiment, when the write lead probability of the host is less than the preset probability threshold, first receive the first preset amount of write data from the host, that is, first receive the 32K Byte write data sent from the PC .

步骤302,从主机接收32K Byte的第一批写入数据。Step 302, receiving the first batch of write data of 32K Byte from the host.

当主机上的写超前概率小于概率阈值时,接收来自主机的32K Byte的第一批写入数据,图4为本发明数据写处理方法实施例二中的执行过程和时间轴示意图一,如图4所示,若写超前概率满足概率阈值,则执行时间段A所示的接收数据的过程。When the write lead probability on the host is less than the probability threshold, the first batch of write data of 32K Byte from the host is received. FIG. 4 is a schematic diagram of the execution process and time axis in Embodiment 2 of the data writing processing method of the present invention, as shown in FIG. As shown in 4, if the write lead probability satisfies the probability threshold, the process of receiving data shown in time period A is executed.

步骤303,执行64K Byte的数据写入程序,以将第一批写入数据写入SD卡,并从主机接收32K Byte的第二批写入数据。Step 303, execute the 64K Byte data writing program to write the first batch of write data into the SD card, and receive the second batch of 32K Byte write data from the host.

在接收到主机发送的32K Byte的第一批写入数据,即执行完图4中时间段A所示的任务后,并行执行时间段B和C所示的任务,即执行64K Byte的数据写入程序,以向SD卡中写入32K Byte的第一批写入数据,并同时继续从主机接收32K Byte的第二批写入数据。After receiving the first batch of 32K Byte write data sent by the host, that is, after executing the task shown in time period A in Figure 4, execute the tasks shown in time period B and C in parallel, that is, execute 64K Byte data writing Enter the program to write the first batch of 32K Byte write data to the SD card, and at the same time continue to receive the second batch of 32K Byte write data from the host.

步骤304,在接收到32K Byte的第二批写入数据后,判断在SD卡中是否已写入32K Byte的第一批写入数据,如果是,则执行步骤305,否则步骤306,继续执行步骤303中数据的写入过程。Step 304, after receiving the second batch of write data of 32K Byte, judge whether the first batch of write data of 32K Byte has been written in SD card, if yes, then execute step 305, otherwise step 306, continue to execute Data writing process in step 303.

在接收到32K Byte的第二批写入数据后,检测在SD卡中是否已写入32K Byte的第一批写入数据,即执行完图4中时间段B所示的任务后,判断时间段C所示的写入过程中是否已完成32K Byte的第一批数据的写入,如果是,则执行步骤305,否则执行步骤306。After receiving the second batch of 32K Byte write data, check whether the first batch of 32K Byte write data has been written in the SD card, that is, after executing the task shown in time period B in Figure 4, judge the time Whether the writing of the first batch of data of 32K Byte has been completed in the writing process shown in section C, if yes, then execute step 305, otherwise execute step 306.

步骤305,重启64K Byte的数据写入程序,以重新向SD卡中写入64K Byte的写入数据。Step 305, restart the 64K Byte data writing program to rewrite the 64K Byte write data to the SD card.

若在接收到时间段B所示的32K Byte的第二批写入数据时,SD卡中已写完32K Byte的第一批写入数据的写入操作,则表明写入数据的速度超过了接收数据的速度,此时可能出现写入的数据为空的情况,为了避免产生这种数据错误的问题,本实施例在出现这种特殊情况时,重启64K Byte的数据写入程序的执行过程,重新向SD卡中写入64K Byte的写入数据,以保证写入数据的正确性。If the write operation of the first batch of 32K Byte data has been written in the SD card when receiving the second batch of 32K Byte data written in time period B, it indicates that the speed of writing data exceeds The speed of receiving data. At this time, the data written may be empty. In order to avoid the problem of data errors, this embodiment restarts the execution process of the 64K Byte data writing program when this special situation occurs. , Re-write 64K Byte write data to the SD card to ensure the correctness of the write data.

步骤306,继续执行步骤303中的64K Byte的数据写入程序,在第一批写入数据的写入完成后,向SD卡中写入第二批写入数据。Step 306, continue to execute the 64K Byte data writing program in step 303, after the writing of the first batch of writing data is completed, write the second batch of writing data in the SD card.

若在接收到时间段B所示的32K Byte的第二批写入数据后,SD卡中尚未完成32K Byte的第一批写入数据的写入过程,则不会出现异常数据错误情况,此时继续执行步骤303中向SD卡中写入数据的操作,无需中断该写入过程,即连续执行时间段C所示的任务。If after receiving the second batch of 32K Byte write data shown in time period B, the writing process of the first batch of 32K Byte write data has not been completed in the SD card, then there will be no abnormal data error. Continue to execute the operation of writing data to the SD card in step 303, without interrupting the writing process, that is, continuously execute the tasks shown in time period C.

继续参照上述图4,在完成时间段C所示的数据写入任务后,后续还包括时间段D和E,其中,时间段D表示回CSW时间,即在数据写入SD卡后通过CSW将传输结果反馈到PC,时间段E表示从CSW到PC下发下一个数据包的时间。Continuing to refer to the above-mentioned Figure 4, after the data writing task shown in time period C is completed, time periods D and E are also included in the follow-up, where time period D represents the return to CSW time, that is, after the data is written to the SD card, the data will be written to the SD card through CSW. The transmission result is fed back to the PC, and the time period E represents the time from the CSW to the next data packet delivered by the PC.

步骤307,从主机接收32K Byte的第一批写入数据。Step 307, receiving the first batch of write data of 32K Byte from the host.

当主机上的写超前概率大于或等于概率阈值时,表明该主机出现写入速率大于接收速率的概率较大,若仍采用图4中时间段B和C并行执行的方法,则重写数据的几率较大,反而会造成写性能下降。因此,本实施例针对这种情况,则采用另外的一种策略来完成数据写入,即从主机接收32K Byte的第一批写入数据,图5为本发明数据写处理方法实施例二中的执行过程和时间轴示意图二,如图5所示,若写超前概率不满足概率阈值,则执行图5中时间段A所示的接收数据的过程。When the write-ahead probability on the host is greater than or equal to the probability threshold, it indicates that the host has a high probability that the writing rate is greater than the receiving rate. The probability is higher, but it will cause the write performance to decline. Therefore, for this situation, this embodiment adopts another strategy to complete the data writing, that is, receiving the first batch of 32K Byte written data from the host, and FIG. 5 shows the second embodiment of the data writing processing method of the present invention Schematic diagram 2 of the execution process and time axis of , as shown in FIG. 5 , if the write lead probability does not meet the probability threshold, the process of receiving data shown in time period A in FIG. 5 is executed.

步骤308,执行第一批写入数据对应的数据写入程序,以将第一批写入数据写入SD卡中,并从主机接收32K Byte的第二批写入数据。Step 308, execute the data writing program corresponding to the first batch of written data, so as to write the first batch of written data into the SD card, and receive the second batch of 32K Byte written data from the host.

在接收到主机发送的32K Byte的第一批写入数据,即执行完图5中时间段A所示的任务后,并行执行图5中时间段B和C所示的任务,即执行第一批写入数据对应的数据写入程序,向SD卡中先写入32K Byte的第一批写入数据,并同时继续从主机接收32K Byte的第二批写入数据。After receiving the first batch of write data of 32K Byte sent by the host, that is, after executing the task shown in time period A in Figure 5, execute the tasks shown in time period B and C in Figure 5 in parallel, that is, execute the first The data writing program corresponding to the batch write data first writes the first batch of 32K Byte write data to the SD card, and at the same time continues to receive the second batch of 32K Byte write data from the host.

步骤309,执行第二批写入数据对应的数据写入程序,以将第二批写入数据写入SD卡中。Step 309, execute the data writing program corresponding to the second batch of writing data, so as to write the second batch of writing data into the SD card.

在SD卡中写入32K Byte的第一批写入数据后,执行第二批写入数据对应的数据写入程序,开始向SD卡中写入32K Byte的第二批写入数据,即在执行完成图5中时间段C所示的任务后,再执行时间段D所示的任务,将向SD卡中写入数据的过程分为两个阶段分别执行。After writing the first batch of 32K Byte write data in the SD card, execute the data writing program corresponding to the second batch of write data, and start writing the second batch of 32K Byte write data to the SD card, that is, in After the task shown in time period C in Figure 5 is completed, the task shown in time period D is executed again, and the process of writing data to the SD card is divided into two stages and executed separately.

继续参照上述图5,在完成时间段C和D所示的数据写入任务后,后续还包括时间段E和F,其中,时间段E表示回CSW时间,即在数据写入SD卡后通过CSW将传输结果反馈到PC,时间段F表示从CSW到PC下发下一个数据包的时间。Continuing to refer to the above-mentioned Figure 5, after completing the data writing tasks shown in time periods C and D, time periods E and F are also included in the follow-up, where time period E represents the return to CSW time, that is, after the data is written to the SD card, pass The CSW feeds back the transmission result to the PC, and the time period F represents the time when the next data packet is delivered from the CSW to the PC.

本实施例提供了一种数据写处理方法,先从主机接收第一预设数量的第一批写入数据,再执行第二预设数量的数据写入程序以将第一批写入数据写入存储空间,此时从主机接收第一预设数量的第二批写入数据,当接收到第二批写入数据后第一批写入数据的写入已完成时,再将第二批写入数据写入到存储空间;本实施例采用数据并行写入机制将后半部分写入数据的接收任务与整个写入数据的写入任务并行执行,可以有效利用CPU的多线程及DMA并行搬运数据的优势,优化了数据写处理的性能,提高了终端设备的写入速率。This embodiment provides a data writing processing method. First, a first batch of write-in data of a first preset quantity is received from a host computer, and then a second preset quantity of data writing procedures are executed to write the first batch of write-in data. At this time, the second batch of write data of the first preset quantity is received from the host, and when the writing of the first batch of write data is completed after receiving the second batch of write data, the second batch of The written data is written into the storage space; this embodiment uses a data parallel writing mechanism to execute the receiving task of the second half of the written data in parallel with the writing task of the entire written data, which can effectively utilize the multi-threading and DMA parallelism of the CPU The advantage of moving data optimizes the performance of data writing processing and improves the writing rate of terminal devices.

本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。Those of ordinary skill in the art can understand that all or part of the steps for realizing the above-mentioned method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the It includes the steps of the above method embodiments; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other various media that can store program codes.

图6为本发明数据写处理装置实施例一的结构图,如图6所示,本实施例提供了一种数据写入处理装置,可以具体执行上述方法实施例一中的各个步骤,此处不再赘述。本实施例提供的数据写处理装置可以具体包括接收模块601、第一写入模块602和第二写入模块603。其中,接收模块601用于从主机接收第一预设数量的第一批写入数据。第一写入模块602用于执行第二预设数量的数据写入程序,以将所述第一批写入数据写入存储空间,并从所述主机接收所述第一预设数量的第二批写入数据,其中,所述第二预设数量为所述第一预设数量的两倍。第二写入模块603用于在接收到所述第二批写入数据后所述第一批写入数据的写入完成时,通过所述数据写入程序将所述第二批写入数据写入所述存储空间。FIG. 6 is a structural diagram of Embodiment 1 of the data writing processing device of the present invention. As shown in FIG. 6 , this embodiment provides a data writing processing device that can specifically perform the steps in Embodiment 1 of the above-mentioned method. Here No longer. The data writing processing apparatus provided in this embodiment may specifically include a receiving module 601 , a first writing module 602 and a second writing module 603 . Wherein, the receiving module 601 is configured to receive a first preset quantity of first batch of write data from the host. The first writing module 602 is configured to execute a second preset number of data writing programs, so as to write the first batch of write data into the storage space, and receive the first preset number of second data from the host. Writing data in two batches, wherein the second preset number is twice the first preset number. The second write module 603 is configured to write the second batch of write data through the data writing program when the writing of the first batch of write data is completed after receiving the second batch of write data Write to the storage space.

图7为本发明数据写处理装置实施例二的结构图,如图7所示,本实施例提供了一种数据写入处理装置,可以具体执行上述方法实施例二中的各个步骤,此处不再赘述。本实施例提供的数据写处理装置在上述图6所示的基础之上,第二写入模块603可以具体包括判断单元613、第一写入单元623和第二写入单元633。其中,判断单元613用于在接收到所述第二批写入数据时,判断所述第一批写入数据的写入是否完成。第一写入单元623用于若所述第一批写入数据仍在写入,则在所述第一批写入数据的写入完成后,通过所述数据写入程序将所述第二批写入数据写入所述存储空间。第二写入单元633用于若所述第一批写入数据已经写入完成,则重启所述第二预设数量的数据写入程序,以将所述第二批写入数据写入所述存储空间。FIG. 7 is a structural diagram of Embodiment 2 of the data writing processing device of the present invention. As shown in FIG. 7 , this embodiment provides a data writing processing device that can specifically perform the steps in Embodiment 2 of the above-mentioned method. Here No longer. The data writing processing device provided in this embodiment is based on the above shown in FIG. 6 , and the second writing module 603 may specifically include a judging unit 613 , a first writing unit 623 and a second writing unit 633 . Wherein, the judging unit 613 is configured to judge whether the writing of the first batch of writing data is completed when receiving the second batch of writing data. The first writing unit 623 is configured to, if the first batch of write data is still being written, after the writing of the first batch of write data is completed, write the second batch of write data through the data writing program. The batch write data is written into the storage space. The second writing unit 633 is configured to restart the second preset number of data writing procedures if the first batch of write data has been written, so as to write the second batch of write data into all storage space.

进一步地,本实施例提供的数据写处理装置还可以包括判断模块701和写处理模块702。其中,判断模块701用于判断主机上的写超前概率是否小于预设的概率阈值。写处理模块702用于当判断模块701的判断结果为所述写超前概率大于或等于预设的概率阈值时,从主机接收第一预设数量的第一批写入数据;执行所述第一批写入数据对应的数据写入程序,以将所述第一批写入数据写入存储空间,并从所述主机接收所述第一预设数量的第二批写入数据;执行所述第二批写入数据对应的数据写入程序,以将所述第二批写入数据写入所述存储空间。接收模块601具体用于当判断模块701的判断结果为所述写超前概率小于预设的概率阈值时,执行所述从主机接收第一预设数量的第一批写入数据的步骤。其中,所述写超前概率为在所述存储空间中写入所述第一预设数量的第一批写入数据前未接收到所述第一预设数量的第二批写入数据的概率。Further, the data writing processing apparatus provided in this embodiment may further include a judging module 701 and a writing processing module 702 . Wherein, the judging module 701 is used for judging whether the write lead probability on the host is smaller than a preset probability threshold. The write processing module 702 is configured to receive a first batch of write data of a first preset quantity from the host when the judging result of the judging module 701 is that the write lead probability is greater than or equal to a preset probability threshold; and execute the first A data writing program corresponding to a batch of write data, so as to write the first batch of write data into the storage space, and receive the first preset quantity of second batch of write data from the host; execute the A data writing program corresponding to the second batch of write data, for writing the second batch of write data into the storage space. The receiving module 601 is specifically configured to execute the step of receiving a first preset quantity of the first batch of write data from the host when the judging result of the judging module 701 is that the write lead probability is less than a preset probability threshold. Wherein, the write lead probability is the probability that the first preset quantity of the second batch of write data is not received before the first preset quantity of write data is written in the storage space .

具体地,本实施例中的第一预设数量可以具体为32K比特,第二预设数量可以具体为64K比特。Specifically, the first preset number in this embodiment may be specifically 32K bits, and the second preset number may be specifically 64K bits.

本实施例提供了一种数据写处理装置,先从主机接收第一预设数量的第一批写入数据,再执行第二预设数量的数据写入程序以将第一批写入数据写入存储空间,此时从主机接收第一预设数量的第二批写入数据,当接收到第二批写入数据后第一批写入数据的写入已完成时,再将第二批写入数据写入到存储空间;本实施例采用数据并行写入机制将后半部分写入数据的接收任务与整个写入数据的写入任务并行执行,可以有效利用CPU的多线程及DMA并行搬运数据的优势,优化了数据写处理的性能,提高了终端设备的写入速率。This embodiment provides a data writing processing device, which first receives a first batch of write-in data of a first preset quantity from a host computer, and then executes a second preset quantity of data writing procedures to write the first batch of write-in data At this time, the second batch of write data of the first preset quantity is received from the host, and when the writing of the first batch of write data is completed after receiving the second batch of write data, the second batch of The written data is written into the storage space; this embodiment uses a data parallel writing mechanism to execute the receiving task of the second half of the written data in parallel with the writing task of the entire written data, which can effectively utilize the multi-threading and DMA parallelism of the CPU The advantage of moving data optimizes the performance of data writing processing and improves the writing rate of terminal devices.

最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明实施例技术方案的精神和范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it can still be Modifications are made to the technical solutions described in the foregoing embodiments, or equivalent replacements are made to some of the technical features; these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (9)

1.一种数据写处理方法,其特征在于,包括:1. A data writing processing method, characterized in that, comprising: 从主机接收第一预设数量的第一批写入数据;receiving a first batch of write data of a first preset quantity from the host; 执行第二预设数量的数据写入程序,以将所述第一批写入数据写入存储空间,并从所述主机接收所述第一预设数量的第二批写入数据,其中,所述第二预设数量为所述第一预设数量的两倍;Executing a second preset number of data writing programs to write the first batch of write data into the storage space, and receive the first preset number of second batch of write data from the host, wherein, The second predetermined amount is twice the first predetermined amount; 在接收到所述第二批写入数据后所述第一批写入数据的写入完成时,通过所述数据写入程序将所述第二批写入数据写入所述存储空间。When the writing of the first batch of writing data is completed after receiving the second batch of writing data, write the second batch of writing data into the storage space through the data writing program. 2.根据权利要求1所述的方法,其特征在于,所述在接收到所述第二批写入数据后所述第一批写入数据的写入完成时,通过所述数据写入程序将所述第二批写入数据写入所述存储空间包括:2. The method according to claim 1, characterized in that, when the writing of the first batch of writing data is completed after receiving the second batch of writing data, the data writing program Writing the second batch of write data into the storage space includes: 在接收到所述第二批写入数据时,判断所述第一批写入数据的写入是否完成;When receiving the second batch of write data, judging whether the writing of the first batch of write data is completed; 若所述第一批写入数据仍在写入,则在所述第一批写入数据的写入完成后,通过所述数据写入程序将所述第二批写入数据写入所述存储空间;If the first batch of write data is still being written, after the writing of the first batch of write data is completed, write the second batch of write data into the storage; 若所述第一批写入数据已经写入完成,则重启所述第二预设数量的数据写入程序,以将所述第二批写入数据写入所述存储空间。If the first batch of writing data has been written, restarting the second preset number of data writing procedures to write the second batch of writing data into the storage space. 3.根据权利要求1所述的方法,其特征在于,还包括:3. The method according to claim 1, further comprising: 判断主机上的写超前概率是否小于预设的概率阈值;Determine whether the write lead probability on the host is less than a preset probability threshold; 当所述写超前概率小于预设的概率阈值时,执行所述从主机接收第一预设数量的第一批写入数据的步骤;When the write lead probability is less than a preset probability threshold, performing the step of receiving a first preset number of first batches of write data from the host; 当所述写超前概率大于或等于预设的概率阈值时,从主机接收第一预设数量的第一批写入数据;执行所述第一批写入数据对应的数据写入程序,以将所述第一批写入数据写入存储空间,并从所述主机接收所述第一预设数量的第二批写入数据;执行所述第二批写入数据对应的数据写入程序,以将所述第二批写入数据写入所述存储空间;When the write lead probability is greater than or equal to a preset probability threshold, a first preset amount of first batch of write data is received from the host; and a data writing program corresponding to the first batch of write data is executed to write writing the first batch of write data into the storage space, and receiving the first preset amount of the second batch of write data from the host; executing a data writing program corresponding to the second batch of write data, to write the second batch of write data into the storage space; 其中,所述写超前概率为在所述存储空间中写入所述第一预设数量的第一批写入数据前未接收到所述第一预设数量的第二批写入数据的概率。Wherein, the write lead probability is the probability that the first preset quantity of the second batch of write data is not received before the first preset quantity of write data is written in the storage space . 4.根据权利要求1-3中任一项所述的方法,其特征在于,所述第一预设数量为32K比特,所述第二预设数量为64K比特。4. The method according to any one of claims 1-3, wherein the first preset number is 32K bits, and the second preset number is 64K bits. 5.一种数据写处理装置,其特征在于,包括:5. A data writing processing device, characterized in that, comprising: 接收模块,用于从主机接收第一预设数量的第一批写入数据;a receiving module, configured to receive a first batch of write data of a first preset quantity from the host; 第一写入模块,用于执行第二预设数量的数据写入程序,以将所述第一批写入数据写入存储空间,并从所述主机接收所述第一预设数量的第二批写入数据,其中,所述第二预设数量为所述第一预设数量的两倍;The first writing module is configured to execute a second preset number of data writing programs, so as to write the first batch of write data into the storage space, and receive the first preset number of second programs from the host. Two batches of writing data, wherein the second preset number is twice the first preset number; 第二写入模块,用于在接收到所述第二批写入数据后所述第一批写入数据的写入完成时,通过所述数据写入程序将所述第二批写入数据写入所述存储空间。The second writing module is configured to write the second batch of write data through the data writing program when the writing of the first batch of write data is completed after receiving the second batch of write data Write to the storage space. 6.根据权利要求5所述的装置,其特征在于,所述第二写入模块包括:6. The device according to claim 5, wherein the second writing module comprises: 判断单元,用于在接收到所述第二批写入数据时,判断所述第一批写入数据的写入是否完成;a judging unit, configured to judge whether writing of the first batch of written data is completed when receiving the second batch of written data; 第一写入单元,用于若所述第一批写入数据仍在写入,则在所述第一批写入数据的写入完成后,通过所述数据写入程序将所述第二批写入数据写入所述存储空间;The first writing unit is configured to: if the first batch of write data is still being written, after the writing of the first batch of write data is completed, use the data writing program to write the second Writing batches of data into the storage space; 第二写入单元,用于若所述第一批写入数据已经写入完成,则重启所述第二预设数量的数据写入程序,以将所述第二批写入数据写入所述存储空间。The second writing unit is configured to restart the second preset number of data writing procedures if the first batch of writing data has been written, so as to write the second batch of writing data into all storage space. 7.根据权利要求5所述的装置,其特征在于,还包括:7. The device according to claim 5, further comprising: 判断模块,用于判断主机上的写超前概率是否小于预设的概率阈值;A judging module, configured to judge whether the write lead probability on the host is less than a preset probability threshold; 写处理模块,用于当所述判断模块的判断结果为所述写超前概率大于或等于预设的概率阈值时,从主机接收第一预设数量的第一批写入数据;执行所述第一批写入数据对应的数据写入程序,以将所述第一批写入数据写入存储空间,并从所述主机接收所述第一预设数量的第二批写入数据;执行所述第二批写入数据对应的数据写入程序,以将所述第二批写入数据写入所述存储空间;A write processing module, configured to receive a first batch of write data of a first preset quantity from the host when the judgment result of the judging module is that the write lead probability is greater than or equal to a preset probability threshold; and execute the first batch of write data; A data writing program corresponding to a batch of write data, so as to write the first batch of write data into the storage space, and receive the first preset number of second batch of write data from the host; execute the A data writing program corresponding to the second batch of write data, so as to write the second batch of write data into the storage space; 所述接收模块具体用于当所述判断模块的判断结果为所述写超前概率小于预设的概率阈值时,执行所述从主机接收第一预设数量的第一批写入数据的步骤;The receiving module is specifically configured to execute the step of receiving a first preset quantity of the first batch of write data from the host when the judgment result of the judging module is that the write lead probability is less than a preset probability threshold; 其中,所述写超前概率为在所述存储空间中写入所述第一预设数量的第一批写入数据前未接收到所述第一预设数量的第二批写入数据的概率。Wherein, the write lead probability is the probability that the first preset quantity of the second batch of write data is not received before the first preset quantity of write data is written in the storage space . 8.根据权利要求5-7中任一项所述的装置,其特征在于,所述第一预设数量为32K比特,所述第二预设数量为64K比特。8. The device according to any one of claims 5-7, wherein the first preset number is 32K bits, and the second preset number is 64K bits. 9.一种终端设备,其特征在于,包括上述权利要求5-8中任一项所述的数据写处理装置。9. A terminal device, characterized by comprising the data writing processing device according to any one of claims 5-8.
CN201180000682.0A 2011-05-23 2011-05-23 Data writing processing method, device and terminal equipment Expired - Fee Related CN102203753B (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2011/074513 WO2011137811A2 (en) 2011-05-23 2011-05-23 Method, device and terminal equipment for data writing processing

Publications (2)

Publication Number Publication Date
CN102203753A true CN102203753A (en) 2011-09-28
CN102203753B CN102203753B (en) 2014-04-16

Family

ID=44662782

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201180000682.0A Expired - Fee Related CN102203753B (en) 2011-05-23 2011-05-23 Data writing processing method, device and terminal equipment

Country Status (2)

Country Link
CN (1) CN102203753B (en)
WO (1) WO2011137811A2 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1648878A (en) * 2005-01-07 2005-08-03 清华大学 Method for improving compute system disc synchronous writing property based on movable memory
US20060143319A1 (en) * 2004-12-29 2006-06-29 Hung-Yuan Hsu Method of establishing communication between a usb device and a host
CN1869855A (en) * 2005-05-23 2006-11-29 深圳市江波龙电子有限公司 Method for command interaction and two-way data transmission on USB mass storage equipment by program and USB mass storage equipment
CN101430663A (en) * 2007-11-09 2009-05-13 上海奇码数字信息有限公司 Caching management unit and caching management method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060143319A1 (en) * 2004-12-29 2006-06-29 Hung-Yuan Hsu Method of establishing communication between a usb device and a host
CN1648878A (en) * 2005-01-07 2005-08-03 清华大学 Method for improving compute system disc synchronous writing property based on movable memory
CN1869855A (en) * 2005-05-23 2006-11-29 深圳市江波龙电子有限公司 Method for command interaction and two-way data transmission on USB mass storage equipment by program and USB mass storage equipment
CN101430663A (en) * 2007-11-09 2009-05-13 上海奇码数字信息有限公司 Caching management unit and caching management method

Also Published As

Publication number Publication date
CN102203753B (en) 2014-04-16
WO2011137811A2 (en) 2011-11-10
WO2011137811A3 (en) 2012-02-16

Similar Documents

Publication Publication Date Title
CN102866971B (en) Device, the system and method for transmission data
TWI443513B (en) Memory storage device, memory controller thereof, and method for programming data thereof
US20180146038A1 (en) Remote direct memory access with reduced latency
CN109426627B (en) Data storage device and method of operation thereof
CN110389772B (en) Dual-core MCU application program upgrading method
CN116149559B (en) Queue processing method, device, server, electronic equipment and storage medium
CN110018792B (en) Method and device for processing data to be landed, electronic equipment and storage medium
CN106547636A (en) Debugging system and method
US9377966B2 (en) Method and apparatus for efficiently processing storage commands
US20140223073A1 (en) Management of random cache read operations
US20110016233A1 (en) System, method, and computer program product for inserting a gap in information sent from a drive to a host device
CN115129509A (en) Data transmission method, device and medium
US8943255B2 (en) Methods and structure for accounting for connection resets between peripheral component interconnect express bridges and host devices
CN102486757B (en) Memory storage device, its memory controller and method for responding to host commands
CN102203753A (en) Data writing processing method, apparatus and terminal equipment
CN116302007B (en) Disk array firmware upgrade method, device, equipment, medium and disk array card
CN111371799A (en) Control method, device and equipment for MCTP controller to send and receive data
CN105354107A (en) Data transmission method and system for NOR Flash
US20220083267A1 (en) High Bandwidth Controller Memory Buffer For Peer To Peer Data Transfer
CN120045493B (en) A host bus adapter, control method and related equipment
US12475034B2 (en) Response control in memory systems for reducing interrupt overhead
US12530117B2 (en) Memory controllers and electronic apparatuses, operation methods thereof to execute a shutdown preparation operation
CN113094294B (en) SSD abnormal power failure processing method, SSD abnormal power failure processing device, computer equipment and storage medium
CN117407348B (en) PCIe adaptive transfer method, device, storage medium and electronic equipment
CN111475109A (en) A data processing method, device, equipment and medium

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: 20140416

Termination date: 20180523