A multi-node communication software framework based on TCP and UDP protocols

By adopting a multi-node communication software framework based on TCP and UDP protocols, with layered design and modular communication mechanism, the problems of low resource utilization and high coupling in large-scale embedded software are solved, achieving efficient software maintenance and scalability, and is suitable for embedded applications of display and control terminals.

CN119363850BActive Publication Date: 2025-10-28NORTHWEST ELECTROMECHANICAL ENG RES INST
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411515722.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-29
Publication Date
2025-10-28
Estimated Expiration
2044-10-29

AI Technical Summary

Technical Problem

In large-scale multi-node embedded software design, existing technologies struggle to achieve efficient resource utilization and low coupling, resulting in significant manpower and material costs for software upgrades and optimizations. Furthermore, with fixed hardware resources, it is difficult to flexibly respond to changes in business requirements.

Method used

A multi-node communication software framework based on TCP and UDP protocols is adopted, with a layered design consisting of a resource scheduling layer, a streaming communication protocol data processing layer, a project module layer, and a database storage layer. The functions of each layer are clearly defined. The UDP communication module enables fast response and file transfer, the TCP communication module ensures stable transmission, and the SQLite database is used for data storage.

Benefits of technology

It improves the maintainability and scalability of the software, reduces the coupling between project modules, improves the utilization of communication resources, reduces development and optimization costs, and supports flexible changes in business requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119363850B_ABST
    Figure CN119363850B_ABST
Patent Text Reader

Abstract

This invention discloses a multi-node communication software framework based on TCP and UDP protocols, comprising a resource scheduling layer, a streaming communication protocol data processing layer, a project module layer, and a database storage layer. The resource scheduling layer is used for interaction between the software framework and the embedded display and control terminal system. It encapsulates the common resources required by all project modules in the project module layer, as well as interfaces for accessing these common resources. Each project module requests common resources from the resource scheduling layer through the streaming communication protocol data processing layer. Each project module's dynamic library uniquely corresponds to a business function within the application software project. The streaming communication protocol data processing layer provides different interface implementations, including TCP and UDP communication, for the resource scheduling layer, project module layer, and database storage layer. The streaming communication protocol data processing layer performs corresponding classification and processing on the data from different project modules in the project module layer.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of embedded software technology, specifically relating to a multi-node software framework based on TCP and UDP protocols. Background Technology

[0002] In large-scale, multi-node embedded software design, the software design of different nodes is often tailored to specific application scenarios. The selection and design of hardware directly affect the performance and efficiency of embedded software. Reasonable and efficient use of hardware resources is an effective means of embedded software design and optimization. Loading relevant functional modules according to different business needs, unified management of multiple embedded project modules, and selecting appropriate transmission methods based on different information transmission requirements can effectively reduce the waste of embedded hardware resources, lower the coupling between project modules, and improve the utilization rate of communication resources. Especially when hardware resources such as processors and memory are designed and difficult to change, the customizability of embedded software becomes crucial. Embedded application software with weak customizability is difficult to upgrade and optimize, often requiring more effort from developers. This is particularly evident in immature operating systems. Utilizing a reasonable embedded software architecture during development allows for efficient changes and optimizations of the entire embedded software project when project requirements change, reducing the use of manpower and resources. Coupled with stable database storage, it can not only store important information during project application but also retain important settings parameters during application software updates or startups. Summary of the Invention

[0003] The purpose of this invention is to provide a multi-node software framework based on TCP and UDP protocols to facilitate the development of large-scale embedded application software on control devices such as display and control terminals.

[0004] To achieve the above objectives, the present invention employs the following technical solution:

[0005] A multi-node communication software framework based on TCP and UDP protocols includes a resource scheduling layer, a streaming communication protocol data processing layer, a project module layer, and a database storage layer, wherein:

[0006] The resource scheduling layer is used for the interaction between the software framework and the embedded display and control terminal system. The resource scheduling layer encapsulates the common resources required by all project modules in the project module layer, as well as the interfaces for accessing common resources with each project module. It initializes the dynamic libraries of each project module and provides interface implementations for resource calls and communication.

[0007] The project module layer performs read-only operations through the streaming communication protocol data processing layer and the database storage layer; each project module sends a request to the resource scheduling layer through the streaming communication protocol data processing layer to call public resources; each project module contains a dynamic library, and each dynamic library is unique to a business function in the application software project;

[0008] The streaming communication protocol data processing layer provides different interface implementations, including TCP communication and UDP communication, for the resource scheduling layer, project module layer, and database storage layer; the streaming communication protocol data processing layer classifies and processes the data of different project modules in the project module layer, including receipts, forwarding, and temporary storage.

[0009] The database storage layer, when the project module layer receives specific data packets through the interface in the streaming communication protocol data processing layer, completes the classification and storage of different packets according to the set communication protocol content.

[0010] Furthermore, the resource scheduling layer has a UI interface, which enables the loading and data interaction of different project modules in the project module layer; and provides the display and storage functions of information in the project modules.

[0011] Furthermore, project modules in the project module layer can send a request to the resource scheduling layer through the streaming communication protocol data processing layer to switch the UI interaction interface to the corresponding project module.

[0012] Furthermore, the streaming communication protocol data processing layer includes a UDP communication module and a TCP communication module. The UDP communication module is responsible for providing data protocol parsing services for the instruction-type communication data streams of the resource scheduling layer and the project module layer. It decomposes, classifies, and parses control instructions for different functions of different project modules, enabling rapid response to control commands of each project module and completing the business function implementation of each project module. Based on the control instructions received by the UDP communication module, the TCP communication module provides a channel for file-type data transmission. Each project module can use the control instructions transmitted by the UDP communication module to complete the transmission of file-type data under the TCP communication channel, realizing a stable TCP transmission mechanism for file-type data.

[0013] Furthermore, content deletion operations in the database storage layer can only be performed through corresponding deletion control commands from the resource scheduling layer; the resource scheduling layer can complete the reading and deletion operations of historical information by calling the corresponding storage data.

[0014] Furthermore, the resource scheduling layer, the streaming communication protocol data processing layer, and the project module layer have different hierarchical levels; the resource scheduling layer is at a higher level than the streaming communication protocol data processing layer and the project module layer, and the project module layer is at a higher level than the streaming communication protocol data processing layer; higher levels can call resources in lower levels.

[0015] A design method for a multi-node communication software framework based on TCP and UDP protocols, suitable for application software running on a display and control terminal; the method includes:

[0016] Step S100: After confirming the system environment of the display and control terminal where the application software is deployed, an initial resource scheduling layer is established in the development environment of the application software. Before establishing the resource scheduling layer, the compatible software development tools in the current development environment are identified, and it is confirmed whether the development environment and software development tools can provide the resource conditions for the current application software framework, including but not limited to the access interfaces of the required public resources and the function encapsulation corresponding to different functions.

[0017] Step S101: Build the UI interface of the resource scheduling layer according to the project requirements of the application software;

[0018] Step S102: The resource scheduling layer loads the plugins corresponding to the project modules and establishes communication between the project modules and the resource scheduling layer.

[0019] Step S103: The UDP communication used in the streaming communication protocol data processing layer has unicast, broadcast, and multicast modes; when the project module receives communication data, it sets the corresponding UDP communication receiving port; it uses UDP unicast mode to report information to the resource scheduling layer, and receives information from the resource scheduling layer via unicast or broadcast; when processing file data, it uses TCP communication mode, with the resource scheduling layer acting as the TCP communication server, agreeing on a communication address with the dynamic library of the project module acting as the client, establishing a TCP connection, and triggering file transfer in TCP mode by receiving real-time UDP data signals;

[0020] In step S104, after the data is classified in the streaming communication protocol data processing layer, the user can select the required data information for storage in the database storage layer according to the protocol; select SQLite database as the database storage layer; the resource scheduling layer and the streaming communication protocol data processing layer use SQL statements to store the corresponding protocol data and perform CRUD operations on different data tables according to the instructions.

[0021] Furthermore, the resource scheduling layer loads plugins through pre-compiled dynamic .so libraries and uses TCP and UDP protocols to interact with the .so dynamic libraries.

[0022] Compared with the prior art, the present invention has the following technical features:

[0023] This invention divides the software framework into layers with a clear division method and a clear definition of the function of each layer. It achieves the goal of low coupling in the overall software architecture, greatly improves the maintainability and scalability of the software in the later stage, and is a highly reusable architecture design. Attached Figure Description

[0024] Figure 1 This is a schematic diagram of the communication software framework of the present invention.

[0025] The numbers in the diagram are explained as follows: 100 - Resource scheduling layer; 200 - Project module layer; 210 - Project module; 300 - Streaming communication protocol data processing layer; 400 - Database storage layer. Detailed Implementation

[0026] See appendix Figure 1 This invention provides a multi-node communication software framework based on TCP and UDP protocols, including a resource scheduling layer 100, a streaming communication protocol data processing layer 300, a project module layer 200, and a database storage layer 400, wherein:

[0027] 1. Resource scheduling layer 100

[0028] The resource scheduling layer 100 is the basic loading item of the entire software framework, used for the interaction between the software framework and the embedded display and control terminal system. The resource scheduling layer 100 encapsulates the common resources required by all project modules 210 in the project module layer 200, as well as the interfaces for accessing common resources with each project module. It initializes the dynamic libraries of each project module 210 and provides interface implementations for resource calls and communication. The resource scheduling layer 100 has the highest level of reference permissions and can schedule all resources in the software framework.

[0029] The resource scheduling layer 100 has a UI interface, which enables loading and data interaction of different project modules 210 in the project module layer 200; and provides display and storage functions for information in the project module 210.

[0030] 2. Project module layer 200

[0031] Project module layer 200 performs read-only operations through streaming communication protocol data processing layer 300 and database storage layer 400; each project module 210 sends a request to resource scheduling layer 100 through streaming communication protocol data processing layer 300 to call public resources.

[0032] Project module 210 contains dynamic libraries, each of which is unique to a business function within the application software project; there are no reference relationships between different project modules 210.

[0033] Project module 210 in project module layer 200 can send a request to resource scheduling layer 100 through streaming communication protocol data processing layer 300 to switch the UI interaction interface to the corresponding project module 210.

[0034] 3. Streaming Communication Protocol Data Processing Layer 300

[0035] The streaming communication protocol data processing layer 300 provides different interface implementations, including TCP communication and UDP communication, for the resource scheduling layer 100, the project module layer 200, and the database storage layer 400. The streaming communication protocol data processing layer 300 performs corresponding classification and processing on the data of different project modules 210 in the project module layer 200, including receipts, forwarding, and temporary storage.

[0036] The streaming communication protocol data processing layer 300 includes a UDP communication module and a TCP communication module. The UDP communication module is responsible for providing data protocol parsing services for the instruction-type communication data streams of the resource scheduling layer 100 and the project module layer 200. It decomposes, classifies, and parses control instructions for different functions of different project modules 210, enabling rapid response to control commands of each project module 210 and completing the business function implementation of each project module 210. Based on the control instructions received by the UDP communication module, the TCP communication module provides a channel for the transmission of files such as images and XML. Each project module 210 can use the control instructions transmitted by the UDP communication module to complete the transmission of files such as images and XML files under the TCP communication channel, realizing a stable TCP transmission mechanism for file-type data.

[0037] 4. Database storage layer 400

[0038] When the project module layer 200 receives specific data packets through the interface in the streaming communication protocol data processing layer 300, the database storage layer 400 uses specific SQL statements to classify and store different packets according to the pre-defined communication protocol. Deletion operations in the database storage layer 400 can only be performed via corresponding deletion control commands from the resource scheduling layer 100. The resource scheduling layer 100 can read and delete historical information by calling the corresponding stored data.

[0039] The resource scheduling layer 100, the streaming communication protocol data processing layer 300, and the project module layer 200 have different hierarchical levels; the resource scheduling layer 100 is at a higher level than the streaming communication protocol data processing layer 300 and the project module layer 200, and the project module layer 200 is at a higher level than the streaming communication protocol data processing layer 300; higher levels can call resources in lower levels.

[0040] The functional definitions of each software layer in this invention are clear and concise, which greatly improves the maintainability and scalability of the software in the later stages, and is a highly reusable software framework design.

[0041] This invention also provides a design method for a multi-node communication software framework based on TCP and UDP protocols, suitable for application software running on a display and control terminal; the method includes:

[0042] Step S100: After confirming the system environment of the display and control terminal where the application software is deployed, an initial resource scheduling layer 100 is established in the development environment of the application software. Before establishing the resource scheduling layer 100, the compatible software development tools in the current development environment are identified, and it is confirmed whether the development environment and software development tools can provide the resource conditions for the current application software framework, including but not limited to the access interfaces of the required public resources, and the function encapsulation corresponding to different functions.

[0043] Step S101, building a basic UI interaction interface according to the project requirements of the application software is the first step in establishing the resource scheduling layer 100. After the basic user interaction UI interface is built, the detailed scenarios of the call can be more clearly confirmed, a more intuitive bridge between design and requirements can be established, and the efficiency of subsequent design can be improved.

[0044] In step S102, after the UI interaction interface is built, the resource scheduling layer 100 loads the plugin corresponding to the project module 210 and establishes communication between the project module 210 and the resource scheduling layer 100. After all, for a software framework, communication between the plugin and the framework is a prerequisite for calling and using different project modules 210, and the basis of this function is that the resource scheduling layer 100 can load the plugin.

[0045] In this solution, the resource scheduling layer 100 loads plugins using a pre-compiled dynamic .so library. This type of library file supports use on multiple operating systems, providing convenience for development and compilation, improving the cross-platform compatibility of the entire project, and enabling data interaction with the .so dynamic library using TCP and UDP protocols.

[0046] After successfully loading and calling the dynamic .so library, the communication interface between the resource scheduling layer 100 and the project module layer 200 needs to be designed according to the data communication requirements of the dynamic library, which is the design of the streaming communication protocol data processing layer.

[0047] In step S103, the UDP communication used in the streaming communication protocol data processing layer 300 has unicast, broadcast, and multicast modes. Different processing is required for different communication modes. When the project module 210 receives communication data, the corresponding UDP communication receiving port can be set. Although UDP communication cannot guarantee the accuracy of data transmission, it is highly flexible and very suitable for real-time communication between multiple embedded devices. When designing according to the communication requirements of the project module 210, the UDP unicast mode is used to report information to the resource scheduling layer 100, and the information is received from the resource scheduling layer 100 through unicast or broadcast. The TCP communication mode transmits data stably, but it is not as flexible as the UDP communication mode. When processing data such as images and XML files, the TCP communication mode is used. The resource scheduling layer 100 acts as the TCP communication server, agrees on a communication address with the dynamic library of the project module 210 as the client, establishes a TCP connection, and triggers file transfer in TCP mode by receiving real-time UDP data signals.

[0048] In step S104, after the data is classified in the streaming communication protocol data processing layer 300, the user can select the required data information for storage in the database storage layer 400 according to the protocol. Lightweight database storage can meet the needs of many embedded device applications. In this framework, SQLite database is selected as the database storage layer 400 because it is lightweight, its read / write efficiency is about 35% faster than file operations, and it has a certain degree of scalability. The resource scheduling layer 100 and the streaming communication protocol data processing layer 300 use SQL statements to store the corresponding protocol data and perform CRUD operations on different data tables according to instructions. This completes the construction of the software framework. Developers can add project modules according to project needs.

[0049] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application 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 of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A multi-node communication software framework based on TCP and UDP protocols, characterized in that, It includes a resource scheduling layer (100), a streaming communication protocol data processing layer (300), a project module layer (200), and a database storage layer (400), wherein: The resource scheduling layer (100) is used for the interaction between the software framework and the embedded display and control terminal system; the resource scheduling layer (100) encapsulates the common resources required by all project modules (210) in the project module layer (200) and the interface for accessing common resources with each project module; it initializes the dynamic library of each project module (210) and provides the interface implementation for resource calling and communication; The project module layer (200) performs read-only operations through the streaming communication protocol data processing layer (300) and the database storage layer (400); each project module (210) sends a request to the resource scheduling layer (100) through the streaming communication protocol data processing layer (300) to call public resources; the project module (210) contains dynamic libraries, and each dynamic library is unique to one business of the application software project; The streaming communication protocol data processing layer (300) provides different interface implementations, including TCP communication and UDP communication, for the resource scheduling layer (100), project module layer (200), and database storage layer (400); the streaming communication protocol data processing layer (300) performs corresponding classification and processing on the data of different project modules (210) in the project module layer (200), including receipt, forwarding, and temporary storage; When the project module layer (200) receives specific data messages through the interface in the streaming communication protocol data processing layer (300), the database storage layer (400) completes the classification and storage of different messages according to the set communication protocol content.

2. The multi-node communication software framework based on TCP and UDP protocols according to claim 1, characterized in that, The resource scheduling layer (100) has a UI interface, which enables loading and data interaction of different project modules (210) in the project module layer (200); and provides display and storage functions for information in the project module (210).

3. The multi-node communication software framework based on TCP and UDP protocols according to claim 1, characterized in that, The project module (210) in the project module layer (200) can send a request to the resource scheduling layer (100) through the streaming communication protocol data processing layer (300) to switch the UI interaction interface to the corresponding project module (210).

4. The multi-node communication software framework based on TCP and UDP protocols according to claim 1, characterized in that, The streaming communication protocol data processing layer (300) includes a UDP communication module and a TCP communication module. The UDP communication module is responsible for providing data protocol parsing services for the instruction-type communication data streams of the resource scheduling layer (100) and the project module layer (200). It decomposes, classifies, and parses the control instructions for different functions of different project modules (210), realizes the rapid response of the control commands of each project module (210), and completes the business function implementation of each project module (210). Based on the control instructions received by the UDP communication module, the TCP communication module provides a channel for file data transmission. Each project module (210) can use the control instructions of the UDP communication module to transmit and complete the transmission of file data under the TCP communication channel, realizing a stable TCP transmission mechanism for file data.

5. The multi-node communication software framework based on TCP and UDP protocols according to claim 1, characterized in that, The deletion operation of the database storage layer (400) can only be performed through the corresponding deletion control command from the resource scheduling layer (100); the resource scheduling layer (100) can complete the reading and deletion operation of historical information by calling the corresponding storage data.

6. The multi-node communication software framework based on TCP and UDP protocols according to claim 1, characterized in that, The resource scheduling layer (100), the streaming communication protocol data processing layer (300), and the project module layer (200) have different hierarchical levels; the resource scheduling layer (100) is at a higher level than the streaming communication protocol data processing layer (300) and the project module layer (200), and the project module layer (200) is at a higher level than the streaming communication protocol data processing layer (300); higher levels can call resources in lower levels.

7. A design method for a multi-node communication software framework based on TCP and UDP protocols, suitable for application software running on a display and control terminal; characterized in that, The method includes: Step S100: After confirming the system environment of the display and control terminal deployed by the application software, an initial resource scheduling layer (100) is established in the development environment of the application software. Before establishing the resource scheduling layer (100), the software development tools that are compatible with the current development environment are identified, and it is confirmed whether the development environment and software development tools can provide the resource conditions for the current application software framework, including but not limited to the access interface of the required public resources and the function encapsulation corresponding to different functions. Step S101: Build the UI interface of the resource scheduling layer (100) according to the project requirements of the application software; In step S102, the resource scheduling layer (100) loads the plugin corresponding to the project module (210) and establishes communication between the project module (210) and the resource scheduling layer (100); In step S103, the UDP communication used in the streaming communication protocol data processing layer (300) has unicast, broadcast and multicast modes; when the project module (210) receives communication data, it sets the corresponding UDP communication receiving port; it reports information to the resource scheduling layer (100) by using the UDP unicast mode, and receives the information sent down by the resource scheduling layer (100) by unicast or broadcast; when processing file data, the TCP communication mode is used, the resource scheduling layer (100) acts as the TCP communication server, agrees on the communication address with the dynamic library of the project module (210) as the client, establishes a TCP connection, and triggers file transfer in TCP mode by receiving real-time UDP data signals; In step S104, after the data is classified in the streaming communication protocol data processing layer (300), the user can select the required data information to be stored in the database storage layer (400) according to the protocol; select SQLite database as the database storage layer (400); the resource scheduling layer (100) and the streaming communication protocol data processing layer (300) use SQL statements to store the corresponding protocol data, and perform addition, deletion, modification and query of different data tables according to the instructions.

8. The design method for a multi-node communication software framework based on TCP and UDP protocols according to claim 7, characterized in that, The resource scheduling layer (100) loads plugins through a pre-compiled dynamic SO library and uses TCP and UDP protocols to interact with the SO dynamic library.

Citation Information

Patent Citations

  • Streaming protocol development method, device and equipment and storage medium

    CN112202745A

  • Systems and Methods for Automated SDLC, Portfolio, Program and Project Management

    US20200234241A1