Plug-in Flash storage processing system, method, device and storage medium thereof
Through the plug-in Flash storage processing system, the modified interface of the first conversion module and the second conversion module is used to solve the complexity problem of cross-platform storage management, realize cross-platform storage management adaptation and simplified configuration, and improve the flexibility and efficiency of the system.
Patent Information
- Application Number
- CN202411654394.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2044-11-19
AI Technical Summary
Existing Flash storage management systems cannot be independently compiled between different platforms without platform code and need to be bound to the underlying hardware interface, making storage management complex and inflexible.
A plug-in Flash storage processing system is adopted, which provides a unified operation interface through the first conversion module, combines the modification interface of the driver module and the second conversion module to achieve cross-platform storage management adaptation, and uses modifiers to weakly associate Flash hardware driver files to support multi-platform transplantation.
It achieves cross-platform storage management adaptability, simplifies the Flash storage usage process, reduces parameter configuration complexity, and improves system flexibility and efficiency.
Smart Images

Figure CN119759255B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer cache, and in particular to a plug-in Flash storage processing system, method, device and storage medium thereof. Background Art
[0002] With the development of the Internet of Things (IoT), smart homes, and mobile internet, the popularity of embedded systems and mobile devices continues to grow. These devices often require Flash storage to store data and programs. Flash storage, with its advantages of high speed, low power consumption, and reliability, has gained widespread adoption in embedded and mobile devices. However, managing Flash storage presents challenges across diverse hardware platforms and operating system environments, such as complex data erasure, data management, memory lifespan management, and performance optimization.
[0003] In the existing technology, Flash storage management systems are all implemented based on a single platform. The register process of operating the underlying hardware needs to be re-adapted on different platforms. In addition, the existing Flash storage management framework cannot be compiled independently from the platform code and needs to be bound to the underlying hardware interface. Summary of the Invention
[0004] The main purpose of the embodiments of the present application is to propose a plug-in Flash storage processing system, method, device and storage medium thereof, which provides a unified operation interface for DFS file systems of different platforms through the interface encapsulation of the first conversion module, thereby improving the system's adaptability to storage management on different platforms. At the same time, a modified interface containing modifiers is provided in the second conversion module, so that when the system is ported and used on different platforms, it only needs to rewrite the modified interface to complete the adaptation work of storage management on multiple platforms, thereby solving the problem of complex parameter configuration under different platforms or communication interfaces, making the Flash storage usage process more streamlined.
[0005] To achieve the above objectives, a first aspect of an embodiment of the present application provides a plug-in Flash storage processing system, comprising:
[0006] a first conversion module;
[0007] A driving module, the driving module is communicatively connected with the first conversion module;
[0008] a second conversion module, the second conversion module being communicatively connected to the first conversion module, the second conversion module being provided with a modified interface, the modified interface being configured with a modifier, the modifier being used to weakly associate the modified interface with a read / write driver file of the Flash hardware;
[0009] The first conversion module is configured to receive file operation instructions sent by the DFS file system, standardize and encapsulate the file operation instructions in the form of interface calls, obtain abstract transaction instructions, and send the transaction instructions to the driver module;
[0010] The driving module is configured to receive a transaction instruction, initialize the transaction instruction into a corresponding instance transaction, execute the instance transaction, and feed back transaction execution content of the instance transaction to the first conversion module;
[0011] The first conversion module is further configured to receive transaction execution content, convert the transaction execution content into a bottom-level driving instruction in the form of an interface call, and send the bottom-level driving instruction to the second conversion module;
[0012] The second conversion module is configured to receive a bottom-layer driving instruction and call the modified interface according to the bottom-layer driving instruction, so that the Flash hardware can execute the reading and writing of the driver file in a correlation manner during the process of calling the modified interface.
[0013] Furthermore, in some embodiments, the first conversion module includes:
[0014] The first interface layer is provided with a standardized interface;
[0015] The second interface layer is provided with a transaction driven interface, which is associated with the standardized interface;
[0016] The third interface layer is provided with a bottom driver interface;
[0017] The first interface layer is configured to receive a file operation instruction and call a standardized interface according to an instruction type of the file operation instruction to perform standardized processing on the file operation instruction;
[0018] The second interface layer is configured to, in response to the standardized interface being called, call the transaction driven interface according to the association relationship between the transaction driven interface and the standardized interface, encapsulate the standardized file operation instruction into a transaction instruction, and send the transaction instruction to the driver module;
[0019] The third interface layer is configured to receive the transaction execution content fed back by the driver module, and call the underlying driver interface according to the transaction execution content to convert the transaction execution content into underlying driver instructions.
[0020] Furthermore, in some embodiments, the instruction type of the file operation instruction includes an initialization type, a read type, and a write type, and the interface type of the standardized interface includes a first standardized type, a second standardized type, and a third standardized type. Receiving the file operation instruction and calling the standardized interface according to the instruction type of the file operation instruction to perform standardized processing on the file operation instruction include:
[0021] Receive file operation instructions and parse the instruction type of the file operation instructions;
[0022] When the instruction type of the file operation instruction is an initialization type, a corresponding calling interface type is a standardized interface of a first standardized type, so as to perform standardized processing on the file operation instruction;
[0023] Alternatively, when the instruction type of the file operation instruction is a read type, a standardized interface of a second standardized type is correspondingly called to perform standardized processing on the file operation instruction;
[0024] Alternatively, when the instruction type of the file operation instruction is a write type, the corresponding calling interface type is a standardized interface of the third standardized type, so as to perform standardized processing on the file operation instruction.
[0025] Furthermore, in some embodiments, the interface types of the transaction-driven interface include a first transaction type, a second transaction type, and a third transaction type. In response to the standardized interface being called, the transaction-driven interface is called according to the association relationship between the transaction-driven interface and the standardized interface to encapsulate the standardized file operation instruction into a transaction instruction, including:
[0026] In response to the standardized interface being called, the interface type of the standardized interface is read;
[0027] When the interface type of the standardized interface is the first standardized type, a transaction driven interface whose interface type is the first transaction type is correspondingly called to encapsulate the standardized file operation instruction into a transaction instruction;
[0028] Alternatively, when the interface type of the standardized interface is the second standardized type, a transaction driven interface whose interface type is the second transaction type is correspondingly called to encapsulate the standardized file operation instruction into a transaction instruction;
[0029] Alternatively, when the interface type of the standardized interface is the third standardized type, a transaction driven interface whose interface type is the third transaction type is correspondingly called to encapsulate the standardized file operation instruction into a transaction instruction.
[0030] Furthermore, in some embodiments, the interface type of the underlying driver interface includes a first underlying type and a second underlying type, the instruction type of the underlying driver instruction includes a read type and a write type, and calling the underlying driver interface according to the transaction execution content fed back by the driver module includes:
[0031] Perform content analysis on transaction execution content;
[0032] When the transaction execution content belongs to the content of the read operation, the underlying driver interface of the first transaction type is called to convert the transaction execution content into an underlying driver instruction of the read type;
[0033] Alternatively, when the transaction execution content belongs to a write operation, the underlying driver interface of the second transaction type is called to convert the transaction execution content into an underlying driver instruction of the write type.
[0034] Furthermore, in some embodiments, the interface type of the modified interface includes a first modified type and a second modified type, and calling the modified interface according to the underlying driver instruction includes:
[0035] Parse the underlying driver instructions;
[0036] When the underlying driver instruction is of the read type, the corresponding calling interface type is the modified interface of the first modified type;
[0037] Alternatively, when the underlying driver instruction is of a write type, the corresponding calling interface type is a modified interface of the second modified type.
[0038] Furthermore, in some embodiments, the transaction instruction includes an initialization type, a read type, and a write type. Receiving the transaction instruction, initializing the transaction instruction into a corresponding instance transaction, and executing the instance transaction include:
[0039] Receive transaction instructions and parse the instruction type of the transaction instructions;
[0040] When the instruction type of the transaction instruction is an initialization type, the transaction instruction is initialized into an instance transaction belonging to the first functional type and the instance transaction is executed, wherein the corresponding transaction execution content in the instance transaction belonging to the first functional type includes an initialization parameter transaction and a power failure data recovery transaction;
[0041] Alternatively, when the instruction type of the transaction instruction is a read type or a write type, the transaction instruction is initialized as an instance transaction belonging to the second functional type and the instance transaction is executed, wherein the corresponding transaction execution content executed in the instance transaction belonging to the second functional type includes a write balancing transaction, a bad block management recovery transaction, and a logical address to physical address mapping transaction.
[0042] To achieve the above-mentioned object, a second aspect of an embodiment of the present application provides a plug-in Flash storage processing method, which is applied to the storage processing system of the first aspect, including:
[0043] The first conversion module responds to the file operation instruction sent by the DFS file system, standardizes the file operation instruction in the form of interface call, obtains an abstract transaction instruction, and sends the transaction instruction to the driver module;
[0044] The driver module receives the transaction instruction, initializes the transaction instruction into a corresponding instance transaction, executes the instance transaction, and feeds back the transaction execution content of the instance transaction to the first conversion module;
[0045] The first conversion module receives the transaction execution content, converts the transaction execution content into a bottom-level driving instruction in the form of an interface call, and sends the bottom-level driving instruction to the second conversion module;
[0046] The second conversion module receives the bottom-layer driving instruction and calls the modified interface according to the bottom-layer driving instruction, so that the Flash hardware executes the reading and writing of the driver file in a correlation manner during the process of calling the modified interface.
[0047] To achieve the above-mentioned purpose, the third aspect of the embodiments of the present application proposes an electronic device, which includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the storage processing method of the above-mentioned second aspect embodiment.
[0048] To achieve the above-mentioned purpose, the fourth aspect of the embodiment of the present application proposes a storage medium, which is a computer-readable storage medium. The storage medium stores a computer program, and when the computer program is executed by the processor, the storage processing method of the above-mentioned second aspect embodiment is implemented.
[0049] The embodiments of the present application have the following beneficial effects: the present application is provided with a first conversion module, a driver module and a second conversion module, the driver module is communicatively connected to the first conversion module, and the second conversion module is communicatively connected to the first conversion module, wherein the first conversion module is configured to receive file operation instructions sent by the DFS file system, standardize the file operation instructions in the form of interface calls, obtain abstract transaction instructions, and send transaction instructions to the driver module, thereby providing a unified operation interface for DFS file systems of different platforms based on the interface encapsulation of the first conversion module, thereby improving the system's adaptability to storage management of different platforms, further, the driver module is configured to receive transaction instructions, initialize the transaction instructions to corresponding instance transactions and execute instance transactions, and feedback the transaction execution content of the instance transactions to the first conversion module; the first conversion module also It is configured to receive transaction execution content, convert the transaction execution content into underlying driver instructions in the form of interface calls, and send the underlying driver instructions to the second conversion module; the second conversion module is provided with a modified interface, the modified interface is configured with a modifier, the modifier is used to weakly associate the modified interface with the read-write driver file of the Flash hardware, the second conversion module is configured to receive the underlying driver instruction, call the modified interface according to the underlying driver instruction, so that the Flash hardware executes the read-write driver file in a correlation manner during the process of calling the modified interface, and then provides a modified interface containing the modifier in the second conversion module, which can complete the adaptation work of storage management for multiple platforms by rewriting the modified interface during the process of system porting and use on different platforms, solving the problem of complex parameter configuration under different platforms or communication interfaces, making the storage use process of Flash more streamlined. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 This is an architectural diagram of a plug-in Flash storage processing system provided by some embodiments of the present application;
[0051] Figure 2 This is a flowchart of a first interface layer calling a standardized interface according to an instruction type of a file operation instruction provided by some embodiments of the present application;
[0052] Figure 3 This is a flowchart of the second interface layer calling the transaction-driven interface according to the association relationship between the transaction-driven interface and the standardized interface provided in some embodiments of the present application;
[0053] Figure 4 This is a flowchart of the third interface layer calling the underlying driver interface according to the transaction execution content provided by some embodiments of the present application;
[0054] Figure 5 This is a flowchart of the second conversion module calling the modified interface according to the underlying driver instruction provided by some embodiments of the present application;
[0055] Figure 6 This is a flowchart of a driver module provided in some embodiments of the present application that initializes a transaction instruction into a corresponding instance transaction and executes the instance transaction;
[0056] Figure 7 A flowchart of a plug-in Flash storage processing method provided in some embodiments of the present application;
[0057] Figure 8 This is a schematic diagram of the hardware structure of an electronic device provided in some embodiments of the present application. DETAILED DESCRIPTION
[0058] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0059] In the description of this application, it should be understood that descriptions involving orientations, such as up, down, front, back, left, right, etc., indicating orientations or positional relationships, are based on the orientations or positional relationships 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, be constructed and operated in a specific orientation. Therefore, they cannot be understood as limitations on this application.
[0060] It should also be noted that, in the description of this application, "several" means more than one, "plurality" means more than two, "greater than," "less than," and "exceed" are understood to exclude the number itself, while "above," "below," and "within" are understood to include the number itself. The use of "first" and "second" in the description is solely for the purpose of distinguishing technical features and should not be construed as indicating or implying relative importance, implicitly specifying the number of the indicated technical features, or implicitly specifying the order of the indicated technical features.
[0061] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.
[0062] In the description of this application, reference to the terms "one embodiment," "some embodiments," "illustrative embodiments," "examples," "specific examples," or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of this application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in any appropriate manner in any one or more embodiments or examples.
[0063] First, let’s analyze some of the terms used in this application:
[0064] Flash memory is a non-volatile memory widely used to store data, ensuring it persists even after a power outage. Its high density, low cost, and fast write / erase performance make it a core technology for devices such as solid-state drives (SSDs), USB flash drives, and SD cards.
[0065] The Distributed File System (DFS) file system is a special file system architecture that integrates resources distributed anywhere on the network into a logical file system structure, allowing users to access shared files on the network as easily as accessing local files.
[0066] In the existing technology, Flash storage management systems are all implemented based on a single platform. The register process of operating the underlying hardware needs to be re-adapted on different platforms. In addition, the existing Flash storage management framework cannot be compiled independently from the platform code and needs to be bound to the underlying hardware interface.
[0067] Based on this, the embodiment of the present application provides a plug-in Flash storage processing system, method, device and storage medium thereof, which is provided with a first conversion module, a driver module and a second conversion module. The driver module is communicatively connected to the first conversion module, and the second conversion module is communicatively connected to the first conversion module. The first conversion module is configured to receive file operation instructions sent by the DFS file system, standardize the file operation instructions in the form of interface calls, obtain abstract transaction instructions, and send transaction instructions to the driver module. Based on the interface encapsulation of the first conversion module, a unified operation interface can be provided for DFS file systems of different platforms, thereby improving the system's adaptability to storage management of different platforms. Furthermore, the driver module is configured to receive transaction instructions, initialize the transaction instructions to corresponding instance transactions and execute instance transactions, and feedback the transaction execution status of the instance transactions to the first conversion module. row content; the first conversion module is further configured to receive transaction execution content, convert the transaction execution content into underlying driver instructions in the form of interface calls, and send the underlying driver instructions to the second conversion module; the second conversion module is provided with a modified interface, the modified interface is configured with a modifier, the modifier is used to weakly associate the modified interface with the read-write driver file of the Flash hardware, the second conversion module is configured to receive the underlying driver instruction, call the modified interface according to the underlying driver instruction, so that the Flash hardware executes the read-write driver file in a correlation manner during the process of calling the modified interface, and then provide a modified interface containing a modifier in the second conversion module, which can complete the adaptation work of storage management for multiple platforms by rewriting the modified interface during the process of system porting and use on different platforms, solving the problem of complex parameter configuration under different platforms or communication interfaces, making the storage use process of Flash more streamlined.
[0068] The embodiments of the present application provide a plug-in Flash storage processing system, method, device, and storage medium thereof, which are specifically described through the following embodiments.
[0069] In the first aspect, a plug-in Flash storage processing system in an embodiment of the present application is first described.
[0070] Reference Figure 1 As shown, Figure 1 This is an architectural diagram of a plug-in Flash storage processing system provided in some embodiments of the present application. The plug-in Flash storage processing system 100 includes a first conversion module nftl_interface, a driver module nftl_core, and a second conversion module nftl_port. The driver module nftl_core is communicatively connected to the first conversion module nftl_interface, and the second conversion module nftl_port is communicatively connected to the first conversion module nftl_interface.
[0071] Among them, the first conversion module nftl_interface is configured to receive file operation instructions sent by the DFS file system, standardize the file operation instructions in the form of interface calls, obtain abstract transaction instructions, and send transaction instructions to the driver module nftl_core. Based on the interface encapsulation of the first conversion module, a unified operation interface can be provided for DFS file systems of different platforms, thereby improving the system's adaptability to storage management on different platforms.
[0072] It should be noted that the DFS file system is an underlying system of the operating platform. The DFS file system is used by the operating platform to manage files and generate corresponding file operation instructions according to operation instructions input by users.
[0073] Furthermore, the driver module nftl_core is configured to receive a transaction instruction, initialize the transaction instruction into a corresponding instance transaction and execute the instance transaction, and feed back transaction execution content of the instance transaction to the first conversion module.
[0074] Next, the first conversion module nftl_interface is further configured to receive transaction execution content, convert the transaction execution content into underlying driver instructions in the form of interface calls, and send the underlying driver instructions to the second conversion module nftl_port.
[0075] It should be noted that the second conversion module nftl_port is provided with a modified interface nftl_port_hw.c, which is configured with a modifier __weak. The modifier __weak is used to weakly associate the modified interface nftl_port_hw.c with the read-write driver file Spinand / mtdcore of the Flash hardware.
[0076] Furthermore, the second conversion module nftl_port is configured to receive the underlying driver instructions and call the modified interface nftl_port_hw.c according to the underlying driver instructions, so that the Flash hardware can execute the reading and writing of the driver file Spinand / mtdcore in a relational manner during the process of calling the modified interface nftl_port_hw.c, and then provide a modified interface containing modifiers in the second conversion module. In the process of porting the system to different platforms, it is only necessary to rewrite the modified interface to complete the adaptation work of storage management for multiple platforms, thereby solving the problem of complex parameter configuration under different platforms or communication interfaces, and making the storage use process of Flash more streamlined.
[0077] Furthermore, it should be noted that the first conversion module nftl_interface includes a first interface layer nflt_api.c, a second interface layer nftl_init.c and a third interface layer nftl_hw_interface.c. The first interface layer nflt_api.c is provided with a standardized interface, the second interface layer nftl_init.c is provided with a transaction driver interface, and the third interface layer nftl_hw_interface.c is provided with a bottom-level driver interface. The transaction driver interface is associated with the standardized interface.
[0078] The first interface layer nflt_api.c is configured to receive a file operation instruction and call a standardized interface according to the instruction type of the file operation instruction to perform standardized processing on the file operation instruction.
[0079] In addition, the second interface layer nftl_init.c is configured to, in response to the standardized interface being called, call the transaction driver interface according to the association relationship between the transaction driver interface and the standardized interface to encapsulate the standardized file operation instructions into transaction instructions and send the transaction instructions to the driver module.
[0080] Furthermore, the third interface layer nftl_hw_interface.c is configured to receive the transaction execution content fed back by the driver module and call the underlying driver interface based on the transaction execution content to convert the transaction execution content into underlying driver instructions, thereby reducing the coupling between the driver module and the first conversion module. When new transaction conversion functions need to be added, it is only necessary to expand at the underlying driver interface level without making large-scale modifications to the entire system.
[0081] In general, the plug-in Flash storage processing system adopts a plug-in design and can be compiled independently, making it highly flexible and customizable. Users can then choose and install different plug-ins according to their needs to achieve specific functions.
[0082] In addition, the plug-in Flash storage processing system is very lightweight, takes up little space, and does not burden the device. This design not only saves storage space, but also improves the overall efficiency and response speed of the system. Moreover, the storage processing system has the characteristics of multi-platform applicability and can run on various operating systems and devices, providing users with great convenience and seamless experience. Whether on RTOS, operating system programs, or Linux systems, the storage processing system can run stably to meet the needs of different users. In summary, the storage processing system of the present application has the characteristics of high performance, flexibility, lightweight and multi-platform applicability, which will bring users a more convenient and efficient use experience.
[0083] Furthermore, it should be noted that the plug-in Flash storage processing system uses C language for instruction editing, and thus can be compiled separately in the form of a black box without the need for secondary compilation through the operating platform, thereby improving the versatility of the storage processing system.
[0084] further, Figure 2 This is a flowchart of the first interface layer calling the standardized interface according to the instruction type of the file operation instruction provided in some embodiments of the present application. The method of calling the standardized interface of the first interface layer may include but is not limited to steps S201 to S204.
[0085] Step S201: receiving a file operation instruction and parsing the instruction type of the file operation instruction.
[0086] Specifically, a file operation instruction is received, and an instruction type of the file operation instruction is parsed.
[0087] Among them, the instruction types of file operation instructions include initialization type, read type and write type, and the interface types of standardized interfaces include first standardized type, second standardized type and third standardized type. The standardized interface of the first standardized type is used to perform standardized encapsulation of file operation instructions of the initialization type, the standardized interface of the second standardized type is used to perform standardized encapsulation of file operation instructions of the read type, and the standardized interface of the third standardized type is used to perform standardized encapsulation of file operation instructions of the write type.
[0088] Step S202: When the instruction type of the file operation instruction is an initialization type, a standardized interface of a first standardized type is correspondingly called to perform standardized processing on the file operation instruction.
[0089] In a possible implementation, when the instruction type of the file operation instruction is an initialization type, a standardized interface nftl_api_init whose interface type is a first standardized type is correspondingly called to perform initialization type standardization processing on the file operation instruction.
[0090] Among them, the standardized interface nftl_api_init belongs to the interface in the first interface layer nflt_api.c.
[0091] Step S203: Alternatively, when the instruction type of the file operation instruction is a read type, a standardized interface of a second standardized type is correspondingly called to perform standardized processing on the file operation instruction.
[0092] In a possible implementation, when the instruction type of the file operation instruction is an initialization type, a standardized interface nftl_api_write of a second standardized type is correspondingly called to perform standardized processing on the file operation instruction.
[0093] Among them, the standardized interface nftl_api_write belongs to the interface in the first interface layer nflt_api.c.
[0094] Step S204: Alternatively, when the instruction type of the file operation instruction is a write type, a corresponding standardized interface of a third standardized type is called to perform standardized processing on the file operation instruction.
[0095] In a possible implementation, when the instruction type of the file operation instruction is an initialization type, a standardized interface nftl_api_read of a third standardized type is correspondingly called to perform standardized processing on the file operation instruction.
[0096] Among them, the standardized interface nftl_api_read belongs to the interface in the first interface layer nflt_api.c.
[0097] Reference Figure 3 As shown, Figure 3 This is a flowchart of the second interface layer calling the transaction-driven interface according to the association relationship between the transaction-driven interface and the standardized interface provided in some embodiments of the present application. The method of the second interface layer calling the transaction-driven interface may include but is not limited to steps S301 to S304.
[0098] Step S301: In response to a standardized interface being called, the interface type of the standardized interface is read.
[0099] In a possible implementation, in response to the standardized interface being called, the interface type of the standardized interface is read.
[0100] Among them, the interface types of the transaction-driven interface include a first transaction type, a second transaction type and a third transaction type. The transaction-driven interface of the first transaction type is associated with a standardized interface of a first standardized type, the transaction-driven interface of the second transaction type is associated with a standardized interface of a second standardized type, and the transaction-driven interface of the third transaction type is associated with a standardized interface of a third standardized type.
[0101] Step S302: When the interface type of the standardized interface is the first standardized type, a transaction driven interface whose interface type is the first transaction type is correspondingly called to encapsulate the standardized file operation instruction into a transaction instruction.
[0102] In a possible implementation, when the interface type of the standardized interface is the first standardized type (i.e., the standardized interface is nftl_api_init), the corresponding transaction driver interface nftl_init with the first transaction type is called to encapsulate the standardized file operation instructions into transaction instructions.
[0103] The transaction driver interface nftl_init belongs to the interface in the second interface layer nftl_init.c.
[0104] Step S303: Alternatively, when the interface type of the standardized interface is the second standardized type, a transaction driven interface whose interface type is the second transaction type is correspondingly called to encapsulate the standardized file operation instruction into a transaction instruction.
[0105] In a possible implementation, when the interface type of the standardized interface is the second standardized type (i.e., the standardized interface is nftl_api_write), the corresponding transaction driver interface _nand_write with the second transaction type is called to encapsulate the standardized file operation instructions into transaction instructions.
[0106] The transaction driver interface _nand_write belongs to the interface in the second interface layer nftl_init.c.
[0107] Step S304: Alternatively, when the interface type of the standardized interface is the third standardized type, a transaction driven interface whose interface type is the third transaction type is correspondingly called to encapsulate the standardized file operation instruction into a transaction instruction.
[0108] In a possible implementation, when the interface type of the standardized interface is the third standardized type (i.e., the standardized interface is nftl_api_read), the corresponding transaction driver interface _nand_read whose interface type is the third transaction type is called to encapsulate the standardized file operation instructions into transaction instructions.
[0109] The transaction driver interface _nand_read belongs to the interface in the second interface layer nftl_init.c.
[0110] Furthermore, the interface type of the bottom-layer driver interface includes a first bottom-layer type and a second bottom-layer type, and the instruction type of the bottom-layer driver instruction includes a read type and a write type. Figure 4 This is a flowchart of the third interface layer calling the underlying driver interface according to the transaction execution content provided by some embodiments of the present application. The method of the third interface layer calling the underlying driver interface according to the transaction execution content may include but is not limited to steps S401 to S402.
[0111] Step S401: parse the transaction execution content.
[0112] Step S402: When the transaction execution content belongs to a read operation, a corresponding underlying driver interface of the first transaction type is called to convert the transaction execution content into an underlying driver instruction of the read type.
[0113] In one possible implementation, when the transaction execution content belongs to a read operation, that is, the instance transaction executes a transaction content belonging to a write operation during the running process, the corresponding underlying driver interface nftl_nand_read_page whose interface type is the first transaction type is called to convert the transaction execution content into an underlying driver instruction belonging to the read type.
[0114] Step S403: Alternatively, when the transaction execution content belongs to a write operation, the underlying driver interface of the second transaction type is called to convert the transaction execution content into an underlying driver instruction of the write type.
[0115] In one possible implementation, when the transaction execution content belongs to the content of a write operation, that is, the instance transaction executes the transaction content belonging to a write operation during the running process, the corresponding underlying driver interface nftl_nand_write_page with the second transaction type as the interface type is called to convert the transaction execution content into an underlying driver instruction belonging to a read type.
[0116] Furthermore, the interface type of the modified interface includes a first modification type and a second modification type. Figure 5 This is a flowchart of the second conversion module calling the modified interface according to the underlying driving instruction provided by some embodiments of the present application. The method of the second conversion module underlying driving instruction calling the modified interface may include but is not limited to steps S501 to S502.
[0117] Step S501: parsing the underlying driver instructions.
[0118] Step S501: When the bottom-level driving instruction is of a read type, the corresponding calling interface type is a modified interface of a first modified type.
[0119] In a possible implementation, when the underlying driver instruction is of a read type, the corresponding calling interface type is a modified interface (__weak)_nftl_port_hw_read_page of the first modified type.
[0120] Step S502: Alternatively, when the underlying driving instruction is of a write type, the corresponding calling interface type is a modified interface of a second modified type.
[0121] In a possible implementation, when the underlying driver instruction is of a write type, the corresponding calling interface type is a modified interface (__weak)_nftl_port_hw_write_page of the second modified type.
[0122] Further, in some embodiments, Figure 6 This is a flowchart of a driver module provided in some embodiments of the present application that initializes a transaction instruction into a corresponding instance transaction and executes the instance transaction. The method for the driver module to initialize a transaction instruction into a corresponding instance transaction and execute the instance transaction may include but is not limited to steps S601 to S603.
[0123] Step S601: Receive a transaction instruction and parse the instruction type of the transaction instruction.
[0124] In a possible implementation, a transaction instruction is received and an instruction type of the transaction instruction is parsed, wherein the instruction type of the transaction instruction includes an initialization type, a read type, and a write type.
[0125] Step S602: When the instruction type of the transaction instruction is an initialization type, the transaction instruction is initialized as an instance transaction belonging to the first function type and the instance transaction is executed.
[0126] In a possible implementation, when the instruction type of the transaction instruction is an initialization type, the transaction instruction is initialized as an instance transaction belonging to the first function type and the instance transaction is executed.
[0127] Among them, the corresponding transaction execution content in the instance transaction belonging to the first function type includes an initialization parameter transaction and a power-off data recovery transaction.
[0128] Step S603: Alternatively, when the instruction type of the transaction instruction is a read type or a write type, the transaction instruction is initialized as an instance transaction belonging to the second function type and the instance transaction is executed.
[0129] In a possible implementation, when the instruction type of the transaction instruction is a read type or a write type, the transaction instruction is initialized as an instance transaction belonging to the second function type and the instance transaction is executed.
[0130] The transaction execution contents corresponding to the instance transaction belonging to the second functional type include a write-leveling transaction, a bad block management and recovery transaction, and a logical address to physical address mapping transaction.
[0131] Furthermore, the embodiment of the present application also proposes a plug-in Flash storage processing method, which is applied to the above plug-in Flash storage processing system 1000, referring to Figure 7 , Figure 7This is a flowchart of a storage processing method for plug-in Flash provided in some embodiments of the present application. The storage processing method may include but is not limited to steps S701 to S704.
[0132] Step S701: The first conversion module responds to the file operation instruction sent by the DFS file system, standardizes and encapsulates the file operation instruction in the form of interface call, obtains an abstract transaction instruction, and sends the transaction instruction to the driver module.
[0133] Step S702: The driver module receives the transaction instruction, initializes the transaction instruction into a corresponding instance transaction, executes the instance transaction, and feeds back the transaction execution content of the instance transaction to the first conversion module.
[0134] Step S703: The first conversion module receives the transaction execution content, converts the transaction execution content into a bottom-level driving instruction in the form of an interface call, and sends the bottom-level driving instruction to the second conversion module.
[0135] Step S704: The second conversion module receives the bottom-layer driver instruction and calls the modified interface according to the bottom-layer driver instruction, so that the Flash hardware executes the reading and writing of the driver file in a correlation manner during the process of calling the modified interface.
[0136] The above-mentioned plug-in Flash storage processing method and the above-mentioned plug-in Flash storage processing system are based on the same inventive concept. The first conversion module responds to the file operation instruction sent by the DFS file system, standardizes the file operation instruction in the form of interface call, obtains the abstract transaction instruction, and sends the transaction instruction to the driver module; then, the driver module receives the transaction instruction, initializes the transaction instruction to the corresponding instance transaction and executes the instance transaction, and feeds back the transaction execution content of the instance transaction to the first conversion module; then, the first conversion module receives the transaction execution content, converts the transaction execution content into the underlying driver instruction in the form of interface call, and feeds back the transaction execution content to the second conversion module. The module sends the underlying driver instructions; finally, the second conversion module receives the underlying driver instructions and calls the modified interface according to the underlying driver instructions, so that the Flash hardware can execute the reading and writing of the driver file in a relational manner during the process of calling the modified interface. Based on the interface encapsulation of the first conversion module, a unified operation interface is provided for the DFS file systems of different platforms, thereby improving the system's adaptability to storage management on different platforms. At the same time, during the process of porting and using different platforms, it is only necessary to rewrite the modified interface to complete the adaptation work for storage management on multiple platforms, thereby solving the problem of complex parameter configuration under different platforms or communication interfaces and making the Flash storage usage process more streamlined.
[0137] The present application also provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the aforementioned plug-in Flash storage processing method when executing the computer program. The electronic device can be any smart terminal, including a mobile phone, a tablet computer, and an in-vehicle computer.
[0138] See also Figure 8 , Figure 8 : is a schematic diagram of the hardware structure of an electronic device provided in some embodiments of the present application, the electronic device including:
[0139] The processor 801 can be implemented using a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is configured to execute relevant programs to implement the cache data writing method and / or cache data reading method provided in the embodiments of the present application;
[0140] The memory 802 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 802 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 802 and is called by the processor 801 to execute the cache data writing method and / or cache data reading method provided in the embodiments of this application.
[0141] Input / output interface 803, used to implement information input and output;
[0142] Communication interface 804, used to implement communication interaction between this device and other devices, which can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WiFi, Bluetooth, etc.);
[0143] Bus 805 , which transmits information between various components of the device (e.g., processor 801 , memory 802 , input / output interface 803 , and communication interface 804 );
[0144] The processor 801 , the memory 802 , the input / output interface 803 and the communication interface 804 are connected to each other in communication within the device via a bus 805 .
[0145] An embodiment of the present application further provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the cache data writing method and / or cache data reading method provided in the embodiment of the present application are provided.
[0146] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0147] The embodiments described in the embodiments of this application are intended to more clearly illustrate the technical solutions of the embodiments of this application and do not constitute a limitation on the technical solutions provided by the embodiments of this application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0148] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0149] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, i.e., they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.
[0150] Those skilled in the art will appreciate that all or some of the steps in the methods, systems, and functional modules / units in the devices disclosed above may be implemented as software, firmware, hardware, or appropriate combinations thereof.
[0151] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0152] It should be understood that in this application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0153] In the several embodiments provided in this application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For example, the division of the above units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0154] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0155] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0156] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-accessible storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes multiple instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store programs.
[0157] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but are not intended to limit the scope of the present invention. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and essence of the present invention should be within the scope of the present invention.
Claims
1. A plug-in Flash storage processing system, characterized in that: include: a first conversion module; a driving module, the driving module being communicatively connected to the first conversion module; a second conversion module, the second conversion module being communicatively connected to the first conversion module, the second conversion module being provided with a modified interface, the modified interface being configured with a modifier, the modifier being used to weakly associate the modified interface with a read / write driver file of the Flash hardware; The first conversion module is configured to receive a file operation instruction sent by the DFS file system, perform standardized encapsulation on the file operation instruction in the form of an interface call to obtain an abstract transaction instruction, and send the transaction instruction to the driver module; The driving module is configured to receive the transaction instruction, initialize the transaction instruction into a corresponding instance transaction and execute the instance transaction, and feed back transaction execution content of the instance transaction to the first conversion module; The first conversion module is further configured to receive the transaction execution content, convert the transaction execution content into a bottom-level driving instruction in an interface call manner, and send the bottom-level driving instruction to the second conversion module; The second conversion module is configured to receive the underlying driver instructions and call the modified interface according to the underlying driver instructions, so that the Flash hardware executes the read-write driver file in a relational manner during the process of calling the modified interface, so that the storage processing system rewrites the modified interface during the process of being ported and used on different platforms to complete the adaptation work of storage management for multiple platforms.
2. The storage processing system according to claim 1, wherein: The first conversion module includes: A first interface layer, wherein the first interface layer is provided with a standardized interface; a second interface layer, wherein the second interface layer is provided with a transaction-driven interface, and the transaction-driven interface is associated with the standardized interface; A third interface layer, wherein the third interface layer is provided with an underlying driver interface; The first interface layer is configured to receive the file operation instruction and call the standardized interface according to the instruction type of the file operation instruction to perform standardized processing on the file operation instruction; The second interface layer is configured to, in response to the standardized interface being called, call the transaction driven interface according to the association relationship between the transaction driven interface and the standardized interface, so as to encapsulate the standardized file operation instruction into the transaction instruction, and send the transaction instruction to the driver module; The third interface layer is configured to receive the transaction execution content fed back by the driver module, and call the underlying driver interface according to the transaction execution content to convert the transaction execution content into the underlying driver instruction.
3. The storage processing system according to claim 2, wherein: The instruction types of the file operation instruction include an initialization type, a read type, and a write type, the interface types of the standardized interface include a first standardized type, a second standardized type, and a third standardized type, and the receiving of the file operation instruction and calling the standardized interface according to the instruction type of the file operation instruction to perform standardized processing on the file operation instruction include: receiving the file operation instruction and parsing the instruction type of the file operation instruction; When the instruction type of the file operation instruction is the initialization type, a corresponding calling interface type is a standardized interface of the first standardized type, so as to perform standardized processing on the file operation instruction; Alternatively, when the instruction type of the file operation instruction is the read type, the corresponding calling interface type is a standardized interface of the second standardized type, so as to perform standardized processing on the file operation instruction; Alternatively, when the instruction type of the file operation instruction is the write type, the corresponding calling interface type is a standardized interface of the third standardized type, so as to perform standardized processing on the file operation instruction.
4. The storage processing system according to claim 3, wherein: The interface types of the transaction-driven interface include a first transaction type, a second transaction type, and a third transaction type. In response to the standardized interface being called, the transaction-driven interface is called according to the association relationship between the transaction-driven interface and the standardized interface to encapsulate the standardized file operation instruction into the transaction instruction, including: In response to the standardized interface being called, reading the interface type of the standardized interface; When the interface type of the standardized interface is the first standardized type, the transaction driven interface whose interface type is the first transaction type is correspondingly called to encapsulate the standardized file operation instruction into the transaction instruction; Alternatively, when the interface type of the standardized interface is the second standardized type, the transaction driven interface whose interface type is the second transaction type is correspondingly called to encapsulate the standardized file operation instruction into the transaction instruction; Alternatively, when the interface type of the standardized interface is the third standardized type, the transaction driven interface whose interface type is the third transaction type is correspondingly called to encapsulate the standardized file operation instruction into the transaction instruction.
5. The storage processing system according to claim 4, wherein: The interface type of the bottom-level driver interface includes a first bottom-level type and a second bottom-level type, the instruction type of the bottom-level driver instruction includes a read type and a write type, and calling the bottom-level driver interface according to the transaction execution content fed back by the driver module includes: Perform content analysis on transaction execution content; When the transaction execution content belongs to a read operation, the underlying driver interface whose interface type is the first transaction type is correspondingly called to convert the transaction execution content into the underlying driver instruction belonging to the read type; Alternatively, when the transaction execution content belongs to a write operation, the underlying driver interface of the second transaction type is called to convert the transaction execution content into the underlying driver instruction of the write type.
6. The storage processing system according to claim 5, wherein: The interface type of the modified interface includes a first modification type and a second modification type, and calling the modified interface according to the bottom-level driver instruction includes: Parse the underlying driver instructions; When the bottom-level driving instruction belongs to the read type, the corresponding calling interface type is the modified interface of the first modified type; Alternatively, when the underlying driver instruction belongs to the write type, the corresponding calling interface type is the modified interface of the second modified type.
7. The storage processing system according to claim 1, wherein: The transaction instruction includes an initialization type, a read type, and a write type. The receiving the transaction instruction, initializing the transaction instruction into a corresponding instance transaction, and executing the instance transaction includes: receiving the transaction instruction and parsing the instruction type of the transaction instruction; When the instruction type of the transaction instruction is the initialization type, the transaction instruction is initialized into an instance transaction belonging to a first functional type and the instance transaction is executed, wherein the transaction execution content corresponding to the instance transaction belonging to the first functional type includes an initialization parameter transaction and a power failure data recovery transaction; Alternatively, when the instruction type of the transaction instruction is the read type or the write type, the transaction instruction is initialized as an instance transaction belonging to the second functional type and the instance transaction is executed, wherein the transaction execution content correspondingly executed in the instance transaction belonging to the second functional type includes a write balancing transaction, a bad block management recovery transaction, and a logical address to physical address mapping transaction.
8. A plug-in Flash storage processing method, applied to the storage processing system according to any one of claims 1 to 7, characterized in that: include: The first conversion module, in response to the file operation instruction sent by the DFS file system, performs standardized encapsulation on the file operation instruction in the form of an interface call to obtain an abstract transaction instruction, and sends the transaction instruction to the driver module; The driver module receives the transaction instruction, initializes the transaction instruction into a corresponding instance transaction, executes the instance transaction, and feeds back transaction execution content of the instance transaction to the first conversion module; The first conversion module receives the transaction execution content, converts the transaction execution content into a bottom-level driving instruction in the form of an interface call, and sends the bottom-level driving instruction to the second conversion module; The second conversion module receives the underlying driver instruction and calls the modified interface according to the underlying driver instruction, so that the Flash hardware executes the read-write driver file in a relational manner during the process of calling the modified interface, so that the storage processing system rewrites the modified interface during the process of being ported and used on different platforms to complete the adaptation work of storage management on multiple platforms.
9. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the storage processing method according to claim 8 when executing the computer program.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the storage processing method according to claim 8 is implemented.
Citation Information
Patent Citations
Method for JS to communicate with FLASH
CN107608805A
System and method for verifying modular FLASH function
CN117573453A