Storage processing system, method and equipment of plug-in Flash and storage medium of plug-in Flash
By introducing plug-in design and modification interfaces into the Flash storage processing system, storage management adaptation for different platforms is realized, the problem of complex parameter configuration in the existing technology is solved, and the system adaptability and simplicity of use is improved.
Patent Information
- Application Number
- CN202411654394.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2044-11-19
AI Technical Summary
The existing Flash storage management system needs to be complexly configured between different platforms, and cannot be independently compiled from the platform code and cannot be independently interfaced with the underlying hardware.
A plug-in Flash storage and processing system is proposed. Through the first conversion module, a unified operation interface is provided, and the driver module communicates with the first conversion module. The second conversion module is equipped with a modification interface. The modification interface is weakly associated with the read and write driver files of the Flash hardware to realize multi-platform adaptation.
It improves the system's adaptability to the storage management of different platforms, simplifies the use of Flash storage, and can complete multi-platform adaptation by simply rewriting the modification interface, solving the problem of complex parameter configuration.
Smart Images

Figure CN119759255A_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, smart homes and mobile Internet, the popularity of embedded systems and mobile devices continues to increase. These devices usually need to use Flash storage to store data and programs. Flash storage has the advantages of high speed, low power consumption and reliability, so it has been widely used in embedded and mobile devices. However, the management of Flash storage has challenges in different hardware platforms and operating system environments, such as complex data erasure, data management, memory life management and performance optimization.
[0003] In the prior art, Flash storage management systems are all implemented based on a single platform, and 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 in the process of porting and using the system on different platforms, only the modified interface needs to be rewritten 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, and making the Flash storage usage process more streamlined.
[0005] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present application proposes a plug-in Flash storage processing system, comprising: A first conversion module; A driving module, the driving module is communicatively connected with the first conversion module; A second conversion module, the second conversion module is communicatively connected with the first conversion module, the second conversion module is provided with a modified interface, the modified interface is configured with a modifier, and the modifier is 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 the file operation instruction sent by the DFS file system, standardize and encapsulate the file operation instruction in the form of interface call, obtain the abstract transaction instruction, and send the transaction instruction to the driver module; The driving module is configured to receive a transaction instruction, initialize the transaction instruction into a corresponding instance transaction and execute the instance transaction, and feed back the transaction execution content of the instance transaction to the first conversion module; 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; The second conversion module is configured to receive the 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 driving file in a correlation manner during the process of calling the modified interface.
[0006] Further, in some embodiments, the first conversion module includes: A first interface layer, the first interface layer is provided with a standardized interface; A second interface layer, the second interface layer is provided with a transaction driven interface, and the transaction driven interface is associated with the standardized interface; The third interface layer is provided with a bottom-layer driver interface; 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; 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 file operation instruction after the standardized processing into a transaction instruction, and send the transaction instruction to the driving 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 underlying driver instructions.
[0007] Further, in some embodiments, the instruction type of the file operation instruction includes an initialization type, a read type, and a write type, the interface type of the standardized interface includes a first standardized type, a second standardized type, and a third standardized type, and receiving the file operation instruction, calling the standardized interface according to the instruction type of the file operation instruction to perform standardized processing on the file operation instruction, includes: Receive a file operation instruction and parse the instruction type of the file operation instruction; When the instruction type of the file operation instruction is an initialization type, the corresponding calling interface type is a standardized interface of a 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 a read type, the corresponding calling interface type is a standardized interface of a 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 a write type, the corresponding calling interface type is a standardized interface of a third standardized type, so as to perform standardized processing on the file operation instruction.
[0008] Further, in some embodiments, the interface type of the transaction driven interface includes a first transaction type, a second transaction type, and a third transaction type, and 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: In response to the standardized interface being called, the interface type of the standardized interface is read; When the interface type of the standardized interface is the first standardized type, a transaction driver interface whose interface type is the first transaction type is correspondingly called to encapsulate the standardized file operation instruction into a transaction instruction; Alternatively, when the interface type of the standardized interface is the second standardized type, a transaction driver interface whose interface type is the second transaction type is correspondingly called to encapsulate the standardized file operation instruction into a transaction instruction; Alternatively, when the interface type of the standardized interface is the third standardized type, a transaction driver interface whose interface type is the third transaction type is correspondingly called to encapsulate the standardized file operation instruction into a transaction instruction.
[0009] Further, in some embodiments, the interface type of the bottom-layer driver interface includes a first bottom-layer type and a second bottom-layer type, the instruction type of the bottom-layer driver instruction includes a read type and a write type, and calling the bottom-layer 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 the content of the read operation, the underlying driver interface whose interface type is the first transaction type is correspondingly called to convert the transaction execution content into an underlying driver instruction belonging to the read type; Alternatively, when the transaction execution content belongs to the content of a write operation, the underlying driver interface whose interface type is the second transaction type is correspondingly called to convert the transaction execution content into an underlying driver instruction of the write type.
[0010] Further, 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: Parse the underlying driver instructions; When the underlying driver instruction is of the read type, the corresponding calling interface type is a modified interface of the first modified type; Alternatively, when the bottom-level driver instruction is of a write type, the corresponding calling interface type is a modified interface of a second modified type.
[0011] Further, in some embodiments, the instruction type of the transaction instruction includes an initialization type, a read type, and a write type, and receiving the transaction instruction, initializing the transaction instruction into a corresponding instance transaction, and executing the instance transaction includes: Receive transaction instructions and parse the instruction type of the transaction instructions; 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 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; 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.
[0012] To achieve the above object, a second aspect of an embodiment of the present application proposes a plug-in Flash storage processing method, which is applied to the storage processing system of the first aspect, including: 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; The driving module receives the transaction instruction, initializes the transaction instruction into a corresponding instance transaction and executes the instance transaction, and feeds back the 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 bottom-layer driving instruction and calls the modified interface according to the bottom-layer driving instruction, so that the Flash hardware can execute the reading and writing of the driving file in a correlation manner during the process of calling the modified interface.
[0013] To achieve the above-mentioned purpose, the third aspect of the embodiments of the present application proposes an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the storage processing method of the above-mentioned second aspect embodiment when executing the computer program.
[0014] 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 a processor, the storage processing method of the above-mentioned second aspect embodiment is implemented.
[0015] 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 and encapsulate 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 adaptability of the system to storage management of different platforms, and further, the driver module is configured to receive transaction instructions, initialize the transaction instructions as corresponding instance transactions and execute instance transactions, and feedback the transaction execution content of the instance transaction to the first conversion module; the first conversion module also The invention 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 can execute the read-write driver file in a correlation manner during the process of calling the modified interface, and then provide a modified interface containing the modifier in the second conversion module, so that in the process of system porting and use on different platforms, only the modified interface needs to be rewritten to complete the adaptation work of storage management on multiple platforms, which solves 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
[0016] Figure 1 It is an architecture diagram of a plug-in Flash storage processing system provided by some embodiments of the present application; Figure 2 It is a flow chart of the first interface layer calling the standardized interface according to the instruction type of the file operation instruction provided by some embodiments of the present application; Figure 3 It 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 by some embodiments of the present application; Figure 4 It 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; Figure 5 It is a flow chart of the second conversion module calling the modified interface according to the bottom-layer driving instruction provided by some embodiments of the present application; Figure 6It 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; Figure 7 A flowchart of a storage processing method of a plug-in Flash provided in some embodiments of the present application; Figure 8 It is a schematic diagram of the hardware structure of an electronic device provided in some embodiments of the present application. DETAILED DESCRIPTION
[0017] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0018] In the description of the present application, it should be understood that descriptions involving orientation, 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, and are only for the convenience of describing the present 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, and therefore should not be understood as a limitation on the present application.
[0019] It should also be noted that in the description of this application, "several" means more than one, "more" means more than two, "greater than", "less than", "exceed", etc. are understood to exclude the number itself, and "above", "below", "within", etc. are understood to include the number itself. If there is a description of "first" or "second", it is only used to distinguish the technical features, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.
[0020] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0021] In the description of the present application, the description with 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 the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0022] First, some nouns involved in this application are analyzed: Flash is a non-volatile memory widely used to store data, which will not be lost even after power failure. With its high density, low cost and high write / erase performance, it has become the core technology of devices such as solid-state drives (SSDs), USB flash drives, and SD cards.
[0023] The DFS file system (Distributed 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.
[0024] In the prior art, Flash storage management systems are all implemented based on a single platform, and 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.
[0025] 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, wherein 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 and encapsulate 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, and further, the driver module is configured to receive transaction instructions, initialize the transaction instructions as corresponding instance transactions and execute instance transactions, and feedback transaction execution status of the instance transactions to the first conversion module. row content; the first conversion module is also configured to receive the transaction execution content, convert the transaction execution content into the underlying driver instruction in the form of an interface call, and send the underlying driver instruction 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, so that in the process of system porting and use on different platforms, only the modified interface needs to be rewritten to complete the adaptation work of storage management on multiple platforms, which solves the problem of complex parameter configuration under different platforms or communication interfaces, making the storage use process of Flash more streamlined.
[0026] 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.
[0027] In the first aspect, a plug-in Flash storage processing system in an embodiment of the present application is first described.
[0028] Reference Figure 1 As shown, Figure 1 This is an architecture 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.
[0029] 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 is provided for DFS file systems of different platforms, thereby improving the system's adaptability to storage management on different platforms.
[0030] 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 the operation instructions input by the user.
[0031] 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 the transaction execution content of the instance transaction to the first conversion module.
[0032] Next, the first conversion module nftl_interface is further configured to receive the 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 nftl_port.
[0033] It should be noted that the second conversion module nftl_port is provided with a modified interface nftl_port_hw.c, and the modified interface nftl_port_hw.c is configured with a modifier __weak, and 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.
[0034] 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 driver files 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 system porting and use on different platforms, it is only necessary to rewrite the modified interface to complete the adaptation work of storage management for multiple platforms, which solves the problem of complex parameter configuration under different platforms or communication interfaces, and makes the storage use process of Flash more streamlined.
[0035] Further, 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.
[0036] The first interface layer nflt_api.c 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.
[0037] Furthermore, 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 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.
[0038] 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 according to 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 a new transaction conversion function needs to be added, it only needs to be expanded at the underlying driver interface level without large-scale modifications to the entire system.
[0039] 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.
[0040] In addition, the storage processing system of the plug-in Flash 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.
[0041] Furthermore, it should be noted that the storage processing system of the plug-in Flash 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.
[0042] 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 by 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.
[0043] Step S201: receiving a file operation instruction and parsing the instruction type of the file operation instruction.
[0044] Specifically, a file operation instruction is received, and an instruction type of the file operation instruction is parsed.
[0045] 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 a first standardized type, a second standardized type and a 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.
[0046] Step S202: 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.
[0047] In a possible implementation, when the instruction type of the file operation instruction is an initialization type, the corresponding calling interface type is a standardized interface nftl_api_init of a first standardized type, so as to perform initialization type standardization processing on the file operation instruction.
[0048] Among them, the standardized interface nftl_api_init belongs to the interface in the first interface layer nflt_api.c.
[0049] Step S203: Alternatively, when the instruction type of the file operation instruction is a read type, the corresponding calling interface type is a standardized interface of a second standardized type, so as to perform standardized processing on the file operation instruction.
[0050] In a possible implementation, when the instruction type of the file operation instruction is an initialization type, the corresponding calling interface type is a standardized interface nftl_api_write of the second standardized type, so as to perform standardized processing on the file operation instruction.
[0051] Among them, the standardized interface nftl_api_write belongs to the interface in the first interface layer nflt_api.c.
[0052] Step S204: Alternatively, when the instruction type of the file operation instruction is a write type, the corresponding calling interface type is a standardized interface of a third standardized type, so as to perform standardized processing on the file operation instruction.
[0053] In a possible implementation, when the instruction type of the file operation instruction is an initialization type, the corresponding calling interface type is a standardized interface nftl_api_read of the third standardized type, so as to perform standardized processing on the file operation instruction.
[0054] Among them, the standardized interface nftl_api_read belongs to the interface in the first interface layer nflt_api.c.
[0055] Reference Figure 3 As shown, Figure 3 It 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 by 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.
[0056] Step S301: In response to a standardized interface being called, the interface type of the standardized interface is read.
[0057] In a possible implementation, in response to the standardized interface being called, the interface type of the standardized interface is read.
[0058] 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.
[0059] 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.
[0060] In a possible implementation, when the interface type of the standardized interface is the first standardized type (ie, the standardized interface is nftl_api_init), the corresponding calling interface type is the transaction driver interface nftl_init of the first transaction type to encapsulate the standardized file operation instructions into transaction instructions.
[0061] The transaction driver interface nftl_init belongs to the interface in the second interface layer nftl_init.c.
[0062] Step S303: Alternatively, when the interface type of the standardized interface is the second standardized type, a transaction driver interface whose interface type is the second transaction type is correspondingly called to encapsulate the standardized file operation instruction into a transaction instruction.
[0063] In a possible implementation, when the interface type of the standardized interface is the second standardized type (ie, the standardized interface is nftl_api_write), the corresponding calling interface type is the transaction driver interface _nand_write of the second transaction type to encapsulate the standardized file operation instructions into transaction instructions.
[0064] Among them, the transaction driver interface _nand_write belongs to the interface in the second interface layer nftl_init.c.
[0065] Step S304: Alternatively, when the interface type of the standardized interface is the third standardized type, a transaction driver interface whose interface type is the third transaction type is correspondingly called to encapsulate the standardized file operation instruction into a transaction instruction.
[0066] In a possible implementation, when the interface type of the standardized interface is the third standardized type (ie, the standardized interface is nftl_api_read), the corresponding calling interface type is the transaction driver interface _nand_read of the third transaction type to encapsulate the standardized file operation instructions into transaction instructions.
[0067] Among them, the transaction driver interface _nand_read belongs to the interface in the second interface layer nftl_init.c.
[0068] Further, 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.
[0069] Step S401: parse the transaction execution content.
[0070] Step S402: When the transaction execution content belongs to the content of the read operation, the underlying driver interface whose interface type is the first transaction type is correspondingly called to convert the transaction execution content into an underlying driver instruction of the read type.
[0071] In a possible implementation, when the transaction execution content belongs to the content of a read operation, that is, the instance transaction executes the transaction content belonging to a write operation during the running process, the corresponding calling interface type is the underlying driver interface nftl_nand_read_page of the first transaction type to convert the transaction execution content into an underlying driver instruction belonging to the read type.
[0072] Step S403: Alternatively, when the transaction execution content belongs to the content of a write operation, the underlying driver interface of the corresponding calling interface type is the second transaction type, so as to convert the transaction execution content into an underlying driver instruction of the write type.
[0073] In a 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 calling interface type is the underlying driver interface nftl_nand_write_page of the second transaction type to convert the transaction execution content into an underlying driver instruction belonging to a read type.
[0074] Further, the interface type of the modified interface includes a first modification type and a second modification type, Figure 5 It 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. Step S501: parsing the underlying driver instructions.
[0075] 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.
[0076] In a possible implementation, when the bottom-level driver instruction is of a read type, the corresponding calling interface type is a modified interface (__weak)_nftl_port_hw_read_page of a first modified type.
[0077] Step S502: Alternatively, when the bottom-level driving instruction is of a write type, the corresponding calling interface type is a modified interface of a second modified type.
[0078] In a possible implementation, when the bottom-level 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.
[0079] Further, in some embodiments, Figure 6 This is a flowchart of a driver module provided by 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.
[0080] Step S601: receiving a transaction instruction and parsing the instruction type of the transaction instruction.
[0081] 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.
[0082] 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.
[0083] 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.
[0084] 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.
[0085] 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 functional type and the instance transaction is executed.
[0086] 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.
[0087] The transaction execution contents correspondingly executed in the instance transaction belonging to the second functional type include write-balancing transactions, bad block management and recovery transactions, and logical address to physical address mapping transactions.
[0088] Furthermore, the present application embodiment also proposes a plug-in Flash storage processing method, which is applied to the plug-in Flash storage processing system 1000, referring to Figure 7 , Figure 7 This is a flowchart of a storage processing method of a 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.
[0089] 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.
[0090] Step S702: the driving 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.
[0091] 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.
[0092] 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 can execute the reading and writing of the driver file in a correlation manner during the process of calling the modified interface.
[0093] The storage processing method of the plug-in Flash and the storage processing system of the plug-in Flash 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 instruction; finally, 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 can execute the reading and writing of the driver file in a correlation manner during the process of calling the modified interface, and then based on the interface encapsulation of the first conversion module, a unified operation interface is provided for the DFS file systems of different platforms, which improves the adaptability of the system to storage management on different platforms. At the same time, in the process of transplantation and use on different platforms, it is only necessary to rewrite the modified interface to complete the adaptation work of storage management on multiple platforms, which solves the problem of complex parameter configuration under different platforms or communication interfaces, making the storage use process of Flash more streamlined.
[0094] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above 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, a car computer, etc.
[0095] 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, and the electronic device includes: The processor 801 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used 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; 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 applications. When the technical solution provided in the embodiments of this specification is implemented by software or firmware, the relevant program code is stored in the memory 802, and the processor 801 calls and executes the cache data writing method and / or cache data reading method provided in the embodiments of this application; Input / output interface 803, used to implement information input and output; The communication interface 804 is used to realize the communication interaction between the device and other devices. The communication can be realized through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.); A bus 805 that transmits information between various components of the device (e.g., the processor 801, the memory 802, the input / output interface 803, and the communication interface 804); 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 .
[0096] An embodiment of the present application further provides a computer-readable storage medium, which stores 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.
[0097] 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 disposed 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.
[0098] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present 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 the present application are also applicable to similar technical problems.
[0099] Those skilled in the art will appreciate 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.
[0100] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0101] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0102] 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 sequence. 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 of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising 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.
[0103] It should be understood that in the present 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 objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single 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.
[0104] In the several embodiments provided in the present 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 schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, 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.
[0105] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0106] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0107] 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, 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, and the computer software product is stored in a storage medium, including multiple instructions to enable 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 (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0108] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights 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 is communicatively connected with the first conversion module; a second conversion module, the second conversion module being communicatively connected with 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 of the file operation instruction in the form of an interface call, 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 the 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 the form of an interface call, and send the bottom-level driving instruction to the second conversion module; The second conversion module is configured to receive the bottom-level driving instruction, and call the modified interface according to the bottom-level driving instruction, so that the Flash hardware executes the read-write driver file in a correlation process during the process of calling the modified interface.
2. The storage processing system according to claim 1, characterized in that: The first conversion module comprises: A first interface layer, wherein the first interface layer is provided with a standardized interface; a second interface layer, the second interface layer being provided with a transaction driven interface, the transaction driven interface being associated with the standardized interface; A third interface layer, wherein the third interface layer is provided with a bottom layer driving 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, characterized in that: The instruction type of the file operation instruction includes an initialization type, a read type, and a write type, the interface type of the standardized interface includes 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, the 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, characterized in that: The interface types of the transaction driven interface include a first transaction type, a second transaction type and a third transaction type, and the response to the standardized interface being called, calling the transaction driven interface 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, characterized in that: 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 the content of the 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 the content of a write operation, the underlying driver interface whose interface type is the second transaction type is correspondingly called to convert the transaction execution content into the underlying driver instruction belonging to the write type.
6. The storage processing system according to claim 5, characterized in that: 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 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 bottom-level driving 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, characterized in that: The instruction type of 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 as an instance transaction belonging to a 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; 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 a 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 leveling transaction, a bad block management recovery transaction, and a logical address to physical address mapping transaction.
8. A storage processing method of a plug-in Flash, applied to the storage processing system according to any one of claims 1 to 7, characterized in that: include: 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 to obtain an abstract transaction instruction, and sends the transaction instruction to the driver module; The driving module receives the transaction instruction, initializes the transaction instruction into a corresponding instance transaction and executes the instance transaction, and feeds back the 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 bottom-level driving instruction, and calls the modified interface according to the bottom-level driving instruction, so that the Flash hardware executes the read-write driver file in a relational manner during the process of calling the modified interface.
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 described in 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
Engine system and rendering method thereof
CN111158866A
Multi-project independent compiling method and system, terminal and medium
CN112306540A
System and method for verifying modular FLASH function
CN117573453A
Service interaction method of flash service platform and corresponding flash service platform
US20140108264A1