Embedded file interaction method, operating system and readable storage medium

By implementing the FTP server function in an embedded system, users can operate the embedded file system through the FTP client, solving the problem of the lack of visual interface and debugging difficulties in traditional embedded file systems, and achieving rapid device failure repair and running status monitor.

CN119293008APending Publication Date: 2025-01-10HANGZHOU HOLLYSYS AUTOMATION
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411402299.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-09
Publication Date
2025-01-10

Smart Images

  • Figure CN119293008A_ABST
    Figure CN119293008A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of embedded file systems, and provides an embedded file interaction method, an operating system and a readable storage medium, and the method comprises the steps: receiving a directory switching request sent by an FTP client through an FTP server; analyzing the command word from the directory switching request, and switching the target file system according to the command word; executing a corresponding file operation on a file in the target file system; and sending the result of the file operation to the FTP client, so that the FTP client displays the content of the file operation. According to the embodiment of the invention, the file in the embedded file system can be checked, if the file is abnormal, the file content can be quickly modified, and the normal operation of the system can be recovered, so that the problems that the embedded file system in the prior art only supports the interface calling of an application layer, has no visual operation interface, and is inconvenient to operate are solved. And a user cannot check information such as file content and use of a file system in a running process, so that debugging of equipment and monitoring of a running state of the equipment are not facilitated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of embedded file systems, and in particular to an embedded file interaction method, an operating system, and a readable storage medium. Background Art

[0002] Embedded file system is a module that implements file access and management functions in embedded systems. It provides a series of file management functions such as file input and output, and provides file system support for embedded systems and devices. Embedded file system plays a very important role in embedded devices. During the operation of the system, file content and management information are stored in memories such as Nand Flash or EMMC Flash.

[0003] Traditional embedded file systems only support application layer interface calls and do not have a visual operation interface. When the file system usage exceeds the system load, it can only be viewed through logs, and the cause cannot be located in detail. Users cannot view information such as file content and file system usage during operation, which is not conducive to device debugging and monitoring of device operation status. Summary of the invention

[0004] In view of this, an embodiment of the present application provides an interactive method for embedded files, an operating system and a readable storage medium to solve the problem in the prior art that the current embedded file system only supports interface calls at the application layer, has no visual operation interface, and the user cannot view information such as the file content and file system usage during operation, which is not conducive to device debugging and monitoring of the device's operating status.

[0005] In a first aspect of an embodiment of the present application, a method for interacting with embedded files is provided, which is applied to an embedded system, wherein the embedded system includes an FTP server and at least one file system, and the method includes: receiving a directory switching request sent by an FTP client through the FTP server; parsing a command word and switching a target file system according to the directory switching request, wherein the directory switching request includes a command word; performing corresponding file operations on files in the target file system; and sending the results of the file operations to the FTP client so that the FTP client displays the contents of the file operations.

[0006] In combination with the method provided in the first aspect, before receiving the directory switching request sent by the FTP client through the FTP server, the method also includes: receiving the connection request sent by the FTP client through the FTP server; according to the connection request, the FTP server sends a response message to the FTP client to establish a connection with the FTP client.

[0007] In combination with the method provided in the first aspect, parsing the command word from the directory switching request and switching the target file system according to the command word includes: parsing the command word in the directory switching request and determining the target file system to be switched according to the command word; calling the interface corresponding to the target file system according to the target file system to be switched; and switching to the target file system through the interface.

[0008] In combination with the method provided in the first aspect, performing corresponding file operations on files in the target file system includes: obtaining operation instructions sent by the FTP client; and performing corresponding file operations on the files to be processed in the target file system according to the operation instructions.

[0009] In combination with the method provided in the first aspect, after performing corresponding file operations on files in the target file system, the method also includes: receiving a file download request sent by an FTP client through an FTP server; obtaining the file to be processed in the target file system according to the file download request, and sending the file to the FTP client, so that the FTP client downloads the file and performs corresponding processing on the file; and receiving the processed file sent by the FTP client through the FTP server.

[0010] In combination with the method provided in the first aspect, after the FTP server sends a response message to the FTP client according to the connection request and establishes a connection with the FTP client, the method also includes: if the FTP client is connected for the first time, sending the root directory of each file system of the embedded operating system to the FTP client; after switching to the target file system, sending the root directory of the target file system to the FTP client.

[0011] In combination with the method provided in the first aspect, the file operations include: creating a file, reading and writing a file, uploading a file, downloading a file, closing a file, renaming a file, and deleting a file.

[0012] According to a second aspect of an embodiment of the present application, an embedded operating system is provided, including: an FTP server, and the FTP server implements the steps of the method described above when executing instructions.

[0013] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method described above when executing the computer program.

[0014] According to a fourth aspect of an embodiment of the present application, a readable storage medium is provided, wherein the readable storage medium stores a computer program, and wherein the computer program implements the steps of the method described above when executed by a processor.

[0015] Compared with the prior art, the embodiments of the present application have the following beneficial effects: by implementing the FTP server function in the embedded system, the user can connect to the embedded system FTP server through the FTP client, thereby realizing operations such as viewing (downloading), deleting and modifying (uploading) files in the embedded file system, and if a certain file is abnormal during system operation, resulting in a system operation failure, the file content can be quickly modified and the system can be restored to normal operation. The embodiments of the present application solve the problem that the current embedded file system in the prior art only supports the interface call of the application layer, has no visual operation interface, and the user cannot view the file content and the use of the file system during operation, which is not conducive to the debugging of the device and the monitoring of the operation status of the device. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0017] Figure 1 It is a flowchart of an interactive method of embedded files provided in an embodiment of the present application;

[0018] Figure 2 It is a flowchart of a method for receiving a directory switching request sent by an FTP client through an FTP server provided in an embodiment of the present application;

[0019] Figure 3 It is a flowchart of a method for parsing a command word from a directory switching request and switching a target file system according to the command word provided by an embodiment of the present application;

[0020] Figure 4 It is a flowchart of a method for performing corresponding file operations on files in a target file system provided by an embodiment of the present application;

[0021] Figure 5 It is a flowchart of a method provided by an embodiment of the present application after performing a corresponding file operation on a file in a target file system;

[0022] Figure 6 is a structural schematic diagram of another embedded file interaction device provided in an embodiment of the present application;

[0023] Figure 7 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0024] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0025] First, the terms involved in this application are explained as follows:

[0026] Embedded operating system: Embedded operating system (EOS) refers to the operating system used in embedded devices. Embedded devices (also known as embedded systems) refer to devices that are composed of hardware and software and can operate independently, including the software operating environment and the software content of its operating system, as well as hardware content including processors, memory, communication modules, etc.

[0027] In embedded devices, software running on top of the embedded operating system can directly access the device's hardware. It can be seen that the upper-layer application can directly dispatch the underlying embedded file system to access the external memory module, that is, when the upper-layer application needs to access the external memory module, the application can directly call the file system interface to access the external memory module, such as reading and writing files stored in the external memory module through write functions and read functions.

[0028] It can be seen that the use of embedded operating systems reduces the coupling between software and hardware. The scheduling and management of hardware by upper-level applications do not depend on the underlying hardware. Therefore, embedded operating systems have the characteristics of portability, software and hardware customization, and configurability. In addition, compared with the rich resources and powerful software configuration required by other non-embedded operating systems, embedded operating systems have low power consumption and are more suitable for small devices, such as wearable devices and IoT devices.

[0029] Embedded file system: It is an important part of embedded operating system. Embedded file system is the method used by embedded operating system to clearly define files on storage devices. Embedded file system is also used to: manage and schedule file storage space, provide logical structure, physical structure and storage method of files, realize the mapping from file identifier to actual address, realize file control operation and access operation (including services such as creating, opening, reading, writing, closing and revoking files).

[0030] The embedded file system mainly consists of three parts: the file system interface, the software set for object manipulation and management, and the objects and attributes. From the system perspective, the embedded file system is a system that organizes and allocates the space of the file storage device, is responsible for file storage, and protects and retrieves the stored files. Specifically, it is responsible for creating files for users, storing, reading, modifying, and dumping files, and controlling file access.

[0031] File operation: refers to operations such as creating, opening, reading, writing, closing, deleting, modifying, and transferring files. Functions that need to be called when performing file operations include but are not limited to: open, write, read, close, seek-read, random-read, etc. The embodiments of this application do not limit specific file operations.

[0032] In particular, the file operation specifically refers to the operation on the file stored in the external module of the electronic device, rather than the operation on the data in the memory, because the data in the memory can be directly read and written by the CPU.

[0033] Task: refers to the operating system of an electronic device, that is, a task refers to a series of operations to achieve a certain purpose.

[0034] In the embodiment of the present application, the task, i.e., the instruction or request sent by the FTP client, is initiated by an application, service, etc. running on an embedded operating system in an electronic device. An application can initiate one or more tasks.

[0035] The types of tasks include, but are not limited to: sensor tasks, display tasks, over-the-air download tasks, audio tasks, navigation (such as Global Positioning System (GPS)) tasks, input tasks, capability tasks, and the like.

[0036] The electronic device executes a task specifically including: after an application or service initiates a task, the application or service initiates one or more scheduling requests to the embedded operating system by creating a thread, and the embedded operating system responds to the one or more scheduling requests to schedule the embedded file system to execute the corresponding one or more file operations, thereby completing the task. In other words, when a task contains instructions for executing one or more file operations, the task corresponds to one or more scheduling requests.

[0037] The traditional embedded file system only supports the interface call of the application layer and has no visual operation interface. When the use of the file system exceeds the system load, it can only be viewed through the log, and the reason cannot be located in detail. The user cannot view the file content and the use of the file system during operation, which is not conducive to the debugging of the device and the monitoring of the operating status of the device. Therefore, the embodiment of the present application provides an interactive method for embedded files to solve the problem in the prior art that the current embedded file system only supports the interface call of the application layer and has no visual operation interface. The user cannot view the file content and the use of the file system during operation, which is not conducive to the debugging of the device and the monitoring of the operating status of the device.

[0038] An embedded file interaction method, an operating system, and a readable storage medium according to an embodiment of the present application will be described in detail below with reference to the accompanying drawings.

[0039] Figure 1 1 is a flow chart of an embedded file interaction method provided by an embodiment of the present application. The method includes:

[0040] Step S101: receiving a directory switching request sent by an FTP client via an FTP server.

[0041] Step S102: parsing a command word from the directory switching request, and switching the target file system according to the command word.

[0042] Step S103: performing corresponding file operations on the files in the target file system.

[0043] Step S104: Send the result of the file operation to the FTP client, so that the FTP client displays the content of the file operation.

[0044] Specifically, in this embodiment, an FTP server is set in the embedded file operating system, and the FTP server implements a communication function with the FTP client through the FTP transmission protocol. The embedded file system includes at least one file system, such as the commonly used EMMC file system, Nand Flash file system, etc. The embodiment of the present application proposes a non-fragmented storage file system based on NandFlash.

[0045] The FTP client can be deployed on a computer or mobile device, and the embedded operating system receives the request or instruction sent by the FTP client through the FTP server. In this embodiment, the embedded operating system receives the directory switching request sent by the FTP client through the FTP server. The directory switching request includes a command word, and the command word is used to represent the user's instructions and intentions. The embedded operating system parses the command word according to the directory switching request, obtains the target file system pointed to by the directory switching request, determines the interface of the target file system, and calls the interface of the target file system to switch to the target file system. After switching to the target file system, the corresponding file operation is performed on the files to be processed in the file system.

[0046] The FTP server sends the file operation process to the FTP client, so that the FTP client displays the content of the file operation.

[0047] In the above steps, the files in the embedded file system can be viewed in real time through the FTP client. If a file is abnormal during system operation and causes system operation failure, the file content can be quickly modified to restore the normal operation of the system.

[0048] This embodiment implements an FTP server in an embedded operating system, and manages and operates different file systems on the server side according to system deployment. The core of the method is to complete the switching of file systems and related directory switching within the embedded system, call the corresponding file system interface and encapsulate it into an FTP protocol package to interact with the FTP client, and the user completes the file operation on the related file system through the FTP client. In the embedded operating system, directory switching, directory operation, file operation and other functions of the embedded file system can be completed according to different FTP protocol command words and parameters, which is convenient for device debugging and monitoring and maintenance of the running status of the device.

[0049] In some embodiments, Figure 2 As shown, in step S101, before the FTP server receives the directory switching request sent by the FTP client, the method further includes:

[0050] Step S201: receiving a connection request sent by an FTP client via an FTP server.

[0051] Step S202: According to the connection request, the FTP server sends a response message to the FTP client to establish a connection with the FTP client.

[0052] Step S203: receiving a directory switching request sent by the FTP client through the FTP server.

[0053] Specifically, in this embodiment, the FTP client can establish a connection with the FTP server through the FTP protocol, and the FTP client sends a connection request to the FTP server. According to the connection request, the FTP server sends a response message to the FTP client to establish a connection with the FTP client. After the FTP client and the FTP server establish a connection, the FTP server receives a directory switching request sent by the FTP client.

[0054] It should be understood that before establishing an FTP connection, the user needs to confirm the FTP server information, including the IP address or domain name, port number, user name and password. This information is usually provided by the administrator of the FTP server.

[0055] In some embodiments, Figure 3 As shown, step S102, parsing the command word from the directory switching request, and switching the target file system according to the command word includes:

[0056] Step S301, parsing the command word in the directory switching request, and determining the target file system to be switched according to the command word.

[0057] Step S302: according to the target file system to be switched, call the interface corresponding to the target file system.

[0058] Step S303: switch to the target file system through the interface.

[0059] Specifically, in this embodiment, the directory switching request includes a command word, and the command word is used to represent the target file system to be switched. The user can send a directory switching request of the target file system through the FTP client. Since the embedded file system includes at least one file system, all file systems are displayed in the form of a file directory on the FTP server. When the user needs to enter any file system, the corresponding file system directory switching request can be sent to obtain access to the file system and perform corresponding file operations.

[0060] The FTP server is connected to the file system through a file system interface. At least one interface is provided on the FTP server for correspondingly connecting to at least one file system. It should be understood that different interfaces are connected to different file systems, and one interface is connected to one file system. The interface can be determined according to the directory switching request sent by the user. Therefore, the user can send instructions through the FTP client to connect to the target file system from the interface of the target file system, and then perform file operations.

[0061] In some embodiments, Figure 4 As shown, step S103, performing corresponding file operations on files in the target file system includes:

[0062] Step S401, obtaining an operation instruction sent by the FTP client.

[0063] Step S402: According to the operation instruction, a corresponding file operation is performed on the to-be-processed file in the target file system.

[0064] Specifically, in this embodiment, after switching to the target file system through the FTP server, the embedded operating system again obtains the operation instruction sent by the FTP client, and the operation instruction represents the file operation to be performed by the user, and the file operation may include file upload, download, file or folder creation, renaming and deletion, etc. The embedded operating system performs the corresponding file operation according to the operation instruction.

[0065] In some embodiments, after the FTP server obtains the operation instruction, it will send the corresponding information to the FTP client, so that the corresponding result can be displayed on the FTP client. For example, the FTP client sends a connection request (user name, password login), and the FTP server will return the connection response information; the FTP client sends a folder display instruction, and the FTP server will return the response information of sending the folder display; the FTP client sends an enter folder instruction, and the FTP server will return the response information of sending the enter folder; the FTP client sends a folder operation instruction, and the FTP server will return the response information of sending the folder operation; the FTP client sends a file download instruction, and the FTP server will return the response information of sending the file download, and display the information such as the file content transmission and the client receiving the data flow; the FTP client sends a file upload instruction, and the FTP server will return the response information of sending the file upload, and display the information such as the file content transmission and the client receiving the data flow.

[0066] In some embodiments, Figure 5 As shown, in step S103, after performing the corresponding file operation on the file in the target file system, the method further includes:

[0067] Step S501: receiving a file download request sent by an FTP client via an FTP server.

[0068] Step S502: According to the file download request, the to-be-processed file in the target file system is obtained, and the file is sent to the FTP client, so that the FTP client downloads the file and processes the file accordingly.

[0069] Step S503: receiving the processed file sent by the FTP client through the FTP server.

[0070] Specifically, in this embodiment, the file to be processed can be downloaded to the FTP client for processing, such as modifying the file content. The user can modify the file content through the FTP client, and the modification operation includes adding file content, deleting file content, etc. The processed file can be uploaded to the FTP server again through the FTP client. This embodiment is more convenient, faster and more efficient for maintaining the embedded file system. It can be understood that when downloading, processing and uploading files, the operation process is displayed on the graphical interface of the FTP client.

[0071] In some embodiments, in step S202, according to the connection request, the FTP server sends a response message to the FTP client, and after establishing a connection with the FTP client, the method also includes: if the FTP client is connected for the first time, sending the root directory of each file system of the embedded operating system to the FTP client; after switching to the target file system, sending the root directory of the target file system to the FTP client.

[0072] Specifically, in this embodiment, the FTP client returns to the root directory by default when connected, and the root node directory of each embedded file system is returned under the root directory. When the user selects an embedded file system, the system saves the file system mark and records the current operation directory internally, enters the directory and exits the directory according to different command words to maintain the current operation directory, and returns to the FTP root directory when the exit directory is the root node of the current file system. The user can only see the root node directory of each embedded file system.

[0073] For example, when the FTP client is connected for the first time, the root directory displays the root nodes of various embedded file systems, such as EMMC_FS and NandFlash_FS. When the user chooses to enter the NandFlash_FS directory, the file system switches to the NandFlash file system, and the NandFlash file system related operations are called to display the directory node information under the NandFlash_FS directory. The operations of entering other directories and files are similar. When the user exits the directory structure layer by layer, when he returns to the root node of the relevant file system, the display after returning again is the display of the first connection, that is, the system returns to the initial connection state.

[0074] In some embodiments, the file operation may include: creating a file, reading and writing a file, uploading a file, downloading a file, closing a file, renaming a file, deleting a file, etc.

[0075] Specifically, in this embodiment, according to the file path and name sent by the FTP client, different interfaces are called according to different embedded file systems to perform operations such as: file upload, download, file or folder creation, renaming and deletion, and respond to client commands according to actual conditions.

[0076] Compared with the prior art, the embodiment of the present application has the following beneficial effects: by implementing the FTP server function in the embedded system, the user can connect to the embedded system FTP server through the FTP client, so as to realize the operations such as viewing (downloading), deleting and modifying (uploading) files in the embedded file system, and if a certain file is abnormal during the operation of the system and causes the system operation failure, the file content can be quickly modified and the normal operation of the system can be restored. The problem that the current embedded file system in the prior art only supports the interface call of the application layer, has no visual operation interface, and the user cannot view the file content and the use of the file system during the operation, which is not conducive to the debugging of the device and the monitoring of the operation status of the device is solved.

[0077] In addition, an embodiment of the present application further provides an embedded operating system, including: an FTP server, and the FTP server implements the steps of the above method when executing instructions.

[0078] Specifically, in this embodiment, an FTP server is deployed in the embedded operating system to connect to an external FTP client. The user can communicate with the FTP server through the FTP client to control the embedded operating system to switch the file system and perform corresponding operations on the files in the file system. In addition, the FTP server can send response information to the FTP client so that the file operation process can be displayed on the FTP client, which is beneficial for the monitoring and maintenance of the embedded system. In particular, if a certain file is abnormal during system operation and causes a system operation failure, the file content can be quickly modified and the system can be restored to normal operation. The maintenance efficiency is high and the time cost is low.

[0079] In this embodiment, the user can conveniently view and modify the files in the embedded system, improving the maintainability and maintainability of the device. If there is hardware expansion, only the file system type needs to be added on the FTP server to implement the operation of the newly added file system, which has strong scalability.

[0080] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present application, which will not be described one by one here.

[0081] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0082] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.

[0083] Figure 6Schematic diagram of an interactive device for embedded files provided in an embodiment of the present application. Figure 6 As shown, the interactive device of the embedded file includes:

[0084] The FTP client module 601 is installed with an FTP client and is configured to send a directory switching request and display the file operation process and results.

[0085] The FTP server module 602 receives instructions from the FTP client or sends a response to the FTP client, and is configured to parse the command word and switch the target file system according to the directory switching request, wherein the directory switching request includes the command word; perform corresponding file operations on the files in the target file system; and send the results of the file operation to the FTP client so that the FTP client displays the content of the file operation.

[0086] The embedded file system module 603 is configured to store embedded system files and files after file operations.

[0087] According to the technical solution provided in the embodiment of the present application, the interactive device 600 of the embedded file sends instructions to the FTP server module 602 through the FTP client module 601. The FTP server module 602 performs corresponding file operations in response to the above instructions and sends the operation results to the FTP client module 601, so that the FTP client displays the content of the file operation.

[0088] The embodiment of the present application realizes the FTP server function in the embedded system, deploys the FTP server in the embedded operating system, completes the switching of different file systems inside the embedded system, and calls the corresponding embedded file system interface according to the command word of the FTP client to realize the user's upload, download, rename, delete and other operations on the embedded file system file. The user can connect to the embedded system FTP server through the FTP client to realize the operations such as viewing (downloading), deleting and modifying (uploading) the files in the embedded file system. If a certain file is abnormal during the operation of the system and causes the system operation failure, the file content can be quickly modified and the normal operation of the system can be restored. The problem that the current embedded file system in the prior art only supports the interface call of the application layer, has no visual operation interface, and the user cannot view the file content and the use of the file system during the operation process, which is not conducive to the debugging of the device and the monitoring of the operation status of the device is solved.

[0089] Figure 7 Schematic diagram of an electronic device 7 provided in an embodiment of the present application. Figure 7As shown, the electronic device 7 of this embodiment includes: a processor 701, a memory 702, and a computer program 703 stored in the memory 702 and executable on the processor 701. When the processor 701 executes the computer program 703, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor 701 executes the computer program 703, the functions of the modules / units in the above-mentioned device embodiments are implemented.

[0090] The electronic device 7 may be a desktop computer, a notebook, a PDA, a cloud server, or other electronic device. The electronic device 7 may include, but is not limited to, a processor 701 and a memory 702. Those skilled in the art will appreciate that Figure 7 The electronic device 7 is merely an example and does not limit the electronic device 7 , and may include more or less components than those shown in the figure, or different components.

[0091] The processor 701 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0092] The memory 702 may be an internal storage unit of the electronic device 7, for example, a hard disk or memory of the electronic device 7. The memory 702 may also be an external storage device of the electronic device 7, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 7. The memory 702 may also include both an internal storage unit of the electronic device 7 and an external storage device. The memory 702 is used to store computer programs and other programs and data required by the electronic device.

[0093] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.

[0094] If the integrated module / 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 readable storage medium (e.g., a computer-readable storage medium). Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. The computer program may include computer program code, which may be in source code form, object code form, executable file or some intermediate form. Computer-readable storage media may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.

[0095] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. An embedded file interaction method, applied to an embedded system, wherein the embedded system includes an FTP server and at least one file system, characterized in that: The method comprises: Receiving, by the FTP server, a directory switching request sent by the FTP client; Parsing a command word from the directory switching request, and switching a target file system according to the command word; Performing corresponding file operations on files in the target file system; The result of the file operation is sent to the FTP client, so that the FTP client displays the content of the file operation.

2. The method according to claim 1, characterized in that Before the FTP server receives the directory switching request sent by the FTP client, the method further includes: Receiving, through the FTP server, a connection request sent by the FTP client; According to the connection request, the FTP server sends a response message to the FTP client and establishes a connection with the FTP client.

3. The method according to claim 1, characterized in that The step of parsing a command word from the directory switching request and switching the target file system according to the command word comprises: Parsing the command word in the directory switching request, and determining the target file system to be switched according to the command word; According to the target file system to be switched, calling the interface corresponding to the target file system; Switch to the target file system through the interface.

4. The method according to claim 3, characterized in that: The performing corresponding file operations on the files in the target file system comprises: Get the operation instructions sent by the FTP client; According to the operation instruction, a corresponding file operation is performed on the to-be-processed file in the target file system.

5. The method according to claim 4, characterized in that After performing corresponding file operations on the files in the target file system, the method further includes: Receiving, through the FTP server, a file download request sent by the FTP client; According to the file download request, obtaining the to-be-processed file in the target file system, and sending the file to the FTP client, so that the FTP client downloads the file and processes the file accordingly; The processed file sent by the FTP client is received through the FTP server.

6. The method according to claim 2, characterized in that After the FTP server sends a response message to the FTP client according to the connection request and establishes a connection with the FTP client, the method further includes: If the FTP client is connected for the first time, sending the root directories of each file system of the embedded operating system to the FTP client; After switching to the target file system, the root directory of the target file system is sent to the FTP client.

7. The method according to any one of claims 1 to 6, characterized in that The file operations include: Create files, read and write files, upload files, download files, close files, rename files, and delete files.

8. An embedded operating system, characterized in that: include: An FTP server, wherein when executing instructions, the FTP server implements the steps of the method as claimed in any one of claims 1 to 7.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.