Multi-node communication software framework based on TCP (Transmission Control Protocol) and UDP (User Datagram Protocol)

By designing a multi-node software framework based on TCP protocol and UDP protocol, the problem of resource management and communication optimization in large-scale multi-node embedded software is solved, efficient resource management and communication optimization are achieved, and the maintainability and reliability of the software are improved. Scalability.

CN119363850AActive Publication Date: 2025-01-24NORTHWEST ELECTROMECHANICAL ENG RES INST
View PDF 3 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In the design of large multi-node embedded software, it is difficult for the existing technology to achieve efficient resource management and communication optimization, resulting in waste of hardware resources and high coupling of project modules, affecting the maintainability and scalability of the software.

Method used

Design a multi -node software framework based on the TCP protocol and UDP protocol, including the resource scheduling layer, the data processing layer of the flow communication protocol, the project module layer, and the database storage layer. And use TCP and UDP protocols to optimize communication.

Benefits of technology

It has improved the maintenance and scalability of the software, reduced the waste of hardware resources and the coupling of the project module, and achieved efficient resource management and communication optimization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119363850A_ABST
    Figure CN119363850A_ABST
Patent Text Reader

Abstract

The invention discloses a multi-node communication software framework based on a TCP (Transmission Control Protocol) and a UDP (User Datagram Protocol), which comprises a resource scheduling layer, a streaming communication protocol data processing layer, a project module layer and a database storage layer, and is characterized in that the resource scheduling layer is used for interaction between the software framework and an embedded display control terminal system; public resources required by all project modules in the project module layer and interfaces for accessing the public resources with the project modules are packaged in the resource scheduling layer; each project module sends an application to the resource scheduling layer through the streaming communication protocol data processing layer to call public resources; each dynamic library of the project module uniquely corresponds to one business in the project of the application software; the streaming communication protocol data processing layer is used for providing different interfaces including TCP (Transmission Control Protocol) communication and UDP (User Datagram Protocol) communication for the resource scheduling layer, the project module layer and the database storage layer; and the streaming communication protocol data processing layer correspondingly classifies and processes data of different project modules in the project module layer.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of embedded software, and in particular relates to a multi-node software framework based on TCP protocol and UDP protocol. Background Art

[0002] In the design of large multi-node embedded software, the design of software for different nodes is often targeted at specific application scenarios. The selection and design of hardware directly affects the performance and efficiency of embedded software. The rational and efficient application of hardware resources is an effective means of embedded software design and optimization. It can load relevant functional modules according to different business needs, manage multiple embedded project modules in a unified manner, and select the corresponding transmission method according to different information transmission requirements. It can effectively reduce the waste of embedded hardware resources, reduce the coupling between project modules, and improve the utilization rate of communication resources. Especially when the hardware device processor and memory resources have been designed and finalized and are difficult to change, the tailorability of embedded software is very important. Embedded application software with weak tailorability is difficult to upgrade and optimize, which often consumes more energy of developers. This is particularly obvious in immature operating systems. When developing, using a reasonable embedded software architecture can efficiently change and optimize the entire embedded software project when the project requirements change, reducing the use of manpower and material resources. With a stable database storage function, it can not only store important information in the project application process, but also retain important setting parameters when the entire application software is updated or started. Summary of the invention

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

[0004] In order to achieve the above tasks, the present invention adopts the following technical solutions:

[0005] A multi-node communication software framework based on TCP protocol and UDP protocol, including resource scheduling layer, streaming communication protocol data processing layer, project module layer and 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 and the interface for accessing common resources with each project module; initializes the dynamic library of each project module and provides the interface implementation for resource calling 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 an application to the resource scheduling layer through the streaming communication protocol data processing layer to call public resources; the project module contains dynamic libraries, each of which is unique to a business 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, the project module layer, and the 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 receipt, forwarding, and temporary storage;

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

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

[0011] Furthermore, the project module 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, wherein the UDP communication module is responsible for providing data protocol parsing services for the instruction communication data streams of the resource scheduling layer and the project module layer, and decomposing, classifying and parsing the control instructions of different functions of different project modules, so as to achieve rapid response of control commands of each project module and complete 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 the transmission of file-type data. Each project module can utilize the control instruction transmission of the UDP communication module to complete the transmission of file-type data under the TCP communication channel, thereby realizing the TCP stable transmission mechanism of file-type data.

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

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

[0015] A method for designing a multi-node communication software framework based on TCP protocol and UDP protocol, which is applicable to application software running on a display and control terminal; the method comprises:

[0016] Step S100, after confirming the system environment of the display and control terminal where the application software is deployed, establish an initial resource scheduling layer in the development environment of the application software, and before establishing the resource scheduling layer, clarify the software development tools that are compatible with the current development environment, and confirm whether the development environment and software development tools can provide the resource conditions for building the current application software framework, including but not limited to the required public resource access interface and the function encapsulation corresponding to different functions;

[0017] Step S101, building a UI interactive interface of the resource scheduling layer according to the project requirements of the application software;

[0018] Step S102, the resource scheduling layer loads the plug-in corresponding to the project module and establishes communication between the project module 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 receiving port corresponding to the UDP communication; by using the UDP unicast mode to report information to the resource scheduling layer, the information sent by the resource scheduling layer is received by unicast or broadcast; when processing file data, the TCP communication mode is adopted, the resource scheduling layer acts as the server of the TCP communication, and agrees on the communication address with the dynamic library of the project module as the client, establishes a TCP connection, and triggers the file transfer under the TCP mode by receiving the real-time UDP data signal;

[0020] Step S104, after the streaming communication protocol data processing layer classifies the data, the user can select the required data information according to the protocol for storage in the database storage layer; select the 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 data in the corresponding protocol data, and add, delete, modify and query different data tables according to the instructions.

[0021] Furthermore, the resource scheduling layer loads plug-ins through a pre-compiled dynamic so library, and uses the TCP protocol and the UDP protocol to interact with the so dynamic library for data.

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

[0023] The present invention divides the software framework into levels with a clear division method and clear definition of the functions of each level, thus achieving the goal of low coupling of the overall software architecture, greatly improving the later maintainability and extensibility of the software, and is a highly reusable architecture design. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0025] Explanation of the numbers in the figure: 100 - resource scheduling layer; 200 - project module layer; 210 - project module; 300 - streaming communication protocol data processing layer; 400 - database storage layer. DETAILED DESCRIPTION

[0026] See attached Figure 1 The present invention provides a multi-node communication software framework based on TCP protocol and UDP protocol, 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 add-on of the entire software framework, which 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; initializes the dynamic library of each project module 210 and provides interface implementation for resource calling and communication; the resource scheduling layer 100 has the highest level of reference authority and can schedule all resources in the software framework.

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

[0030] 2. Project module layer 200

[0031] 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 an application to the resource scheduling layer 100 through the streaming communication protocol data processing layer 300 to call public resources.

[0032] The project module 210 includes dynamic libraries, each of which is unique to a business in the application software project; there is no reference relationship between the project modules 210.

[0033] 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 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 classifies and processes the data of different project modules 210 in the project module layer 200 accordingly, including receipt, forwarding, temporary storage, etc.

[0036] The streaming communication protocol data processing layer 300 includes a UDP communication module and a TCP communication module, wherein 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, and decomposing, classifying and parsing the control instructions of different functions of different project modules 210, so as to achieve rapid response of control commands of each project module 210 and complete 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 pictures and XML. Each project module 210 can utilize the control instruction transmission of the UDP communication module to complete the transmission of files such as pictures and XML files under the TCP communication channel, thereby realizing the TCP stable transmission mechanism for file-type data.

[0037] 4. Database storage layer 400

[0038] When the project module layer 200 receives a specific data message through the interface in the streaming communication protocol data processing layer 300, the database storage layer 400 uses a specific SQL statement to complete the classified storage of different messages according to the set communication protocol content; the content deletion operation of the database storage layer 400 can only be carried out through the corresponding deletion control instruction from the resource scheduling layer 100. The resource scheduling layer 100 can complete the reading and deletion operations of historical information by calling the corresponding storage data.

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

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

[0041] The embodiment of the present invention also provides a multi-node communication software framework design method based on TCP protocol and UDP protocol, which is 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, the initial resource scheduling layer 100 is established in the development environment of the application software. Before establishing the resource scheduling layer 100, the corresponding 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 building the current application software framework, including but not limited to the required access interface of the public resources, function encapsulation corresponding to different functions, etc.

[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 scenario of the call can be more clearly confirmed, and a more intuitive bridge between the design and the requirements can be established, thereby improving the subsequent design efficiency.

[0044] Step S102, after the UI interaction interface is built, the resource scheduling layer 100 loads the plug-in corresponding to the project module 210 and establishes communication between the project module 210 and the resource scheduling layer 100; after all, for the software framework, the communication between the plug-in and the framework is a prerequisite for being able to call and use different project modules 210, and the basis of this function is that the resource scheduling layer 100 can load plug-ins.

[0045] In this solution, the resource scheduling layer 100 loads plug-ins through a pre-compiled dynamic so library. This form of library file supports use on multiple operating systems, provides convenience for development and compilation, improves the cross-platform compatibility of the entire project, and can use TCP protocol and UDP protocol to interact with the so dynamic library for data.

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

[0047] 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 in 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 multiple embedded devices to carry out instant communication. When making corresponding designs according to the communication requirements of the project module 210, information is reported to the resource scheduling layer 100 by using the UDP unicast mode, and the information sent by the resource scheduling layer 100 is received by unicast or broadcast. The TCP communication mode transmits data stably, but is not as flexible as the UDP communication mode. The TCP communication mode is adopted when processing data such as pictures and XML files. The resource scheduling layer 100, as the server of TCP communication, agrees on the communication address with the dynamic library of the project module 210, which is the client, establishes a TCP connection, and triggers the file transfer in the TCP mode by receiving the real-time UDP data signal.

[0048] Step S104, after the streaming communication protocol data processing layer 300 classifies the data, the user can select the required data information according to the protocol for storage under the database storage layer 400. Lightweight database storage can meet the application of many embedded devices. In this framework, the SQLite database is selected as the database storage layer 400 for storage because the database has lightweight characteristics, and the read and write efficiency is about 35% faster than file operations, and the database has certain scalability. The resource scheduling layer 100 and the streaming communication protocol data processing layer 300 use SQL statements to store data in the corresponding protocol data, and add, delete, modify and check different data tables according to the instructions; since the construction of this software framework is completed, the developer can add project modules according to project needs.

[0049] 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. A multi-node communication software framework based on TCP protocol and UDP protocol, 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 the common resources with each project module; 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 an application 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 a business in the project of the application software; 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) classifies and processes the data of different project modules (210) in the project module layer (200) accordingly, including receipt, forwarding, and temporary storage; When the project module layer (200) receives a specific data message through the interface in the streaming communication protocol data processing layer (300), the database storage layer (400) completes classified storage of different messages according to the set communication protocol content.

2. The multi-node communication software framework based on TCP protocol and UDP protocol according to claim 1 is characterized in that: The resource scheduling layer (100) has a UI interactive interface, which is used to realize the 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 protocol and UDP protocol 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 protocol and UDP protocol 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, wherein 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), decomposing, classifying and parsing the control instructions of different functions of different project modules (210), realizing rapid response of control commands of each project module (210), and completing the business function implementation of each project module (210); the TCP communication module provides a channel for file-type data transmission based on the control instructions received by the UDP communication module, and each project module (210) can use the control instruction transmission of the UDP communication module to complete the transmission of file-type data under the TCP communication channel, thereby realizing a TCP stable transmission mechanism for file-type data.

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

6. The multi-node communication software framework based on TCP protocol and UDP protocol 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 hierarchical relationships of different levels; the resource scheduling layer (100) is higher in level than the streaming communication protocol data processing layer (300) and the project module layer (200), and the project module layer (200) is higher in level than the streaming communication protocol data processing layer (300); a higher level can call resources in a lower level.

7. A method for designing a multi-node communication software framework based on TCP protocol and UDP protocol, suitable for application software running on a display and control terminal; characterized in that: The method comprises: 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 software development tools that are compatible with the current development environment are identified, and it is confirmed whether the development environment and the software development tools can provide the resource conditions for building the current application software framework, including but not limited to the required public resource access interface and the function encapsulation corresponding to different functions; Step S101, building the UI interaction interface of the resource scheduling layer (100) according to the project requirements of the application software; Step S102, the resource scheduling layer (100) loads the plug-in corresponding to the project module (210) and establishes communication between the project module (210) and the resource scheduling layer (100); Step S103, the UDP communication used in the streaming communication protocol data processing layer (300) has unicast, broadcast and multicast modes; the project module (210) sets the receiving port corresponding to the UDP communication when receiving communication data; the information is reported to the resource scheduling layer (100) by using the UDP unicast mode, and the information sent by the resource scheduling layer (100) is received by unicast or broadcast; when processing file-type data, the TCP communication mode is adopted, and the resource scheduling layer (100) acts as the server of the TCP communication, agrees on the communication address with the dynamic library of the project module (210) as the client, establishes a TCP connection, and triggers the file transmission under the TCP mode by receiving the real-time UDP data signal; Step S104, after the streaming communication protocol data processing layer (300) classifies the data, the user can select the required data information according to the protocol for storage in the database storage layer (400); select the 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 data in the corresponding protocol data, and perform addition, deletion, modification and query of different data tables according to the instructions.

8. The method for designing a multi-node communication software framework based on TCP protocol and UDP protocol according to claim 7, characterized in that: The resource scheduling layer (100) loads the plug-in through a pre-compiled dynamic so library, and uses the TCP protocol and the UDP protocol to perform data interaction operations with the so dynamic library.

Citation Information

Patent Citations

  • Implementation system and method for streaming communication data protocol parsing software framework

    CN108400992A

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

    CN112202745A

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

    US20200234241A1