CN117155810A - Distributed communication system and communication method based on GRPC and UDP broadcast - Google Patents

Distributed communication system and communication method based on GRPC and UDP broadcast Download PDF

Info

Publication number
CN117155810A
CN117155810A CN202311188288.5A CN202311188288A CN117155810A CN 117155810 A CN117155810 A CN 117155810A CN 202311188288 A CN202311188288 A CN 202311188288A CN 117155810 A CN117155810 A CN 117155810A
Authority
CN
China
Prior art keywords
grpc
distributed
node
nodes
service node
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311188288.5A
Other languages
Chinese (zh)
Inventor
周凯
田进
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xi'an Explorer Intelligent Photoelectric Technology Co ltd
Original Assignee
Xi'an Explorer Intelligent Photoelectric Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xi'an Explorer Intelligent Photoelectric Technology Co ltd filed Critical Xi'an Explorer Intelligent Photoelectric Technology Co ltd
Priority to CN202311188288.5A priority Critical patent/CN117155810A/en
Publication of CN117155810A publication Critical patent/CN117155810A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/34Signalling channels for network management communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/16Arrangements for providing special services to substations
    • H04L12/18Arrangements for providing special services to substations for broadcast or conference, e.g. multicast
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Multi Processors (AREA)

Abstract

The embodiment of the invention discloses a distributed communication system and a communication method based on GRPC and UDP, wherein the system comprises the following steps: the system comprises a plurality of user nodes, a GRPC process control and resource monitoring module, a GRPC client, a GRPC service node, a plurality of distributed nodes and a UDP broadcast data transmission and information interaction module; the plurality of user nodes send requests for controlling and monitoring all the distributed nodes to the GRPC service node; the GRPC process control and resource monitoring module is used for controlling the start and stop of the process and the resource monitoring; the GRPC client receives and forwards the request; the GRPC service node processes the request and sends control commands to the distributed nodes; the distributed nodes execute the control command and transmit execution results back to the GRPC service node; and the UDP broadcast data transmission and information interaction module is used for carrying out data transmission and information interaction based on UDP broadcast.

Description

Distributed communication system and communication method based on GRPC and UDP broadcast
Technical Field
The embodiment of the invention relates to the technical field of distributed communication, in particular to a distributed communication system and a communication method based on GRPC and UDP broadcasting.
Background
With the development of distributed and emulation techniques, distributed systems experience a decentralized transition from a centralized distribution of real servers to a distributed distribution of virtual servers. In the traditional test simulation system, the distribution of test simulation resources is centralized, the information transmission of a remote target cannot be completed, and the operation and the updating are blocked. With the gradual development of the distributed system, the system overcomes the problems of the traditional test simulation system, realizes test simulation resources connected with different geographic positions by means of a network, simulates a test environment to meet the requirements of interoperability and information sharing among the resources, reduces test cost, and can realize the aims of large-scale test, flexible change of the test resources and the like in the system. In order to achieve the above objective, there is an urgent need to have a more flexible communication mechanism between the various test resources.
The communication mechanism is the basis for ensuring the mutual operation of the two communication parties, and the main communication mechanism comprises a multi-point interactive publishing/subscribing mode and a point-to-point request/response mode. In the multipoint interactive publishing/subscribing mode, the client and the server communicate through a unified architecture specification, and the implementation mode of the opposite side is not required to be known, so that the communication node has strong flexibility and low dependence; the peer-to-peer request/response mode requires the client and the server to establish a response mode, both sides can send messages to the other side, the application range is more common, the architecture is simple, and the deployment and the application can be rapidly put into.
Because in large distributed systems, a certain communication mode cannot meet the requirements of all test resources. By increasing the number of middleware to increase the communication manner of request/response, the communication efficiency of the system is reduced and the cost is high.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a distributed communication system and a communication method based on GRPC and UDP broadcast, which can support multi-node communication and multi-node cooperative control, and improve data transmission instantaneity and communication efficiency.
The technical scheme of the embodiment of the invention is realized as follows:
in a first aspect, an embodiment of the present invention provides a distributed communication system based on GRPC and UDP broadcast, including: the system comprises a plurality of user nodes, a GRPC process control and resource monitoring module, a GRPC client, a GRPC service node, a plurality of distributed nodes and a UDP broadcast data transmission and information interaction module; wherein,
the plurality of user nodes are used for sending requests for controlling and monitoring all the distributed nodes to the GRPC service node through the GRPC client and receiving returned system states of all the distributed nodes;
the GRPC process control and resource monitoring module is used for controlling the starting and stopping of the process and the resource monitoring;
The GRPC client is used for receiving the requests sent by the plurality of user nodes and forwarding the requests to the GRPC service node;
the GRPC service node receives and processes the request sent by the user node forwarded by the GRPC client, converts the request into a control command, sends the control command to each distributed node and receives the execution result of the control command of each distributed node;
the distributed nodes receive the control command and execute corresponding operation of the control command, and return an execution result to the GRPC service node and any one of the distributed nodes completes data transmission and information interaction based on UDP broadcast;
the UDP broadcast data transmission and information interaction module is used for enabling data transmission and information interaction between the distributed nodes based on UDP broadcast.
In a second aspect, an embodiment of the present invention provides a communication method of a distributed communication system based on GRPC and UDP broadcast, where the method includes:
the user node sends a request for controlling and monitoring each distributed node to the GRPC service node;
the GRPC service node receives and processes the request and returns a response message, and a control command is sent to GRPC control monitoring nodes which are deployed in advance by the distributed nodes;
And each distributed node acquires a control command of the GRPC service node, executes corresponding operation of the control command, returns an execution result to the GRPC service node, and acquires data content issued by any one of the other distributed nodes by receiving UDP broadcast of any one of the distributed nodes so as to perform data transmission and information interaction.
In a third aspect, embodiments of the present invention provide a computing device, the computing device comprising: a communication interface, a memory and a processor; the components are coupled together by a bus system; wherein,
the communication interface is used for receiving and transmitting signals in the process of receiving and transmitting information with other external network elements;
the memory is used for storing a computer program capable of running on the processor;
the processor is configured to execute the steps of the communication method of the distributed communication system based on GRPC and UDP broadcast of the second aspect when the computer program is executed.
In a fourth aspect, an embodiment of the present invention provides a computer storage medium storing a program for distributed communication based on GRPC and UDP broadcast, which when executed by at least one processor, implements the steps of the communication method of the distributed communication system based on GRPC and UDP broadcast of the second aspect.
The embodiment of the invention provides a distributed communication system and a communication method based on GRPC and UDP broadcasting, which can realize the control of users on each distributed node and the monitoring of the system state thereof through the interaction of service nodes based on GRPC and each distributed node, and can realize the cooperative control of multi-node (multi-machine) communication and multi-node (multi-machine); and each distributed node respectively transmits UDP broadcast, and any one of other distributed nodes acquires the data content by receiving the UDP broadcast so as to perform data transmission and information interaction. By means of a data transmission mechanism of UDP broadcasting, instantaneity and communication efficiency of system data transmission are greatly improved, and efficient transmission of data of each distributed node is achieved.
Drawings
Fig. 1 is a schematic diagram of a distributed communication system based on GRPC and UDP broadcast according to an embodiment of the present invention;
FIG. 2 is a communication structure diagram based on GRPC provided by the embodiment of the invention;
FIG. 3 is a schematic diagram of a GRPC-based system according to an embodiment of the present invention;
fig. 4 is a schematic diagram of UDP data transmission according to an embodiment of the present invention;
fig. 5 is a flowchart of a communication method of a distributed communication system based on GRPC and UDP broadcast according to an embodiment of the present invention;
FIG. 6 is a flowchart of a GRPC-based workflow provided by an embodiment of the invention;
FIG. 7 is a flowchart of a distributed communication operation based on GRPC and UDP broadcasting according to an embodiment of the present invention;
FIG. 8 is a schematic diagram of a distributed simulation provided by an embodiment of the present invention;
FIG. 9 is a GRPC resolution server according to an embodiment of the present invention;
FIG. 10 is a schematic diagram of another GRPC resolution server according to an embodiment of the present invention;
FIG. 11 is an interface of simulation design software provided by an embodiment of the present invention;
FIG. 12 is a view of a scene simulation model provided by an embodiment of the present invention;
FIG. 13 is a schematic diagram of a missile model according to an exemplary embodiment of the present invention;
FIG. 14 is a schematic diagram of a simulation master control model according to an embodiment of the present invention;
fig. 15 is a schematic hardware structure of a computing device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
Remote procedure call (Remote Procedure Call, RPC) developed by Google corporation, GRPC, is a high performance, open source and generic RPC framework, service-side and mobile-side oriented Protocol developed based on Protocol Buffers (ProtoBuf) serialization protocols and designed based on the hypertext transfer Protocol (HyperText Transfer Protocol, HTTP) version 2.0. The GRPC provides a set of remote procedure call mechanism, so that application programs of different service callers can communicate, remote service call is simpler and transparent, the use threshold of a developer is reduced, the underlying network transmission mode can comprise a transmission control protocol (Transmission Control Protocol, TCP) or a user datagram protocol (User Datagram Protocol, UDP), and for TCP-based data transmission, the TCP protocol has the problem of stability and reliability but low communication efficiency, so the embodiment of the invention provides a distributed communication system capable of utilizing the advantages of the GRPC and UDP broadcasting technology.
Referring to fig. 1, which illustrates a schematic diagram of a distributed system 100 based on GRPC and UDP broadcast, which is provided by an example of the present invention, it should be noted that the system 100 illustrated in fig. 1 is only one example of a possible system, and that embodiments of the present invention may be implemented in any of a variety of systems as desired. The system 100 includes: the system comprises a plurality of user nodes, a GRPC process control and resource monitoring module, a GRPC client, a GRPC service node, a plurality of distributed nodes and a UDP broadcast data transmission and information interaction module; wherein,
the plurality of user nodes are used for sending requests for controlling and monitoring all the distributed nodes to the GRPC service node through the GRPC client and receiving returned system states of all the distributed nodes;
the GRPC process control and resource monitoring module is used for controlling the starting and stopping of the process and the resource monitoring;
the GRPC client is used for receiving the requests sent by the plurality of user nodes and forwarding the requests to the GRPC service node;
the GRPC service node receives and processes the request sent by the user node forwarded by the GRPC client, converts the request into a control command, sends the control command to each distributed node and receives the execution result of the control command of each distributed node;
The distributed nodes receive the control command and execute corresponding operation of the control command, and return an execution result to the GRPC service node and any one of the distributed nodes completes data transmission and information interaction based on UDP broadcast;
the UDP broadcast data transmission and information interaction module is used for enabling data transmission and information interaction between the distributed nodes based on UDP broadcast.
For the system 100 described above, in some examples, the GRPC client and GRPC service nodes are deployed in software on each distributed node; the GRPC service node is also used for controlling and monitoring service resources through a GRPC control monitoring function of the GRPC service node, so that the GRPC service node can be also called as a GRPC control monitoring node when the GRPC control monitoring function is realized.
It should be noted that, each GRPC service node corresponds to a distributed node; the GRPC client can be deployed on any one distributed node or on a plurality of distributed nodes at the same time.
The GRPC is a high-performance, open-source and general RPC framework, is based on protocols facing a service end and a mobile end and designed by HTTP 2.0 version, can shield an underlying network transmission mode (such as TCP or UDP) and a serialization mode (XML/Json/binary), and a service caller can call a remote service provider like a local interface without concern about underlying communication details and a call process, so that the use threshold of a developer is reduced. Referring to fig. 2 in conjunction with the system 100 shown in fig. 1, a communication structure diagram based on GRPC provided in an embodiment of the present invention includes: comprising the following steps: the embodiment of the invention takes 2 GRPC clients as examples, for example, a Ruby client and an Android-Java client respectively send protocol requests to the GRPC server, wherein the GRPC server is a GRPC service node in the system shown in figure 1; the GRPC server side receives and processes the requests initiated by the GRPC client sides and realizes the method in the service interface according to the codes generated by the micro-service definition, then carries out corresponding processing according to the received requests, and returns the processing results to the GRPC client nodes through protocol responses. Specifically, as shown in fig. 2, the GRPC client initiates a request from the GRPC core library, sequences the request into a ProtoBuf message format, then transmits the request to the GRPC server, and the GRPC server receives the request from the GRPC client, processes ProtoBuf data in the request and deserializes the data, then transmits a request object to the server and implements service logic processing, and finally returns the response after serialization to each GRPC client, thereby forming a complete interface calling process. And a Stub is stored in the GRPC client, and the Stub is automatically generated by the GRPC framework and used for providing the same method and function as a server, and based on the Stub developer, the Stub developer only needs to care about specific business logic and does not need to care about network communication related implementation principles.
For the above example, there are 4 types of message transmission based on GRPC, respectively:
the first is a request-reply type unary message, i.e., a simple request-response; .
The second type is streaming response, the client initiates a request, the server reads a series of messages, and the messages are returned to the client through data stream;
the third is a streaming request, the client writes a series of messages and sends the messages to the server through a data stream, and waits for the response of the server;
the fourth is a bi-directional flow, namely a streaming request and a streaming response.
The transmission mode of the system framework bottom layer based on the GRPC can be TCP or UDP, the GRPC can shield the transmission mode of the bottom layer and the serialization mode (XML/Json/binary), and a micro-service caller can call a remote service provider like a local interface, and the communication details and the calling process of the bottom layer are not required to be concerned. In some examples, the GRPC system framework includes at least the following components: the system comprises a service definition unit, a code generator, a transmission layer, a serialization and deserialization unit, a server side and a client side; wherein,
the service definition unit defines a service interface and a message structure using an interface description language (Interface Definition Language, IDL);
Since IDLs provide a uniform way to describe services and messages, developers of different languages can generate corresponding client and server-side code from IDLs.
The code generator automatically generates the code of the client based on the IDL file defined by the service; the generated codes comprise logic for realizing, serializing and deserializing interfaces and provide application program interfaces and running environments of corresponding languages;
the transmission layer uses HTTP 2.0 as the transmission protocol of the bottom layer;
specifically, the HTTP 2.0 is a binary protocol that supports upstream delivery of timeout times, allowing upstream to proactively decide how to perform subsequent operations when found timeout, with lower latency and higher throughput than the traditional HTTP 1.X protocol's direct disconnection, the HTTP 2.0 supports multiplexing, allows multiple requests and responses to proceed simultaneously on the same TCP connection, reduces the simultaneous progress on the network connection and reduces the overhead of the network connection.
The serialization and deserialization unit uses a protocol buffer ProtoBuf as default serialization and deserialization;
specifically, the GRPC generates server-side and client-side codes based on the standard ProtoBuf, and can put all interface descriptions and document descriptions into the pro file, so that the server-side and client-side codes are convenient to view and modify. The ProtoBuf is provided with a serialization framework and a compiler, the proto file is compiled by the compiler, and the proto file needs to be compiled to generate a similar library file, so that the data application can be really developed based on the library file. The ProtoBuf has two main roles in the framework of the GRPC, namely, defining a data structure and improving transmission efficiency through serialization and deserialization.
The server side receives and processes the request initiated by the client side;
specifically, the server side is responsible for receiving and processing an RPC request initiated by the client side, implementing a method in the service interface according to a code generated by the service definition, and performing corresponding processing according to the received request.
The client initiates a request and receives a response of the server.
Specifically, the client calls a corresponding method according to the code generated by the service definition, and transmits the request parameters to the server.
It should be noted that, for the whole flow interaction of the GRPC, only the client and the server are in the form of representation, and other components are components of the underlying protocol and the software development.
Referring to fig. 3, which shows a schematic diagram based on a GRPC provided by an embodiment of the present invention, as shown in fig. 3, remote procedure calls are called "remote", because under a micro-service architecture, each micro-service is deployed on a different server, and it enables communication between remote services, from the perspective of a user, it works as a local function call, specifically, a micro-service consumer initiates a REST request, and a GRPC client converts the REST request after receiving the REST request, encodes the REST request into a binary format, constructs a request message of a GRPC, and sends a data packet to the GRPC server through a network based on HTTP 2.0; the GRPC server decodes and calls related service application after receiving the data packet from the network, returns and codes the executed result and sends the executed result to the GRPC client through the transmission layer of the network; and the GRPC client receives the data packet, decodes the data packet and sends the result to the micro-service consumer application. The efficiency of GRPC is higher than that of Restful service and coding, so that the space is saved, and the GRPC has advantages in a low-bandwidth scene; and the ProtoBuf compiler generates the data read-write codes, so that the coding efficiency of a developer is improved.
For the GRPC framework based on UDP transport, which is a connectionless protocol, the sender and receiver do not establish a connection before the data is transferred, simply go to grab the data from the application when it wants to transfer it, and transport it over the network as quickly as possible. At the transmitting end, the speed of UDP transmitting data is limited only by the speed of generating data by an application program, the capability of a computer and the transmission bandwidth; at the receiving end, UDP places each message segment in a queue from which the application reads one message segment at a time.
Because the transmission data does not establish connection, the connection state, the receiving and transmitting state and the like do not need to be maintained, and therefore one server (a sending end) can simultaneously transmit the same message to a plurality of clients (receiving ends), namely, the same message is transmitted through UDP broadcast; the header of the UDP packet is very short, only 8 bytes, and the UDP overhead is very small compared with the 20 bytes of the TCP packet; throughput is not regulated by congestion control algorithms, but is limited only by the rate at which data is generated by application software, the transmission bandwidth, and the source and end host capabilities.
UDP is message-oriented, specifically, a message sent by a sender's UDP to an application is delivered to the IP layer downward after adding a header. The boundaries of these messages are not split nor merged, but rather are preserved, so the application needs to select the appropriate message size. Although UDP is an unreliable protocol, it is an ideal protocol for distributing information. UDP is also used in routing information protocols (Routing Information Protocol, RIP) to modify routing tables. In these applications, if one message is lost, another new message will replace it after a few seconds, so UDP can be widely used in multimedia.
The UDP broadcast is a data content sent by a communication machine where any distributed node in the system shown in fig. 1 is located to all communication machines in the subnet where the communication machine is located. Referring to fig. 4, a pattern diagram of UDP-based data transmission provided by an embodiment of the present invention is shown, and as shown in fig. 4, the UDP-based data transmission pattern includes: UDP unicast, UDP multicast and UDP broadcast; wherein,
the UDP unicast is a one-to-one data transmission in which a data packet sent from one host or client is sent only to another host or client with a designated address and port.
The UDP multicast, which may also be referred to as UDP multicast, may be added by a host or client to another multicast group designated by a multicast IP address, where the members may receive the datagram group sent by the member to the multicast address. After joining the multicast group, the UDP data transmitting and receiving method is the same as the normal UDP data transmitting and receiving method.
The UDP broadcast is a datagram sent by one host or client, and can be received by all other hosts or clients within the same network. Broadcast protocols often used to implement network discovery. The general broadcast address is 255.255.255.255.
The advantages of UDP broadcast over TCP-based data transmission are:
(1) The connection is not formed: UDP is a connectionless protocol that does not require a connection to be established before data is sent. This allows the UDP broadcast to transmit messages quickly, while the TCP broadcast may take longer to establish a connection.
(2) The bandwidth utilization rate is high: UDP broadcasting has no mechanism for TCP flow control and congestion control and therefore can better utilize bandwidth, especially in case of higher network load.
(3) Simple and light: the UDP protocol itself is simpler than TCP, and broadcasts only require one packet to be sent to all hosts, while TCP requires separate maintenance of state for each connection, so UDP broadcasts are typically lighter weight than TCP broadcasts.
(4) Multicast is supported: UDP broadcast also supports multicasting, where messages can be sent to multiple receivers simultaneously, while TCP broadcast can only be sent to one destination.
(5) Real-time performance: since UDP broadcasting has no connection establishment and confirmation steps, it can provide lower delay, and is suitable for real-time application scenarios such as online games, live video, etc.
Referring to fig. 5 in conjunction with the system 100 shown in fig. 1, a communication method flowchart of a distributed communication system based on GRPC and UDP broadcast provided in an embodiment of the present invention is shown, where the method is applied to the system 100, and the method includes:
S501: the user node sends a request for controlling and monitoring each distributed node to the GRPC service node;
s502: the GRPC service node receives and processes the request and returns a response message, and a control command is sent to GRPC control monitoring nodes which are deployed in advance by the distributed nodes;
s503: and each distributed node acquires a control command of the GRPC service node, executes corresponding operation of the control command, returns an execution result to the GRPC service node, and acquires data content issued by any one of the other distributed nodes by receiving UDP broadcast of any one of the distributed nodes so as to perform data transmission and information interaction.
According to the description of the scheme, the embodiment of the invention can realize multi-node (multi-machine) communication and multi-node (multi-machine) cooperative control by realizing the control of the distributed nodes and the monitoring of the system state thereof by the user through the interaction of the service node based on the GRPC and the distributed nodes; and each distributed node respectively transmits UDP broadcast, and any one of other distributed nodes acquires the data content by receiving the UDP broadcast so as to perform data transmission and information interaction. By means of a data transmission mechanism of UDP broadcasting, instantaneity and communication efficiency of system data transmission are greatly improved, and efficient transmission of data of each distributed node is achieved.
For the solution shown in fig. 5, in some possible implementations, the GRPC service node receives and processes the request and returns a response message, and sends a control command to the GRPC control monitoring node that is pre-deployed by each distributed node, including:
the GRPC client calls a method in a corresponding service interface according to the code generated by the micro-service definition and transmits the request parameters and the return type to the GRPC service node through a protocol request message;
the GRPC service node receives and processes the protocol request message sent by the GRPC client, and realizes the method in the service interface according to the code generated by the micro-service definition, and sends the protocol request message to the GRPC client.
For the above implementation, in some examples, the GRPC service node receives and processes the protocol request message sent by the GRPC client, and implements a method in a service interface according to a code generated by a micro service definition, and sends a protocol response message to the GRPC client, specifically, the GRPC requests a server, that is, a client, and a service provider, that is, a server, by adopting a working mode of the client/server. The workflow of the GRPC client and the GRPC server, as shown in fig. 6, includes the following specific steps:
(1) The user node calls the GRPC client handle and executes the transmission parameters;
the service definition unit in the system framework through the GRPC first defines a service specifying the method it can be invoked remotely, including parameters and return types.
(2) The GRPC client calls a local system kernel to send network information;
specifically, when executing a remote procedure call, the GRPC client program first executes a local procedure call, i.e., a client function call client handle, first sends a call message with parameters to the network call, and then a system call, i.e., calls a local system kernel to execute the network call, then transmits a request message to the GRPC server side through network communication, and waits for a response from the GRPC server side. The client and the server in the GRPC communication structure are not limited to the narrow client and the server, and the client is the only call information with the request is to be sent, and the server is the only call information with the request from the client can be processed.
(3) The network message is transmitted to a remote host;
specifically, in some examples, the network message, i.e. the request message, may be serialized into a ProtoBuf message format by the GRPC client, and sent to the GRPC server side through the network transport layer based on HTTP 2.0, or may be transmitted to the server side to which the remote host belongs through the local server side.
(4) The server handle of the server side obtains the request message and obtains the parameters;
specifically, the GRPC server side is a GRPC service node, and the service process keeps a sleep state until call information of the client arrives. When a call information arrives, the GRPC server obtains a request message through a server handle, obtains parameters in the request message, processes ProtoBuf data in the request and deserializes the ProtoBuf data, and then transmits a request object to the server to realize business logic processing.
(5) Executing a remote process;
(6) The executed process returns the result to the server handle;
(7) The server handle returns a result and invokes a remote system kernel;
specifically, the server side invokes the remote system kernel and returns the serialized response message to the client side through the server handle, thereby completing a complete interface invoking process, and then waiting for the next invocation.
(8) The message is transmitted back to the local host;
(9) The client handle receives the message by the kernel;
(10) And the client receives the data returned by the handle.
For the solution shown in fig. 6, in some possible implementations, the GRPC service node receives and processes the request and returns a response message, and sends a control command to the GRPC control monitoring node that is pre-deployed by each distributed node, including: and sending a control command to the GRPC control monitoring nodes which are deployed in advance by the GRPC service nodes, and completing the process control and the resource monitoring of the distributed nodes by the GRPC process control and resource monitoring modules, wherein the control command at least comprises a distributed communication process control command or a distributed node resource command.
For the above implementation, in some examples, the sending, by the GRPC service node, a control command to the GRPC control monitoring node that is pre-deployed to the distributed nodes includes:
respectively deploying GRPC control monitoring nodes on each distributed node;
receiving a control command of the GRPC service node by the GRPC control monitoring node;
and executing the corresponding operation of the control command, and sending the system state, the process state and the resource information of the distributed node corresponding to the GRPC control monitoring node to the GRPC service node.
For the technical solution shown in fig. 5, in some possible implementations, the distributed nodes acquire a control command of the GRPC service node and execute a corresponding operation of the control command, and return an execution result to the GRPC service node, and acquire, by receiving a UDP broadcast of any one of the distributed nodes, data content published by any one of the other distributed nodes for data transmission and information interaction, including:
the transmitting end transmits the data content through UDP broadcast; wherein the transmitting end is any one of the distributed nodes;
and the receiving end receives and analyzes the UDP broadcast, and acquires the data content to perform data transmission and information interaction.
For the technical solution shown in fig. 6, the detailed workflow thereof is shown in fig. 7, because the GRPC service node, the GRPC client and the software with UDP protocol are all deployed on the distributed nodes, for convenience of viewing and description, each component is separately shown in the system, and the user node 1 and the user node 2 and … … user node N send a request for controlling and monitoring each distributed node to the corresponding GRPC service node through the GRPC client respectively; the GRPC service node receives and processes the request sent by the user node and sends a control command to the GRPC control monitoring node which is deployed in advance by each distributed node; each distributed node acquires a control command of the GRPC service node and executes corresponding operation of the control command, and an execution result is returned to the GRPC service node to complete process control and resource monitoring of each distributed node; for data transmission among the distributed nodes, the GRPC service node is integrated with a switch for controlling the opening and closing of the UDP protocol software, and when the switch is opened, any one of the distributed nodes acquires data content sent by other distributed nodes through self-deployed UDP protocol software based on UDP broadcast data reception so as to perform data transmission and information interaction.
In order to verify the effect of a distributed communication system based on GRPC and UDP broadcast, refer to fig. 7, which shows a distributed simulation schematic diagram provided by an embodiment of the present invention, using simulation design software, the simulation design software is sent to any computer to start any model for simulation through GRPC, each computer is deployed with all simulation models, and data between the models after model start is transmitted and interacted with information through UDP broadcast.
Referring to fig. 9 and 10, referring to the distributed simulation system shown in fig. 8, the computer 1 and the computer 2 are respectively shown based on the connection state of the GRPC resolution server, wherein the IP address of the computer 1 is 192.168.1.11, and the IP address of the computer 2 is 192.168.1.10.
For the design interface, the scene simulation model and the missile model of the simulation design software adopted by the distributed simulation system, as shown in fig. 11-13, a computer running the model is determined through the computer IP where the design simulation model is located.
In combination with the missile model shown in fig. 13 and the simulation master control model provided by the embodiment of the present invention as shown in fig. 14, that is, the target model of fig. 13 and 14, and the position data and the image data of the missile model are all sent through UDP broadcast, the simulation design software and the GRPC analysis server are both command analysis performed through the GRPC, and the GRPC analysis server is responsible for analyzing the GRPC command and starting the simulation model. It should be noted that, one computer can run all models at the same time, or different computers can run different simulation models, so as to achieve flexible distributed simulation, and the network protocol of the bottom layer can be shielded by the GRPC, so as to realize remote call; through data transmission based on UDP broadcasting, the capability of system data transmission is greatly improved, and efficient transmission of data of each distributed node can be realized.
It will be appreciated that the technical solution shown in fig. 5 and the examples thereof may be implemented in the form of hardware or in the form of software functional modules, and the embodiments of the present invention are implemented in the form of software functional modules. If implemented as software functional parts, rather than being sold or used as a separate product, may be stored on a computer readable storage medium, based on the understanding that the technical solution of the present embodiment is essentially or partly contributing to the prior art or that all or part of the technical solution may be embodied in the form of a software product stored on a storage medium, comprising instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or processor (processor) to perform all or part of the steps of the method described in the present embodiment. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes. Accordingly, the present embodiment provides a computer storage medium storing a program for distributed communication based on GRPC and UDP broadcast, which when executed by at least one processor, implements the steps of the communication method of the distributed communication system based on GRPC and UDP broadcast in the above technical solution.
According to the above-described distributed communication apparatus based on GRPC and UDP broadcast and computer storage medium, referring to fig. 15, which shows a specific hardware structure of a computing device 1500 capable of implementing the above-described distributed communication apparatus based on GRPC and UDP broadcast provided by an embodiment of the present invention, the computing device 1500 may be a wireless apparatus, a mobile or cellular phone (including a so-called smart phone), a Personal Digital Assistant (PDA), a video game console (including a video display, a mobile video game apparatus, a mobile video conference unit), a laptop computer, a desktop computer, a television set-top box, a tablet computing apparatus, an electronic book reader, a fixed or mobile media player, or the like. The computing device 1500 includes: a communication interface 1501, a memory 1502 and a processor 1503; the various components are coupled together by a bus system 1504. It is to be appreciated that bus system 1504 is used to facilitate connection communications between these components. The bus system 1504 includes a power bus, a control bus, and a status signal bus in addition to the data bus. But for clarity of illustration, the various buses are labeled as bus system 1504 in fig. 15. Wherein,
the communication interface 1501 is configured to receive and send signals during the process of receiving and sending information with other external network elements;
The memory 1502 is used for storing a computer program capable of running on the processor 1503;
the processor 1503 is configured to execute the steps of the communication method of the distributed communication system based on GRPC and UDP broadcast in the foregoing technical solution when running the computer program.
It will be appreciated that the memory 1502 in embodiments of the invention can be either volatile memory or nonvolatile memory, or can include both volatile and nonvolatile memory. The nonvolatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable EPROM (EEPROM), or a flash Memory. The volatile memory may be random access memory (Random Access Memory, RAM) which acts as an external cache. By way of example, and not limitation, many forms of RAM are available, such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (Double Data Rate SDRAM), enhanced SDRAM (ESDRAM), synchronous DRAM (SLDRAM), and Direct RAM (DRRAM). The memory 1502 of the systems and methods described herein is intended to comprise, without being limited to, these and any other suitable types of memory.
While the processor 1503 may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in the processor 1503 or by instructions in the form of software. The processor 1503 described above may be a general purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components. The disclosed methods, steps, and logic blocks in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be embodied directly in the execution of a hardware decoding processor, or in the execution of a combination of hardware and software modules in a decoding processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in the memory 1502 and the processor 1503 reads the information in the memory 1502 and, in combination with its hardware, performs the steps of the method described above.
It is to be understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For a hardware implementation, the processing units may be implemented within one or more application specific integrated circuits (Application Specific Integrated Circuits, ASIC), digital signal processors (Digital Signal Processing, DSP), digital signal processing devices (DSP devices, DSPD), programmable logic devices (Programmable Logic Device, PLD), field programmable gate arrays (Field-Programmable Gate Array, FPGA), general purpose processors, controllers, microcontrollers, microprocessors, other electronic units designed to perform the functions described herein, or a combination thereof.
For a software implementation, the techniques described herein may be implemented with modules (e.g., procedures, functions, and so on) that perform the functions described herein. The software codes may be stored in a memory and executed by a processor. The memory may be implemented within the processor or external to the processor.
It will be appreciated that the exemplary solution of the computing device 1500 described above is the same concept as the solution of the foregoing communication method of a distributed communication system based on GRPC and UDP broadcast, and thus, for details of the foregoing solution of the computing device 1500 that are not described in detail, reference may be made to the description of the solution of the foregoing communication method of a distributed communication system based on GRPC and UDP broadcast. The embodiments of the present application will not be described in detail.
The foregoing is merely illustrative of the present invention, and the present invention is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A distributed communication system based on GRPC and UDP broadcast, the system comprising: the system comprises a plurality of user nodes, a GRPC process control and resource monitoring module, a GRPC client, a GRPC service node, a plurality of distributed nodes and a UDP broadcast data transmission and information interaction module; wherein,
the plurality of user nodes are used for sending requests for controlling and monitoring all the distributed nodes to the GRPC service node through the GRPC client and receiving returned system states of all the distributed nodes;
the GRPC process control and resource monitoring module is used for controlling the starting and stopping of the process and the resource monitoring;
the GRPC client is used for receiving the requests sent by the plurality of user nodes and forwarding the requests to the GRPC service node;
the GRPC service node receives and processes the request sent by the user node forwarded by the GRPC client, converts the request into a control command, sends the control command to each distributed node and receives the execution result of the control command of each distributed node;
The distributed nodes receive the control command and execute corresponding operation of the control command, and return an execution result to the GRPC service node and any one of the distributed nodes completes data transmission and information interaction based on UDP broadcast;
the UDP broadcast data transmission and information interaction module is used for enabling data transmission and information interaction between the distributed nodes based on UDP broadcast.
2. The system of claim 1, wherein the GRPC client and GRPC service node are deployed in software on each distributed node; the GRPC service node is also used for controlling and monitoring service resources through a GRPC control monitoring function of the GRPC service node, and the GRPC service node is the GRPC control monitoring node.
3. A system according to claim 1 or 2, wherein each of the GRPC service nodes corresponds to a distributed node.
4. A communication method of a distributed communication system based on GRPC and UDP broadcast, the method being applied to the system of any one of claims 1 to 3, the method comprising:
the user node sends a request for controlling and monitoring each distributed node to the GRPC service node;
The GRPC service node receives and processes the request and returns a response message, and a control command is sent to GRPC control monitoring nodes which are deployed in advance by the distributed nodes;
and each distributed node acquires a control command of the GRPC service node, executes corresponding operation of the control command, returns an execution result to the GRPC service node, and acquires data content issued by any one of the other distributed nodes by receiving UDP broadcast of any one of the distributed nodes so as to perform data transmission and information interaction.
5. The method of claim 4, wherein the GRPC service node receiving and processing the request and returning a response message, sending control commands to the pre-deployed GRPC control monitoring nodes of the distributed nodes, comprising:
the GRPC client calls a method in a corresponding service interface according to the code generated by the micro-service definition and transmits the request parameters and the return type to the GRPC service node through a protocol request message;
the GRPC service node receives and processes the protocol request message sent by the GRPC client, and realizes the method in the service interface according to the code generated by the micro-service definition, and sends the protocol request message to the GRPC client.
6. The method of claim 4, wherein the GRPC service node receiving and processing the request and returning a response message, sending control commands to the pre-deployed GRPC control monitoring nodes of the distributed nodes, comprising: and sending a control command to the GRPC control monitoring nodes which are deployed in advance by the GRPC service nodes, and completing the process control and the resource monitoring of the distributed nodes by the GRPC process control and resource monitoring modules, wherein the control command at least comprises a distributed communication process control command or a distributed node resource command.
7. The method of claim 6, wherein sending, by the GRPC service node, a control command to the GRPC control monitoring node pre-deployed for each distributed node, comprises:
respectively deploying GRPC control monitoring nodes on each distributed node;
receiving a control command of the GRPC service node by the GRPC control monitoring node;
and executing the corresponding operation of the control command, and sending the system state, the process state and the resource information of the distributed node corresponding to the GRPC control monitoring node to the GRPC service node.
8. The method of claim 4, wherein each of the distributed nodes obtains a control command of the GRPC service node and performs a corresponding operation of the control command, and returns an execution result to the GRPC service node, and obtains data contents published by any one of the other distributed nodes for data transmission and information interaction by receiving a UDP broadcast of any one of the distributed nodes, comprising:
the transmitting end transmits the data content through UDP broadcast; wherein the transmitting end is any one of the distributed nodes;
and the receiving end receives and analyzes the UDP broadcast, and acquires the data content to perform data transmission and information interaction.
9. A computing device, the computing device comprising: a communication interface, a processor, a memory, each coupled together by a bus system; wherein,
the communication interface is used for receiving and transmitting signals in the process of receiving and transmitting information with other external network elements;
the memory is used for storing a computer program capable of running on the processor;
the processor, when executing the computer program, is configured to perform the steps of the communication method of the distributed communication system based on GRPC and UDP broadcast as claimed in any one of claims 4 to 8.
10. A computer storage medium storing a program for distributed communication based on GRPC and UDP broadcast, which when executed by at least one processor implements the steps of the communication method of the distributed communication system based on GRPC and UDP broadcast of any one of claims 4 to 8.
CN202311188288.5A 2023-09-14 2023-09-14 Distributed communication system and communication method based on GRPC and UDP broadcast Pending CN117155810A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311188288.5A CN117155810A (en) 2023-09-14 2023-09-14 Distributed communication system and communication method based on GRPC and UDP broadcast

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311188288.5A CN117155810A (en) 2023-09-14 2023-09-14 Distributed communication system and communication method based on GRPC and UDP broadcast

Publications (1)

Publication Number Publication Date
CN117155810A true CN117155810A (en) 2023-12-01

Family

ID=88898713

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311188288.5A Pending CN117155810A (en) 2023-09-14 2023-09-14 Distributed communication system and communication method based on GRPC and UDP broadcast

Country Status (1)

Country Link
CN (1) CN117155810A (en)

Similar Documents

Publication Publication Date Title
CN113132376B (en) Media data processing method, device and system, electronic equipment and storage medium
Mumbaikar et al. Web services based on soap and rest principles
US9578081B2 (en) System and method for providing an actively invalidated client-side network resource cache
US8918452B2 (en) Web API framework
CN111479121B (en) Live broadcasting method and system based on streaming media server
US10389787B2 (en) Method, apparatus and system for transmitting media stream
CN105409183B (en) For realizing the system and equipment of any network function client or server in HTML5 is applied
Braun et al. Service-centric networking
KR101413295B1 (en) DDS structure and node composing DDS with scalability and adaptability
US11221981B2 (en) Asynchronous channel based bus architecture enabling decoupled services
US10389832B2 (en) Remote casting of media content
CN103348657B (en) Flow media playing method, equipment and system
US10133696B1 (en) Bridge, an asynchronous channel based bus, and a message broker to provide asynchronous communication
CN107231290A (en) A kind of instant communicating method and system
WO2023029961A1 (en) Task execution method and system, electronic device, and computer storage medium
US11843642B1 (en) Serverless signaling in peer-to-peer session initialization
US10740273B2 (en) Schema to ensure payload validity for communications on an asynchronous channel based bus
EP3399725B1 (en) Multimedia stream multicasting method and device
US10579577B2 (en) Bridge and asynchronous channel based bus to provide UI-to-UI asynchronous communication
CN113973052A (en) Cloud network system, data transmission method, computing node and storage medium
US20170142184A1 (en) Native client multimedia redirection
CN112673605B (en) Method, apparatus and computer program for dynamic multi-endpoint generation
CN117155810A (en) Distributed communication system and communication method based on GRPC and UDP broadcast
CN112532534B (en) Data transmission method, device and computer readable storage medium
Parr et al. A paradigm shift in the distribution of multimedia

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination