Embedded communication port ram file system interaction method and device, equipment and medium
Patent Information
- Application Number
- CN202610792388.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-03
- Publication Date
- 2026-08-28
AI Technical Summary
[0004]本发明的目的在于提供一种嵌入式通信端口Ram文件系统交互方法、装置、设备及介质,解决了现有技术软件耦合、资源浪费、管理混乱、扩展性差等问题
[0024] This invention provides an embedded communication port Ram file system interaction method, apparatus, device, and medium, which enables independent development, operation, and storage of communication software on each port, solving the intertwining problem between different software and achieving decoupling; a common resident software can run the communication software on a certain port according to the port access situation; the operation and management of each communication software relies solely on the common resident software for startup; the external data parsing interface API of each communication software is flexibly implemented by registering callback functions; and the data flow management between the various communication software is completed by the common resident software.
Smart Images

Figure CN122654041A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of embedded system communication port management technology, specifically to an embedded communication port Ram file system interaction method, apparatus, device, and medium. Background Technology
[0002] Embedded software primarily runs within embedded systems, serving these systems. It emphasizes the coordination between external hardware and devices, highlighting the synergy, integrity, and customizability of hardware and software to meet specific needs. Embedded software systems typically interact with the outside world via communication ports. As the integration of embedded systems increases, the density and complexity of their communication ports become increasingly apparent, including serial ports, Ethernet ports, optical ports, CAN buses, SPI buses, 1553B buses, IIC buses, and more. This mix of port types and sheer numbers leads to complex data interconnections at different levels, both between different ports and between the same ports, during the port driver software implementation. Therefore, for embedded software implementing highly complex communication ports, decoupling between communication ports and managing complex communication port data flows becomes increasingly important. This aligns with the significant requirements for synergy and customizability between the hardware and software of the entire embedded system.
[0003] When implementing existing embedded complex port software, issues arise such as the lack of independence and severe intertwining between different software components; even when a port is not connected, the port driver software must be initialized first, consuming CPU resources; each port software manages its external communication ports differently, making unified management impossible; and the conventional approach is to implement each port software in a single C file, resulting in poor scalability. Summary of the Invention
[0004] The purpose of this invention is to provide an embedded communication port Ram file system interaction method, device, equipment and medium, which solves the problems of software coupling, resource waste, chaotic management and poor scalability in the prior art.
[0005] This invention is achieved through the following technical solution:
[0006] In a first aspect, an embedded communication port Ram file system interaction method provided by embodiments of the present invention includes:
[0007] The common resident software runs on DDR after the embedded device starts up and monitors the access status of external communication ports in real time;
[0008] When the common resident software detects any external communication port access, it calls the Ram file system creation function to create the file system;
[0009] Write the image file of the corresponding port communication software into the Ram file system according to the dynamic module file format;
[0010] Common resident software loads the image file written to the Ram file system onto the DDR;
[0011] The common resident software creates a communication software script file by calling the Ram file system, and writes the running script of the corresponding port communication software into the script file;
[0012] Common resident software starts the corresponding port communication software by calling the script file to run functions.
[0013] Furthermore, it also includes: when the port communication software starts up and runs, it registers the data receiving interface function through a callback registration function to complete the data interaction with the common resident software.
[0014] Furthermore, the port communication software includes one or more of the following: serial port communication software, network port communication software, CAN port communication software, SPI port communication software, 1553B interface communication software, IIC communication software, and optical port communication software.
[0015] Furthermore, the port communication software is independently developed under the embedded framework based on the dynamic module project template, and the communication software running port API is determined. The common resident software is the dynamic module project.
[0016] Secondly, another embodiment of the present invention provides an embedded communication port Ram file system interaction device for implementing the method described in the first embodiment above, comprising: a common resident module and multiple port communication modules, wherein the common resident module is used to monitor the access status of external communication ports in real time, manage and schedule the data flow of each communication port, define the data input and output interface functions of each communication port, and define callback functions and callback registration functions, and when any port communication module is detected to be connected, a start-up command is sent to the corresponding port communication module;
[0017] The port communication module starts running according to the start-up command.
[0018] Furthermore, when the port communication module starts up and runs, it registers the data receiving interface function through a callback registration function to complete the data interaction with the common resident module.
[0019] Furthermore, the port communication module includes one or more of the following: serial communication module, network communication module, CAN communication module, SPI communication module, 1553B interface communication module, IIC communication module, and optical communication module.
[0020] Furthermore, the port communication module is a dynamic module, and the common resident module is a dynamic module.
[0021] Thirdly, another embodiment of the present invention provides an electronic device comprising: a processor, an input device, an output device, and a memory, wherein the processor, the input device, the output device, and the memory are interconnected, the memory is used to store a computer program, the computer program includes program instructions, and the processor is configured to invoke the program instructions to execute the method described in the first embodiment above.
[0022] Fourthly, another embodiment of the present invention provides a computer-readable storage medium storing a computer program, the computer program including program instructions that, when executed by a processor, cause the processor to perform the method described in the first embodiment above.
[0023] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0024] This invention provides an embedded communication port Ram file system interaction method, apparatus, device, and medium, which enables independent development, operation, and storage of communication software on each port, solving the intertwining problem between different software and achieving decoupling; a common resident software can run the communication software on a certain port according to the port access situation; the operation and management of each communication software relies solely on the common resident software for startup; the external data parsing interface API of each communication software is flexibly implemented by registering callback functions; and the data flow management between the various communication software is completed by the common resident software. Attached Figure Description
[0025] To more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly described below. It should be understood that the following drawings only show some embodiments of the present invention and should not be considered as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort. In the drawings:
[0026] Figure 1 A flowchart illustrating an embedded communication port Ram file system interaction method provided in the first embodiment of the present invention;
[0027] Figure 2 This is a schematic diagram of an embedded communication port Ram file system interaction method provided in the first embodiment of the present invention;
[0028] Figure 3 This is a schematic diagram of an embedded communication port Ram file system interaction device provided in another embodiment of the present invention. Detailed Implementation
[0029] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the embodiments and accompanying drawings. The illustrative embodiments and descriptions of the present invention are only used to explain the present invention and are not intended to limit the present invention.
[0030] like Figure 1 As shown, the first embodiment of the present invention provides an embedded communication port Ram file system interaction method, which includes the following steps:
[0031] The common resident software runs on DDR after the embedded device starts up and monitors the access status of external communication ports in real time;
[0032] When the common resident software detects any external communication port access, it calls the Ram file system creation function to create the file system;
[0033] Write the image file of the corresponding port communication software into the Ram file system according to the dynamic module file format;
[0034] Common resident software loads the image file written to the Ram file system onto the DDR;
[0035] The common resident software creates a communication software script file by calling the Ram file system, and writes the running script of the corresponding port communication software into the script file;
[0036] Common resident software starts the corresponding port communication software by calling the script file to run functions.
[0037] Among them, the common resident software is a dynamic module project that can run independently on embedded hardware DDR. After running, it can monitor the access status of external communication ports in real time, manage and schedule the data flow of each communication port, define the data input and output interface functions of each communication port, and define callback functions and callback registration functions for use when the communication software of each port starts.
[0038] The port communication software includes one or more of the following: serial port communication software, network port communication software, CAN port communication software, SPI port communication software, 1553B interface communication software, IIC communication software, and optical port communication software. In this embodiment, the serial port 1 communication software, serial port 2 communication software, network port 1 communication software, network port 2 communication software, CAN port communication software, SPI port communication software, 1553B interface communication software, IIC communication software, and optical port communication software are all embedded dynamic module projects. They are independently developed within the embedded framework based on dynamic module project templates. Only the communication software's running port API needs to be specified. After the device starts, the image files of each communication software are cached on the embedded hardware DDR. Each communication port software is a dynamic module project, with independent storage, independent port detection, and independent startup and operation relying on common resident software.
[0039] The embedded communication port Ram file system interaction methods specifically include:
[0040] After the device is powered on, the common resident software runs in DDR. When it detects that network port 1 is connected, the common resident software calls the Ram file system creation function to create a file system and writes the network port 1 communication software image file into the Ram file system according to the dynamic module file format.
[0041] The common resident software then loads the network interface 1 communication software image file, which is written to the Ram file system, onto the DDR according to the dynamic module file format;
[0042] The common resident software creates a script file by calling the Ram file system, and writes the network interface 1 communication software execution script into the created script file;
[0043] Common resident software completes the startup and operation of port communication software by calling the script file to run functions.
[0044] When the network port 1 communication software starts up and runs, it uses a callback registration function to register the data receiving interface function in order to complete the data interaction function with the common resident software.
[0045] In this embodiment, the common resident software monitors the hardware access status of the communication port in real time and completes the execution of a certain communication software. The port communication software can be arbitrarily developed within the embedded framework according to the dynamic module project template; it only needs to specify the API of the communication software running the port. After the common resident software detects that an external communication port is connected to the embedded device, it runs the corresponding port's communication software on the DDR by calling the Ram file system. The port communication software communicates with the common resident software using only the general input / output functions constrained by the common resident software, completing the interconnection and interaction of various communication port software. The communication software data parsing API is flexibly implemented using callback functions; the number of communication software can be increased in real time according to the number of hardware ports.
[0046] In another embodiment, the common resident software simultaneously detects access to serial port 2, the CAN port, and the 1553B interface. The common resident software creates a Ram file system for each port, loads the image file written to the Ram file system onto the DDR, and creates a communication software script file by calling the Ram file system, writing the execution scripts for the communication software of serial port 2, the CAN port, and the 1553B interface into the script file. The common resident software starts the communication software of serial port 2, the CAN port, and the 1553B interface by calling the execution function of the script file. Each port runs independently, and data is uploaded to the common resident software through a callback interface, where routing and scheduling are handled, achieving parallel and decoupled interaction across multiple ports.
[0047] This invention provides an embedded communication port Ram file system interaction method, which enables independent development, execution, and storage of communication software on each port, resolving the intertwining issues between different software and achieving decoupling. A common resident software can run the communication software on a specific port based on port access conditions; the operation and management of each communication software relies solely on the common resident software for startup; the external data parsing interface APIs of each communication software are flexibly implemented through registered callback functions; and data flow management between the various communication software programs is handled by the common resident software. This method is applicable to various embedded software application environments such as radar, communication, and countermeasures.
[0048] like Figure 3 As shown, another embodiment of the present invention provides an embedded communication port Ram file system interaction device, comprising: a common resident module and multiple port communication modules. The common resident module stores common resident software. The common resident module is used to monitor the access status of external communication ports in real time, manage and schedule the data flow of each communication port, define the data input / output interface functions of each communication port, and define callback functions and callback registration functions. When any port communication module is detected to be connected, a start-up command is sent to the corresponding port communication module. The port communication modules store port communication software and start running according to the start-up command.
[0049] In this embodiment, when the port communication module starts running, it registers the data receiving interface function through a callback registration function to complete data interaction with the common resident module. Both the port communication module and the common resident module are dynamic modules.
[0050] In this embodiment, the port communication module includes one or more of the following: serial port communication module, network port communication module, CAN port communication module, SPI port communication module, 1553B interface communication module, IIC communication module, and optical port communication module.
[0051] In this embodiment, the device also includes a software processor, peripheral clock, power supply, and memory. The software processor includes a Field-Programmable Gate Array (FPGA) or a Digital Signal Processor (DSP). As the main implementation chip of the embedded multi-functional system, the performance of the FPGA / DSP directly affects the system's functionality. To enable different port communication software to run on the same processor, the software processor requires a significant amount of DDR cache during function implementation, thus necessitating certain resource requirements. The appropriate processor can be selected based on actual needs. The peripheral clock and power supply are used to power the chips on the board, provide system clock output, reset output, dedicated clock output for each communication interface, communication interface adapter circuits, and peripheral data interaction circuits. The memory includes non-volatile FLASH memory and dynamic random access memory (SDRAM). FLASH memory stores common resident software and communication software files for each port, and is retained even after power failure. SDRAM is used to run and cache common resident software and communication software files for each port; the program disappears after system power failure.
[0052] The execution process of each module can be carried out according to the steps of the embedded communication port Ram file system interaction method provided in the first embodiment, and will not be described in detail in this embodiment.
[0053] The embedded communication port Ram file system interaction device and the embedded communication port Ram file system interaction method provided in this embodiment of the invention are based on the same inventive concept and have the same beneficial effects, and will not be described again here.
[0054] Another embodiment of the present invention provides an electronic device, which includes a processor, an input device, an output device, and a memory. The processor, the input device, the output device, and the memory are interconnected. The memory is used to store a computer program, which includes program instructions. The processor is configured to call the program instructions to execute the method described in the first embodiment above.
[0055] It should be understood that, in the embodiments of the present invention, the processor may be a Central Processing Unit (CPU), but it may also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0056] Input devices may include touchpads, microphones, etc., and output devices may include displays (LCDs, etc.), speakers, etc.
[0057] The memory may include read-only memory and random access memory, and provides instructions and data to the processor. A portion of the memory may also include non-volatile random access memory. For example, the memory may also store information about the device type.
[0058] In specific implementations, the processor, input device, and output device described in the embodiments of the present invention can execute the implementation of the method embodiments described in the embodiments of the present invention, or they can execute the implementation of the system embodiments described in the embodiments of the present invention, which will not be repeated here.
[0059] The present invention also provides an embodiment of a computer-readable storage medium storing a computer program, the computer program including program instructions, which, when executed by a processor, cause the processor to perform the method described in the first embodiment above.
[0060] The computer-readable storage medium can be an internal storage unit of the terminal described in the foregoing embodiments, such as the terminal's hard drive or memory. The computer-readable storage medium can also be an external storage device of the terminal, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the terminal. Furthermore, the computer-readable storage medium can include both internal storage units and external storage devices of the terminal. The computer-readable storage medium is used to store the computer program and other programs and data required by the terminal. The computer-readable storage medium can also be used to temporarily store data that has been output or will be output.
[0061] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0062] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the terminal and unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0063] In the several embodiments provided in this application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices or units, or may be electrical, mechanical or other forms of connection.
[0064] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention, and they should all be covered within the scope of the claims and specification of the present invention.
Claims
1. A method for interacting with an embedded communication port's Ram file system, characterized in that, include: The common resident software runs on DDR after the embedded device starts up and monitors the access status of external communication ports in real time; When the common resident software detects any external communication port access, it calls the Ram file system creation function to create the file system; Write the image file of the corresponding port communication software into the Ram file system according to the dynamic module file format; Common resident software loads the image file written to the Ram file system onto the DDR; The common resident software creates a communication software script file by calling the Ram file system, and writes the running script of the corresponding port communication software into the script file; Common resident software starts the corresponding port communication software by calling the script file to run functions.
2. The embedded communication port Ram file system interaction method according to claim 1, characterized in that, Also includes: When the port communication software starts up and runs, it registers the data receiving interface function through a callback registration function to complete the data interaction with the common resident software.
3. The embedded communication port Ram file system interaction method according to claim 1, characterized in that, The port communication software includes one or more of the following: serial port communication software, network port communication software, CAN port communication software, SPI port communication software, 1553B interface communication software, IIC communication software, and optical port communication software.
4. The embedded communication port Ram file system interaction method according to claim 3, characterized in that, The port communication software is independently developed under the embedded framework based on the dynamic module project template, and the communication software runs on the API port. The common resident software is the dynamic module project.
5. An embedded communication port Ram file system interaction device, characterized in that, To implement the method as described in claim 1, the method includes: a common resident module and multiple port communication modules. The common resident module is used to monitor the access status of external communication ports in real time, manage and schedule the data flow of each communication port, define the data input and output interface functions of each communication port, and define callback functions and callback registration functions. When any port communication module is detected to be connected, a start-up command is sent to the corresponding port communication module. The port communication module starts running according to the start-up command.
6. The embedded communication port Ram file system interaction device according to claim 5, characterized in that, When the port communication module starts up, it registers the data receiving interface function through a callback registration function to complete the data interaction with the common resident module.
7. The embedded communication port Ram file system interaction device according to claim 5, characterized in that, The port communication module includes one or more of the following: serial communication module, network communication module, CAN communication module, SPI communication module, 1553B interface communication module, IIC communication module, and optical communication module.
8. The embedded communication port Ram file system interaction device according to claim 5, characterized in that, The port communication module is a dynamic module, and the common resident module is a dynamic module.
9. An electronic device, comprising: The processor, input device, output device, and memory are interconnected, the memory being used to store a computer program, the computer program including program instructions, characterized in that the processor is configured to invoke the program instructions to perform the method as described in any one of claims 1-4.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program including program instructions that, when executed by a processor, cause the processor to perform the method as described in any one of claims 1-4.