A method for writing to a file, comprising: determining (S 110) L first file invoking request messages, wherein each of the L first-file invoking request messages is used to request to write to a respective first file, to which a data block is respectively allocated, a size of the first file is less than or equal to a threshold, each first-file invoking request message comprises physical sector information, the physical sector information comprises an address of a physical sector storing the first file, and L is an integer greater than 1; separately adding (S 120), according to the physical sector information, the L first-file invoking request messages to M first-file dispatch queues such that at least two first-file invoking request messages having continuous physical sectors addresses are added to a same first-file dispatch queue, wherein M is a positive integer; processing (S130) in each of the M first-file dispatch queues, K first-file invoking request messages, to obtain an invoking request message of each first-file dispatch queue, wherein the invoking request message of each first-file dispatch queue is obtained based on a combination of at least two first-file invokinq request messaqes included in each first-file dispatch queue when a sum of sizes of said at least two first files that said invokinq request messaqes request to write exactly constitutes one data block, so that the correspondinq first files that the at least two first-file invokinq request messaqes request to write are written to a same physical sector in a same data block; and writing (S140), according to the invoking request message of each first-file dispatch queue, the first files corresponding to the K first-file invoking request messages. determining (S 110) L first file invoking request messages, wherein each of the L first-file invoking request messages is used to request to write to a respective first file, to which a data block is respectively allocated, a size of the first file is less than or equal to a threshold, each first-file invoking request message comprises physical sector information, the physical sector information comprises an address of a physical sector storing the first file, and L is an integer greater than 1; separately adding (S 120), according to the physical sector information, the L first-file invoking request messages to M first-file dispatch queues such that at least two first-file invoking request messages having continuous physical sectors addresses are added to a same first-file dispatch queue, wherein M is a positive integer; processing (S130) in each of the M first-file dispatch queues, K first-file invoking request messages, to obtain an invoking request message of each first-file dispatch queue, wherein the invoking request message of each first-file dispatch queue is obtained based on a combination of at least two first-file invokinq request messaqes included in each first-file dispatch queue when a sum of sizes of said at least two first files that said invokinq request messaqes request to write exactly constitutes one data block, so that the correspondinq first files that the at least two first-file invokinq request messaqes request to write are written to a same physical sector in a same data block; and writing (S140), according to the invoking request message of each first-file dispatch queue, the first files corresponding to the K first-file invoking request messages. <EOS>