Multi-level communication method and system based on virtual interface and computer readable medium

Through the multi-level communication method based on virtual interfaces, the problem of poor cross-platform compatibility and inconsistent interfaces in inter-process communication of computer systems is solved, cross-platform and cross-host inter-process communication is realized, the development difficulty is reduced, and the construction for efficient multi-process applications.

CN118642867APending Publication Date: 2024-09-13BEIJING ZHONGKEHAIXUN DIGITAL S&T CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410683723.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-29
Publication Date
2024-09-13

AI Technical Summary

Technical Problem

Existing computer systems have problems such as poor cross-platform compatibility, inconsistent interfaces, high development difficulty, and low communication efficiency during inter-process communication, especially in inter-process communication between different system platforms.

Method used

Adopting a multi-level communication method based on virtual interfaces, by dividing the system or program into functional modules and defining virtual interfaces, communication between modules is achieved, cross-platform and cross-host communication is supported, and library functions are used to provide a unified interface, including life cycle Management, localized communication and cross-module communication interfaces use socket programming and TCP/UDP protocols at the bottom.

Benefits of technology

It realizes cross-platform inter-process communication, reduces development difficulty, provides a simple and consistent interface, supports inter-process communication between single host and multiple hosts, builds efficient multi-process applications, and has a small library file size. Easy to use.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118642867A
    Figure CN118642867A
Patent Text Reader

Abstract

The invention provides a multilevel communication method based on a virtual interface. The multilevel communication method comprises the following steps: dividing a system or a program into a plurality of functional modules for completing similar or related tasks; the library function defines a virtual interface of the module, and the virtual interface describes operations or functions which can be completed by using the library function; a user edits and defines each module according to own requirements, and communication among the modules is completed through a virtual interface to realize different logics. The final product of the method is a third-party library which is divided into version libraries of different systems, supports cross-platform, can realize inter-program communication in various operating systems, and reduces the development difficulty.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer communication, and more specifically to a multi-level communication method, system and computer-readable medium based on virtual interface. Background Art

[0002] In order to improve the efficiency of computer systems and enhance the parallel operation capabilities of various hardware in computer systems, operating systems require that program structures must adapt to the needs of concurrent processing, and the concept of processes is introduced for this purpose. Processes are the core of operating systems, and all operating systems based on multiprogramming are built on the concept of processes. Current computer systems all provide a multitasking parallel environment. Whether it is an application or a system program, a corresponding process needs to be created for each task. Processes are a powerful tool for designing and analyzing operating systems. However, different processes, even parent-child processes with family connections, have different process images. Since different processes run in their own different memory spaces, the modification of variables by one party cannot be perceived by the other party. Therefore, information transfer between processes cannot be carried out directly through variables or other data structures, and can only be completed through inter-process communication.

[0003] Existing inter-program communication technologies are divided into two categories: one is communication between the same host, and the other is communication between different hosts.

[0004] Common methods of same-host communication technology include pipes, shared memory, and message queues. Pipes are half-duplex communication. Only one process can write to a pipe and only one process can read it. Therefore, pipes are more suitable for one-way communication scenarios. Pipeline communication is inefficient, so pipes are not suitable for frequent data exchange between processes. In shared memory communication, if multiple processes modify the same shared memory at the same time, there is a high probability of conflict, so it is not suitable for communication between multiple processes. The process of reading and writing message queues will involve the process of copying messages between user mode and kernel mode, so message queues are not suitable for relatively large data transmission. Moreover, the interfaces of the above three methods are different on different system platforms, and the communication interfaces vary greatly.

[0005] Cross-host communication technology usually uses sockets. There are two common communication methods: one is based on the TCP protocol, and the other is based on the UDP protocol. The TCP protocol needs to maintain all transmission connections on each device, and each connection will occupy CPU resources; the UDP protocol is an unreliable communication, which is suitable for situations where the data volume frequency is high and packet loss is allowed. Moreover, the interfaces of these two methods are different on different system platforms, and the differences are quite large.

[0006] Therefore, in the common Windows and Linux platforms, the inter-program communication methods we commonly use have their own characteristics and applicable scenarios. We will choose the appropriate method for inter-process communication according to actual needs. However, the code cannot be implemented across platforms, inter-process communication cannot cross hosts, and the developed interfaces are not unified, which greatly increases the difficulty of development. Summary of the invention

[0007] The present invention proposes a multi-level communication method, system and computer-readable medium based on virtual interface, which is a third-party library divided into version libraries of different systems, supports cross-platform, can realize inter-program communication in various operating systems, and reduces the difficulty of development.

[0008] The present invention provides a multi-level communication method based on a virtual interface, comprising the following steps:

[0009] Divide the system or program into several functional modules to complete tasks or functions;

[0010] The library function defines the virtual interface of the module, which describes the operations or functions that can be completed using the library function;

[0011] Users edit and define each module according to their own needs, and complete the communication between modules through virtual interfaces to realize the complete logic.

[0012] Preferably, the specific steps include:

[0013] S1, Requirements Analysis: Analyze and understand the requirements of the system or program, clarify the functions or tasks that the system or program needs to achieve, and the relationship and dependency between each function;

[0014] S2, module division: according to the demand analysis, the system or program is decomposed into multiple modules. Each module should be responsible for completing an independent task or function, and there should be clear boundaries and interfaces between modules.

[0015] S3, define interface: define clear interface for each module, including input and output, function call, and data transfer;

[0016] S4, module implementation: implement the specific functions of each module according to the interface definition;

[0017] S5, module testing: perform unit testing on each module to verify whether the module functions as expected and whether the interface is used correctly; based on unit testing, perform integration testing between modules to ensure that the modules can work together correctly after integration;

[0018] S6, module integration: Integrate the modules to form a complete system or program. During the integration process, it is necessary to ensure that the interfaces and data transmission between modules are normal without conflicts or errors.

[0019] Preferably, the method further comprises the following steps:

[0020] S7, Optimization and Iteration: Optimize and improve the system or program based on the results of system or program testing and user feedback. It may be necessary to modify or reconstruct some modules to improve the quality and performance of the system.

[0021] Preferably, the virtual interface includes a module lifecycle management interface to complete the creation, startup, termination and restart of the module.

[0022] Preferably, the virtual interface includes a localized communication interface to implement inter-process communication with the host.

[0023] Preferably, the inter-process communication mode between the same host includes four different mechanisms: shared memory, message queue, pipeline and UnixDomain.

[0024] Preferably, the virtual interface includes a cross-module communication interface to achieve communication across hosts.

[0025] Preferably, cross-host communication is to add a layer of network communication on the basis of localized communication, the bottom layer uses socket programming, and the communication protocols include TCP and UDP.

[0026] The present invention also provides a multi-level communication system based on a virtual interface, comprising:

[0027] Container management layer, used to store all modules;

[0028] Lifecycle management layer, which manages each module and has its own lifecycle interface, including creation, start, end and restart

[0029] Localized communication layer, manages the localized communication interface and implements inter-process communication between hosts;

[0030] The cross-module communication layer manages the cross-module communication interface and realizes communication between hosts;

[0031] The unified interface layer uses the concept of virtual interface to first define an abstract communication interface to represent the basic functions and behaviors of communication, including sending data, receiving data, synchronization and asynchrony. On the basis of the communication interface, different communication methods are implemented through class inheritance, ultimately achieving the purpose of a unified interface.

[0032] The present invention also provides a computer-readable medium having a computer program stored thereon, wherein the computer program implements the above method when executed by a processor.

[0033] The beneficial effects of the present invention are as follows: (1) it supports cross-platform features and can be used on various operating systems; (2) it supports inter-process communication between a single host and multiple hosts; (3) it provides a simple and consistent interface, which can easily implement inter-process communication and data sharing, thereby building efficient multi-process applications; (4) it is a lightweight library with a small library file size and is simple and easy to use; (5) it can also be used for communication between different modules within a process, and it can also be used within the same module, and communication within the same process should not affect communication between other processes. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0035] Figure 1 This is a design diagram of a virtual interface according to an embodiment of the present invention.

[0036] Figure 2 A schematic diagram of defining optional communication modes in an embodiment of the present invention.

[0037] Figure 3 It is a schematic diagram of the definition of module messages according to an embodiment of the present invention.

[0038] Figure 4 It is the design hierarchy diagram of the system of the present invention. DETAILED DESCRIPTION

[0039] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0040] The present invention discloses a multi-level communication method based on a virtual interface, comprising the following steps:

[0041] Divide the system or program into several functional modules to complete tasks or functions;

[0042] The library function defines the virtual interface of the module, which describes the operations or functions that can be completed using the library function;

[0043] Users edit and define each module according to their own needs, and complete the communication between modules through virtual interfaces to realize the complete logic.

[0044] The final product of the solution of the present invention is a third-party library, which is divided into version libraries of different systems. Modular design is to divide and design a series of functional modules based on functional analysis of products with different functions or different performances and specifications of the same functions within a certain range. In the present invention, each program or process can be equal to a module. The elements within the module should be highly correlated and complete similar or related tasks. Highly cohesive modules are easier to understand, test and maintain; and a module should only be responsible for one type of task or function to avoid a module with too complex or diversified functions.

[0045] The modular design of the present invention defines clear interfaces, such as function interfaces, class interfaces, API interfaces, etc., uses object-oriented programming (OOP) or other modular programming methods, such as functional programming, componentization, etc., realizes decoupling between modules through dependency injection technology, reduces direct dependencies between modules, and uses design patterns (such as factory pattern, singleton pattern, strategy pattern, etc.) to improve the flexibility and reusability of modules. The main advantages are:

[0046] a) Maintainability: Modular design allows the code to be broken down into independent modules or components, each of which is responsible for a specific function. In this way, when a function needs to be modified or debugged, you only need to focus on the corresponding module without having to understand the complexity of the entire system, which greatly improves the maintainability of the code;

[0047] b) Scalability: Modular design makes the system structure more flexible, and the system functions can be expanded by adding new modules or modifying existing modules. Different modules communicate through defined interfaces, reducing the dependencies between modules and making the system easier to expand and evolve;

[0048] c) Reusability: Modular design encourages code reuse, and well-designed modules can be reused in different projects or different parts. This can save development time and resources and improve the reliability and stability of the code;

[0049] d) Reduce complexity: Decomposing the system into small modules can reduce the overall complexity of the system. Each module only needs to focus on its own functional implementation and does not need to consider the details of the entire system, making the system easier to understand and manage;

[0050] e) Parallel development: Modular design facilitates parallel development. Different team members can develop different modules in parallel and collaborate and integrate through defined interfaces, which improves development efficiency and project progress.

[0051] f) Testing and debugging: Modular design makes unit testing easier, and each module can be tested and debugged separately. This allows problems to be discovered and fixed earlier, improving the quality and stability of the code.

[0052] The virtual interface design of the present invention defines a set of virtual interfaces in the library function, which describe the operations or functions that can be completed using the library function. The virtual interface defines a specification so that different users or teams can implement different logics based on the same library function according to their own needs, thereby avoiding code duplication and redundancy. The introduction of the virtual interface enhances the flexibility and scalability of the library function. The library function provides a basic interface specification, and the user can expand and customize it according to the actual situation to meet different needs.

[0053] The specific steps of the present invention include:

[0054] S1, Requirements Analysis: Analyze and understand the requirements of the system or program, clarify the functions or tasks that the system or program needs to achieve, and the relationship and dependency between each function;

[0055] S2, module division: according to the demand analysis, the system or program is decomposed into multiple modules. Each module should be responsible for completing an independent task or function, and there should be clear boundaries and interfaces between modules.

[0056] S3, define interface: define clear interfaces for each module, including input and output, function calls, and data transfer. The interface has clear function definitions and specifications so that other modules can use it correctly.

[0057] S4, module implementation: implement the specific functions of each module according to the interface definition. During the implementation process, it is necessary to follow the modular design principle and maintain high cohesion and low coupling within the module;

[0058] S5, module testing: perform unit testing on each module to verify whether the module functions as expected and whether the interface is used correctly; based on unit testing, perform integration testing between modules to ensure that the modules can work together correctly after integration;

[0059] S6, module integration: Integrate the modules to form a complete system or program. During the integration process, it is necessary to ensure that the interfaces and data transmission between modules are normal without conflicts or errors.

[0060] S7, Optimization and Iteration: Optimize and improve the system or program based on the results of system or program testing and user feedback. It may be necessary to modify or reconstruct some modules to improve the quality and performance of the system.

[0061] In this embodiment, the virtual interface design is divided into three layers. The first layer is the module lifecycle management interface, the second layer is the localized communication interface, and the third layer is the cross-module communication interface:

[0062] Lifecycle Management Interface

[0063] like Figure 1 As shown in the figure, modular life cycle management includes four steps: create, start, end, and restart. As shown in the figure above, the Create() interface is to create a module, and the interface contains the data of the initialization module, such as the initialization module ID and other data; the Start() interface is to start the module, and the main functions of the interface are to start the thread, open the communication and other functions; the Close() interface is to end the module, and the main functions of the interface are to close the thread, close the communication and release the memory and other functions; the Restart() interface is to restart the module.

[0064] Localized communication interface

[0065] The main communication methods between processes on the same host include four different mechanisms: shared memory, message queues, pipes, and UnixDomain. Figure 2-3 The specific interfaces are shown as follows:

[0066] 1) SyncSendData interface: synchronous data sending, parameter module_id is the module id; parameter msg is the message definition rule of the module, which is divided into main code and subcode. The type of data is identified by identifying the main code and subcode; parameter data is the first address of the memory where the data is stored, parameter data_len is the length of the data; parameter type is the communication method that can be selected, and localized communication includes shared memory, message queue, pipe and Unix Domain;

[0067] 2) AsyncSendData interface, which has the same function as the above interface, except that it sends data asynchronously;

[0068] 3) RecvData interface, synchronously receives data, msg is the message to distinguish the modules, and then parses the parameter data, and finally parses it into the data we need, the parameter data_len is the length of the data;

[0069] 4) AsyncRecvData interface is also used to receive data asynchronously.

[0070] Cross-module communication interface

[0071] Cross-module communication is mainly cross-host communication. It adds a layer of network communication on the basis of local communication. The bottom layer uses socket programming, and the communication protocol includes TCP and UDP. The specific interface is as follows:

[0072] 1) InitSocket interface, used to set the ip and port interface;

[0073] 2) SyncSendSocketData interface: synchronous data transmission, the parameter module_id is the module id; the msg parameter is the message definition of the module, which is divided into the main code and the subcode. The type of data is identified by identifying the main code and the subcode; the parameter data is the first address of the memory where the data is stored, and the parameter data_len is the length of the data; the parameter type is the communication method that can be selected, and cross-program communication includes TCP and UDP.

[0074] 3) AsyncSendSocketData interface: It has the same function as the previous interface, except that it sends data asynchronously;

[0075] 4) RecvSocketData interface: synchronously receive data, msg is the message to distinguish the modules, and then parse the parameter data, and finally parse it into the data we need, the parameter data_len is the length of the data;

[0076] 5) AsyncRecvSocketData interface: also used to receive data asynchronously.

[0077] The present invention also discloses a communication system, comprising:

[0078] The container management layer is used to store all modules. That is, all modules are placed in a container, which makes it convenient to operate the container, including traversal, memory management, pointer management and other operations.

[0079] The lifecycle management layer manages each module with its own lifecycle interface, including creation, startup, termination, and restart. The module lifecycle is also uniformly operated by the module container, so developers do not need to perform separate lifecycle management for each module.

[0080] The localized communication layer manages the localized communication interface and implements inter-process communication between the same host. Based on the virtual interface of the communication, it implements the localized communication function, including four communication mechanisms: message queue, shared memory, pipe and Unix Domain. If cross-module communication is not required, the ModuleCommUnit class can be directly inherited to implement the function.

[0081] The cross-module communication layer manages the cross-module communication interface, realizes communication across hosts, continues to develop network communication based on localized communication, and uses socket programming to realize communication. The communication protocol includes two mechanisms: TCP and UDP.

[0082] The unified interface layer uses the concept of virtual interface to first define an abstract communication interface to represent the basic functions and behaviors of communication, including sending data, receiving data, synchronization and asynchrony. On the basis of the communication interface, different communication methods are implemented through class inheritance, ultimately achieving the purpose of a unified interface.

[0083] The unified interface of the present invention uses multi-level inheritance and virtual interface settings to achieve a unified interface, as each communication technology is inconsistent on each platform and the interfaces vary greatly. Since each communication technology relies on different libraries on different platforms and the imported header files are also inconsistent, the current system platform is judged and the corresponding interface is selected to implement cross-platform technology. The setting of the virtual interface enhances scalability. If the user has other needs, the effect can also be achieved by inheriting the solution of the present invention.

[0084] The present invention implements a deployment scheme based on user scenarios: 1. Download source code and package it into a library of the required system version; 2. Add library files (header files and library files) to your project; 3. Configure the build system (such as CMake, Makefile, etc.) to compile and link the third-party library. If it is a CMake project, you need to add references and configurations to the third-party library in the CMakeLists.txt file; 4. Link library files. For static libraries (.lib, .a), use the `-l` option to specify the linked library name during compilation, such as `-lmylibrary`; for dynamic libraries (.dll, .so), it is necessary to set the library path and ensure that the system can find the dynamic link library at runtime; 5. Use the library functions: a) Inherit the base class RawBaseModule of the library and rewrite the life cycle functions: Create(), Start(), Close(); b) Rewrite HandleAwake(), HandleData(), HandleMessage(), and each functional module communicates through the Notify() interface, and uses the HandleMessage interface to process messages. 6. Test run.

[0085] In particular, according to some embodiments of the present disclosure, the process described above can be implemented as a computer software program. For example, some embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In some such embodiments, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device, or installed from a ROM. When the computer program is executed by a processing device, the above-mentioned functions defined in the method of some embodiments of the present disclosure are executed.

[0086] It should be noted that the computer-readable medium recorded in some embodiments of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In some embodiments of the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In some embodiments of the present disclosure, a computer-readable signal medium may include a mission data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated mission data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0087] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperTextTransferProtocol), and may be interconnected with any form or medium of digital task data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an adhoc peer-to-peer network), as well as any currently known or future developed network.

[0088] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device. The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: in response to detecting a query operation on a production collaboration document in a switch production line management application, determines the network connection status of the switch production line management application; in response to determining that the network connection status of the switch production line management application represents an offline state, replaces the web page entry information corresponding to the production collaboration document with target entry file information, and loads target web page resource information to display the web page of the production collaboration document offline in the switch production line management application, wherein the target entry file information is file information of a pre-downloaded entry file corresponding to the web page of the production collaboration document, and the target web page resource information is locally stored resource information corresponding to the web page; in response to determining that the network connection status of the switch production line management application represents an online state, and the web page resource information corresponding to the production collaboration document is not stored locally, downloads the web page resource information of the web page from the production line document server, wherein the web page resource information includes an entry file and resource information; according to the web page resource information, displays the web page of the production collaboration document in the switch production line management application, and stores the web page resource information in a local database.

[0089] Computer program code for performing the operations of some embodiments of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including product-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0090] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A multi-level communication method based on virtual interface, characterized in that: The following steps are involved: Divide the system or program into several functional modules to complete tasks or functions; The library function defines the virtual interface of the module, which describes the operations or functions that can be completed using the library function; Users edit and define each module according to their own needs, and complete the communication between modules through virtual interfaces to realize the complete logic.

2. The multi-level communication method based on virtual interface as claimed in claim 1, characterized in that: The specific steps include: S1, Requirements Analysis: Analyze and understand the requirements of the system or program, clarify the functions or tasks that the system or program needs to achieve, and the relationship and dependency between each function; S2, module division: according to the demand analysis, the system or program is decomposed into multiple modules. Each module should be responsible for completing an independent task or function, and there should be clear boundaries and interfaces between modules. S3, define interface: define clear interface for each module, including input and output, function call, and data transfer; S4, module implementation: implement the specific functions of each module according to the interface definition; S5, module testing: perform unit testing on each module to verify whether the module functions as expected and whether the interface is used correctly; based on unit testing, perform integration testing between modules to ensure that the modules can work together correctly after integration; S6, module integration: Integrate the modules to form a complete system or program. During the integration process, it is necessary to ensure that the interfaces and data transmission between modules are normal without conflicts or errors.

3. The multi-level communication method based on virtual interface as claimed in claim 1, characterized in that: The following steps are also included: S7, Optimization and Iteration: Optimize and improve the system or program based on the results of system or program testing and user feedback.

4. The multi-level communication method based on virtual interface as claimed in claim 1, characterized in that: The virtual interface includes the module lifecycle management interface, which completes the creation, startup, termination and restart of the module.

5. The multi-level communication method based on virtual interface as claimed in claim 1, characterized in that: The virtual interface includes a localized communication interface to achieve inter-process communication between the same host.

6. The multi-level communication method based on virtual interface as claimed in claim 5, characterized in that: The inter-process communication methods between the same host include four different mechanisms: shared memory, message queues, pipes, and Unix Domain.

7. The multi-layer communication method based on virtual interface as claimed in claim 1, characterized in that: The virtual interface includes a cross-module communication interface to achieve communication between hosts.

8. The multi-level communication method based on virtual interface as claimed in claim 7, characterized in that: Communication between hosts adds a layer of network communication on the basis of local communication. The underlying layer uses socket programming, and the communication protocols include TCP and UDP.

9. A communication system for executing the method according to any one of claims 1 to 8, characterized in that: include: Container management layer, used to store all modules; Lifecycle management layer, which manages each module and has its own lifecycle interface, including creation, start, end and restart Localized communication layer, manages the localized communication interface and implements inter-process communication between hosts; The cross-module communication layer manages the cross-module communication interface and realizes communication between hosts; The unified interface layer uses the concept of virtual interface to first define an abstract communication interface to represent the basic functions and behaviors of communication, including sending data, receiving data, synchronization and asynchrony. On the basis of the communication interface, different communication methods are implemented through class inheritance, ultimately achieving the purpose of a unified interface.

10. A computer readable medium having a computer program stored thereon, wherein: When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.