A method for preventing file errors caused by abnormal power-off of a vehicle terminal
By pre-allocating storage blocks and indexing files in the FAT file system, the problem of file errors caused by abnormal power outages in the vehicle terminal is solved, ensuring file integrity and storage reliability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING FENGYUN KECHUANG INFORMATION TECH CO LTD
- Filing Date
- 2023-01-17
- Publication Date
- 2026-07-28
AI Technical Summary
When the vehicle terminal experiences an abnormal power outage, the FAT file system may fail to update its file storage blocks, leading to file errors and affecting the integrity of the file system.
By obtaining the target file size of the storage device, a pre-allocation rule is generated, storage blocks are pre-allocated in the FAT file system, the file size of the file to be written is obtained and indexed into the corresponding storage block, and finally the file size is updated to the FAT file system.
It solves the file error problem caused by abnormal power failure in the FAT file system, ensures the integrity of the files to be written, and improves the reliability and efficiency of file storage.
Smart Images

Figure CN116185951B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data recording and storage technology, and in particular to a method for preventing file errors caused by abnormal power outages in vehicle-mounted terminals. Background Technology
[0002] FAT stands for File Allocation Table, a file system used by MS-DOS and also by all non-NT-based Microsoft Windows systems. FAT files typically use the file system to record and manage data. The file system is a file- and directory-based storage mechanism provided for users to permanently store and access data. The FAT file system requires a series of sequential operations to complete file and directory creation. If a power outage occurs during this process, the integrity of the file system cannot be guaranteed. Therefore, in the event of an abnormal power outage, a series of operations are required to ensure the integrity of the file system.
[0003] Traditional FAT file systems search for unused storage blocks in the storage device when writing files. Once a block is found, the file's storage block list is updated, the file content is written to the storage block, and the file size is updated. If the device loses power abnormally, the storage block operation may not be completed, resulting in an incomplete FAT file and causing an error when it is opened again.
[0004] Therefore, how to provide a method to prevent file errors caused by abnormal power loss of the vehicle terminal is a technical problem that needs to be solved. Summary of the Invention
[0005] To address the problems existing in the prior art, the purpose of this invention is to provide a method for preventing file errors caused by abnormal power outages in vehicle terminals. This invention can solve the technical problem of file errors caused by abnormal power outages in the FAT file system and incomplete file storage block updates.
[0006] To achieve the above objectives, the present invention provides a method for preventing file errors caused by abnormal power loss of an in-vehicle terminal, the method comprising:
[0007] Obtain the target file size of the storage device, generate a pre-allocation rule based on the target file size of the storage device, and pre-allocate storage blocks in the FAT file system according to the pre-allocation rule;
[0008] Obtain the file to be written, parse the file to be written, and obtain the file size of the file to be written;
[0009] The file to be written is indexed into the corresponding storage block according to its size;
[0010] When the storage of the file to be written is completed, the file size of the file to be written is updated in the FAT file system.
[0011] In one embodiment, when pre-allocating storage blocks in the FAT file system according to the pre-allocation rules, the process includes:
[0012] Obtain the target file size of the storage device, and generate several storage blocks in the FAT file system according to the target file size of the storage device;
[0013] The capacity of each storage block is determined, and the number of files that each storage block can receive is determined based on the capacity of the storage blocks.
[0014] In one embodiment, when generating several storage blocks in the FAT file system according to a preset file size of the storage device, the process includes:
[0015] A preset target file size matrix is established, and the number of storage blocks generated in the FAT file system is set according to the relationship between the target file size of the storage device and the preset target file size matrix.
[0016] In one embodiment, determining the number of files that each storage block can receive based on the capacity of the storage block includes:
[0017] A preset capacity size matrix is used, and the number of files that each storage block can receive is determined based on the relationship between the capacity size of the storage block and the preset capacity size matrix.
[0018] In one embodiment, the process of acquiring the file to be written and parsing the file to be written to obtain its size includes:
[0019] Determine whether the file to be written is in compressed format.
[0020] If so, obtain the file extensions of all files in the file to be written, and determine whether there is an executable file in the file to be written. If so, obtain the file size of the executable file.
[0021] If not, determine whether the file to be written is an executable file based on the file extension. If it is, obtain the file size of the executable file.
[0022] In one embodiment, before indexing the file to be written into the corresponding storage block according to the file size of the file to be written, the method further includes:
[0023] Obtain the storage path between the storage device and each of the storage blocks, and generate a first-level index file and a second-level index file based on the storage path;
[0024] The file to be written is indexed based on the first-level index file or the second-level index file.
[0025] In one embodiment, indexing the file to be written into the corresponding storage block according to the file size of the file to be written includes:
[0026] Obtain the storage block corresponding to the file to be written, and determine the remaining capacity of the corresponding storage block;
[0027] Based on the remaining capacity and the size of the file to be written, it is determined whether the corresponding storage block can continue to receive the file to be written.
[0028] If the remaining capacity is greater than or equal to the size of the file to be written, it is determined that the file to be written can continue to be received, and the file to be written is indexed into the corresponding storage block according to the first-level index file;
[0029] If the remaining capacity is less than the size of the file to be written, it is determined that the file to be written cannot be received, and the file to be written is indexed into other storage blocks according to the secondary index file.
[0030] In one embodiment, after storing the file to be written is completed, the method further includes:
[0031] Obtain the file format information of the file to be written;
[0032] The file type of the file to be written is monitored based on the file format information of the file to be written;
[0033] The file types mentioned include normal files and abnormal files.
[0034] In one embodiment, monitoring the file type of the file to be written based on the file format information of the file to be written includes:
[0035] Based on the file format information of the file to be written, a preset exception rule base is obtained, and it is determined whether the file format information of the file to be written is within the exception rule base.
[0036] If so, then the file to be written is determined to be an abnormal file;
[0037] If not, then the file to be written is determined to be a normal file.
[0038] In one embodiment, after determining that the file to be written is an abnormal file, the method further includes:
[0039] Obtain the terminal device corresponding to the storage device and send a prompt message to the terminal device, wherein the prompt message is used to indicate to the terminal device that the file to be written is an abnormal file.
[0040] This invention provides a method for preventing file errors caused by abnormal power outages in vehicle terminals, which has the following advantages compared to existing technologies:
[0041] This invention relates to the field of data recording and storage technology, and discloses a method for preventing file errors caused by abnormal power outages in vehicle terminals. The method includes: obtaining the target file size of a storage device; generating pre-allocation rules based on the target file size; pre-allocating storage blocks in a FAT file system according to the pre-allocation rules; obtaining a file to be written; parsing the file to be written to obtain its file size; indexing the file to be written into the corresponding storage block according to its file size; and updating the file size of the file to be written in the FAT file system when storage is complete. This invention, by pre-allocating storage blocks, solves the technical problem of file errors caused by incomplete file storage block updates during abnormal power outages in the FAT file system. Furthermore, this invention ensures the integrity of the file to be written. Attached Figure Description
[0042] Figure 1 A flowchart illustrating a method for preventing file errors caused by abnormal power loss of an in-vehicle terminal is shown in an embodiment of the present invention.
[0043] Figure 2 This illustration shows a flowchart of the process of pre-allocating storage blocks in the FAT file system according to the pre-allocation rules in an embodiment of the present invention.
[0044] Figure 3 This illustration shows a flowchart of an embodiment of the present invention, which shows how to index a file to be written to a corresponding storage block based on the file size of the file to be written. Detailed Implementation
[0045] The specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples. The following examples are for illustrative purposes only and are not intended to limit the scope of the invention.
[0046] In the description of this application, it should be understood that the terms "center", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this application.
[0047] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, unless otherwise stated, "a plurality of" means two or more.
[0048] In the description of this application, it should be noted that, unless otherwise expressly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection between two components. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances.
[0049] First, some of the terms used in this application will be explained to facilitate understanding by those skilled in the art.
[0050] A file system is a method and data structure used by an operating system to define files on a storage device or partition; that is, a method for organizing files on a storage device. The software component in an operating system responsible for managing and storing file information is called the file management system, or simply the file system. A file system consists of three parts: the file system interface, a collection of software for manipulating and managing objects, and the objects and their attributes. From a system perspective, a file system organizes and allocates space on file storage devices, is responsible for storing files, protecting and retrieving stored files. Specifically, it is responsible for creating files for users, storing, reading, modifying, and dumping files, controlling file access, and deleting files when the user no longer needs them.
[0051] The following is a description of preferred embodiments of the present invention in conjunction with the accompanying drawings.
[0052] like Figure 1 As shown, an embodiment of the present invention discloses a method for preventing file errors caused by abnormal power loss of an in-vehicle terminal, the method comprising:
[0053] S110: Obtain the target file size of the storage device, generate a pre-allocation rule based on the target file size of the storage device, and pre-allocate storage blocks in the FAT file system according to the pre-allocation rule;
[0054] S120: Obtain the file to be written, parse the file to be written, and obtain the file size of the file to be written;
[0055] S130: Index the file to be written to the corresponding storage block according to the file size of the file to be written;
[0056] S140: When the storage of the file to be written is completed, update the file size of the file to be written to the FAT file system.
[0057] In this embodiment, the present invention discloses a method for preventing file errors caused by abnormal power outages of vehicle terminals. The method includes: obtaining the target file size of the storage device; generating a pre-allocation rule based on the target file size of the storage device; pre-allocating storage blocks in the FAT file system according to the pre-allocation rule; obtaining the file to be written; parsing the file to be written to obtain its file size; indexing the file to be written into the corresponding storage block according to its file size; and updating the file size of the file to be written to the FAT file system when the storage of the file to be written is completed. By performing storage block pre-allocation, the present invention can solve the technical problem of file errors caused by abnormal power outages of the FAT file system and incomplete file storage block updates. The present invention can also ensure the integrity of the file to be written.
[0058] like Figure 2 As shown, in some embodiments of this application, when pre-allocating storage blocks in the FAT file system according to the pre-allocation rules, the following steps are included:
[0059] S111: Obtain the target file size of the storage device, and generate several storage blocks in the FAT file system according to the target file size of the storage device;
[0060] S112: Determine the capacity of each storage block, and determine the number of files that each storage block can receive based on the capacity of the storage block.
[0061] In this embodiment, the target file size of the storage device refers to the file size that the storage device wants to store. The target file size is less than or equal to the maximum capacity that the storage device can accept. To ensure file write or read speed, the storage device sets an optimal target file size. After generating several storage blocks, the capacity of each storage block is determined. Based on the capacity of each storage block, the number of files that each storage block can store can be determined. By pre-allocating storage blocks, the storage blocks can be made to have contiguous addresses in the storage device. When the system writes file content, it directly skips the file system and does not use FAT to search for the storage block path corresponding to the file. Instead, it directly uses the pre-allocated FAT file storage path to write the file and finally updates the file size.
[0062] In some embodiments of this application, when generating several storage blocks in the FAT file system according to the preset file size of the storage device, the process includes:
[0063] A preset target file size matrix is established, and the number of storage blocks generated in the FAT file system is set according to the relationship between the target file size of the storage device and the preset target file size matrix.
[0064] In this embodiment, the target file size A of the storage device is determined.
[0065] A preset target file size matrix B is defined as B(B1, B2, B3, B4), where B1 is the first preset target file size, B2 is the second preset target file size, B3 is the third preset target file size, and B4 is the fourth preset target file size, and B1 < B2 < B3 < B4.
[0066] The default FAT file system generates a matrix C of storage blocks, which is set as C(C1, C2, C3, C4, C5), where C1 is the first default generation number, C2 is the second default generation number, C3 is the third default generation number, C4 is the fourth default generation number, and C5 is the fifth default generation number, and C1 < C2 < C3 < C4 < C5.
[0067] The number of storage blocks generated in the FAT file system is determined based on the relationship between the target file size of the storage device and the preset target file sizes:
[0068] When A < B1, the first preset generation quantity C1 is selected as the generation quantity of storage blocks in the FAT file system;
[0069] When B1≤A<B2, the second preset generation quantity C2 is selected as the generation quantity of storage blocks in the FAT file system;
[0070] When B2≤A<B3, the third preset generation quantity C3 is selected as the generation quantity of storage blocks in the FAT file system;
[0071] When B3≤A<B4, the fourth preset generation quantity C4 is selected as the generation quantity of storage blocks in the FAT file system;
[0072] When B4≤A, the fifth preset generation quantity C5 is selected as the generation quantity of storage blocks in the FAT file system.
[0073] In some embodiments of this application, determining the number of files that each storage block can receive based on the capacity of the storage block includes:
[0074] A preset capacity size matrix is used, and the number of files that each storage block can receive is determined based on the relationship between the capacity size of the storage block and the preset capacity size matrix.
[0075] In this embodiment, the capacity K of the storage block is obtained.
[0076] The capacity size matrix L of the preset storage blocks is set as L(L1, L2, L3, L4), where L1 is the first preset capacity size, L2 is the second preset capacity size, L3 is the third preset capacity size, L4 is the fourth preset capacity size, and L1 < L2 < L3 < L4.
[0077] The preset storage block can receive a matrix of file counts m, which is set as m(m1, m2, m3, m4, m5), where m1 is the first preset file count, m2 is the second preset file count, m3 is the third preset file count, m4 is the fourth preset file count, and m5 is the fifth preset file count, and m1 < m2 < m3 < m4 < m5.
[0078] The number of files that each storage block can receive is determined based on the relationship between the capacity of the storage block and each preset capacity:
[0079] When K < L1, the first preset number of files is selected as the number of files that the storage block can receive;
[0080] When L1≤K<L2, the second preset file number m1 is selected as the number of files that the storage block can receive;
[0081] When L2≤K<L3, the third preset file number m2 is selected as the number of files that the storage block can receive;
[0082] When L3≤K<L4, the fourth preset file number m3 is selected as the number of files that the storage block can receive;
[0083] When L4≤K, the fifth preset file number m4 is selected as the number of files that the storage block can receive.
[0084] In some embodiments of this application, the process of obtaining the file to be written and parsing the file to be written to obtain its size includes:
[0085] Determine whether the file to be written is in compressed format.
[0086] If so, obtain the file extensions of all files in the file to be written, and determine whether there is an executable file in the file to be written. If so, obtain the file size of the executable file.
[0087] If not, determine whether the file to be written is an executable file based on the file extension. If it is, obtain the file size of the executable file.
[0088] In this embodiment, the file extensions for executable files can include .exe, .sys, .com, .dll, etc. Therefore, to determine whether a file is executable, it can be determined by whether its file extension is one of .exe, .sys, .com, or .dll. Determining whether a file is executable by its file extension improves both the accuracy and speed of the determination.
[0089] In some embodiments of this application, before indexing the file to be written into the corresponding storage block according to the file size of the file to be written, the method further includes:
[0090] Obtain the storage path between the storage device and each of the storage blocks, and generate a first-level index file and a second-level index file based on the storage path;
[0091] The file to be written is indexed based on the first-level index file or the second-level index file.
[0092] In this embodiment, there is a storage path between the storage device and each storage block. The storage device generates a first index file for the storage path between the corresponding storage blocks. For example, there are 5 storage blocks, which are labeled as storage block 1, storage block 2, storage block 3, storage block 4, and storage block 5. If a file needs to be stored in storage block 1, the first index file is generated based on the storage path between the storage device and storage block 1. However, at this time, the capacity of storage block 1 is insufficient to complete the storage of the file. At this time, the storage device needs to index the file into other storage blocks, such as storage block 2. Then, a second index file is generated based on the storage path between the storage device and storage block 2. The file is indexed into storage block 2 through the second index file. The above is just an example and is not specific. The present invention can achieve fast indexing of files through the first index file and the second index file, thereby improving file storage efficiency.
[0093] like Figure 3 As shown, in some embodiments of this application, when indexing the file to be written into the corresponding storage block according to the file size of the file to be written, the following steps are included:
[0094] S131: Obtain the storage block corresponding to the file to be written, and determine the remaining capacity of the corresponding storage block;
[0095] S132: Determine whether the corresponding storage block can continue to receive the file to be written based on the remaining capacity and the size of the file to be written.
[0096] S133: If the remaining capacity is greater than or equal to the size of the file to be written, it is determined that the file to be written can continue to be received, and the file to be written is indexed into the corresponding storage block according to the first-level index file;
[0097] S134: If the remaining capacity is less than the size of the file to be written, it is determined that the file to be written cannot be received, and the file to be written is indexed into other storage blocks according to the secondary index file.
[0098] In this embodiment, obtaining the storage block corresponding to the file to be written means that each storage block has its own capacity. For example, storage block 1 has a capacity of 32MB, storage block 2 has a capacity of 64MB, and storage block 3 has a capacity of 128MB. If the size of the file to be written is 52MB, then storage block 2 is preferentially selected as the storage block corresponding to the file to be written. However, storage block 2 may have only 10MB of remaining capacity. In this case, storage block 2 cannot continue to receive the file to be written. Therefore, a second index file is needed to index the file to be written into storage block 3 to complete the storage of the file to be written. This invention can improve file storage efficiency, ensure the integrity of file storage, and avoid file anomalies.
[0099] In some embodiments of this application, after storing the file to be written is completed, the method further includes:
[0100] Obtain the file format information of the file to be written;
[0101] The file type of the file to be written is monitored based on the file format information of the file to be written;
[0102] The file types mentioned include normal files and abnormal files.
[0103] In this embodiment, the file format information may include the file type, attributes, and storage structure. The file format information of the file to be written can be obtained according to the actual situation, and no specific limitation is made here.
[0104] In some embodiments of this application, monitoring the file type of the file to be written based on the file format information of the file to be written includes:
[0105] Based on the file format information of the file to be written, a preset exception rule base is obtained, and it is determined whether the file format information of the file to be written is within the exception rule base.
[0106] If so, then the file to be written is determined to be an abnormal file;
[0107] If not, then the file to be written is determined to be a normal file.
[0108] In this embodiment, by obtaining a preset abnormal rule base based on the file format information of the file to be written, and determining whether the file format information of the file to be written is within the abnormal rule base, it is possible to accurately determine whether the file to be written is abnormal, thereby preventing abnormal files from implanting viruses in the system or stealing user privacy data.
[0109] In some embodiments of this application, after determining that the file to be written is an abnormal file, the method further includes:
[0110] Obtain the terminal device corresponding to the storage device and send a prompt message to the terminal device, wherein the prompt message is used to indicate to the terminal device that the file to be written is an abnormal file.
[0111] In this embodiment, by sending a prompt message to the terminal device, network maintenance personnel can be reminded in real time to handle abnormal files, delete or return abnormal files in a timely manner, and ensure the security of the system.
[0112] In summary, this invention discloses a method for preventing file errors caused by abnormal power outages in vehicle terminals. The method includes: obtaining the target file size of a storage device; generating pre-allocation rules based on the target file size; pre-allocating storage blocks in a FAT file system according to the pre-allocation rules; obtaining a file to be written; parsing the file to be written to obtain its file size; indexing the file to be written into the corresponding storage block according to its file size; and updating the file size of the file to be written in the FAT file system when storage is complete. This invention, by pre-allocating storage blocks, solves the technical problem of file errors caused by incomplete file storage block updates during abnormal power outages in the FAT file system. Furthermore, this invention ensures the integrity of the file to be written.
[0113] In the description of the above embodiments, specific features, structures, materials, or characteristics may be combined in any suitable manner in one or more embodiments or examples.
[0114] Although the invention has been described above with reference to embodiments, various modifications can be made and components can be replaced with equivalents without departing from the scope of the invention. In particular, features in the embodiments disclosed herein can be combined with each other in any manner, provided there is no structural conflict. The omission of all such combinations in this specification is merely for brevity and resource conservation. Therefore, the invention is not limited to the specific embodiments disclosed herein, but includes all technical solutions falling within the scope of the claims.
[0115] It will be understood by those skilled in the art that the above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for preventing file errors caused by abnormal power-off of a vehicle terminal, characterized by, The method includes: Obtain the target file size of the storage device, generate a pre-allocation rule based on the target file size of the storage device, and pre-allocate storage blocks in the FAT file system according to the pre-allocation rule; Obtain the file to be written, parse the file to be written, and obtain the file size of the file to be written; The file to be written is indexed into the corresponding storage block according to its size; When the storage of the file to be written is completed, the file size of the file to be written is updated in the FAT file system; When acquiring the file to be written and parsing the file to be written to obtain its size, the process includes: Determine whether the file to be written is in compressed format. If so, obtain the file extensions of all files in the file to be written, and determine whether there is an executable file in the file to be written. If so, obtain the file size of the executable file. If not, determine whether the file to be written is an executable file based on the file extension; if so, obtain the file size of the executable file. Before indexing the file to be written into the corresponding storage block according to the file size of the file to be written, the method further includes: Obtain the storage path between the storage device and each of the storage blocks, and generate a first-level index file and a second-level index file based on the storage path; The file to be written is indexed based on the first-level index file or the second-level index file; When indexing the file to be written into the corresponding storage block according to the file size of the file to be written, the following steps are included: Obtain the storage block corresponding to the file to be written, and determine the remaining capacity of the corresponding storage block; Based on the remaining capacity and the size of the file to be written, it is determined whether the corresponding storage block can continue to receive the file to be written. If the remaining capacity is greater than or equal to the size of the file to be written, it is determined that the file to be written can continue to be received, and the file to be written is indexed into the corresponding storage block according to the first-level index file; If the remaining capacity is less than the size of the file to be written, it is determined that the file to be written cannot be received, and the file to be written is indexed into other storage blocks according to the secondary index file.
2. The method for preventing file errors caused by abnormal power-off of a vehicle terminal according to claim 1, wherein When pre-allocating storage blocks in the FAT file system according to the pre-allocation rules, the following is included: Obtain the target file size of the storage device, and generate several storage blocks in the FAT file system according to the target file size of the storage device; The capacity of each storage block is determined, and the number of files that each storage block can receive is determined based on the capacity of the storage blocks.
3. The method for preventing file errors caused by abnormal power-off of a vehicle terminal according to claim 2, wherein When generating several storage blocks in the FAT file system according to the preset file size of the storage device, the process includes: A preset target file size matrix is established, and the number of storage blocks generated in the FAT file system is set according to the relationship between the target file size of the storage device and the preset target file size matrix.
4. The method for preventing file errors caused by abnormal power-off of a vehicle terminal according to claim 2, wherein When determining the number of files that each storage block can receive based on the capacity of the storage block, the following steps are included: A preset capacity size matrix is used, and the number of files that each storage block can receive is determined based on the relationship between the capacity size of the storage block and the preset capacity size matrix.
5. The method of claim 1, wherein the method further comprises: After the storage of the file to be written is completed, the process also includes: Obtain the file format information of the file to be written; The file type of the file to be written is monitored based on the file format information of the file to be written; The file types mentioned include normal files and abnormal files.
6. The method for preventing file errors caused by abnormal power-off of a vehicle terminal according to claim 5, wherein When monitoring the file type of the file to be written based on its file format information, the process includes: Based on the file format information of the file to be written, a preset exception rule base is obtained, and it is determined whether the file format information of the file to be written is within the exception rule base. If so, then the file to be written is determined to be an abnormal file; If not, then the file to be written is determined to be a normal file.
7. The method for preventing file errors caused by abnormal power-off of a vehicle terminal according to claim 6, wherein After determining that the file to be written is an abnormal file, the process also includes: Obtain the terminal device corresponding to the storage device and send a prompt message to the terminal device, wherein the prompt message is used to indicate to the terminal device that the file to be written is an abnormal file.