WO2015090250A1 - Procédé et dispositif de communication inter-processus - Google Patents

Procédé et dispositif de communication inter-processus Download PDF

Info

Publication number
WO2015090250A1
WO2015090250A1 PCT/CN2015/073166 CN2015073166W WO2015090250A1 WO 2015090250 A1 WO2015090250 A1 WO 2015090250A1 CN 2015073166 W CN2015073166 W CN 2015073166W WO 2015090250 A1 WO2015090250 A1 WO 2015090250A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
local
target
channel
data
Prior art date
Application number
PCT/CN2015/073166
Other languages
English (en)
Chinese (zh)
Inventor
徐翠屏
Original Assignee
腾讯科技(深圳)有限公司
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 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Publication of WO2015090250A1 publication Critical patent/WO2015090250A1/fr

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/21Monitoring or handling of messages
    • H04L51/23Reliability checks, e.g. acknowledgments or fault reporting

Definitions

  • the present invention relates to the field of computer technologies, and in particular, to a method and apparatus for inter-process communication.
  • Inter-process communication problems are often encountered during the development of network services. Inter-process communication is divided into process communication within the machine and process communication across machines. For process communication in the machine, it is generally used: pipeline, shared memory, message queue, Unix Socket (an operating system socket) and IPC (Inter-Process Communication). For process communication across machines, TCP (Transmission Control Protocol) / UDP (User Datagram Protocol) Socket (Socket) is generally used.
  • TCP Transmission Control Protocol
  • UDP User Datagram Protocol
  • Socket Socket
  • Embodiments of the present invention provide a method and apparatus for inter-process communication, which are used to improve development efficiency and reduce errors.
  • a method of interprocess communication including:
  • the target channel between the local node and the target node is a remote proxy channel between a local proxy node of the local node and a target proxy node of the target node. And transmitting, by the local proxy node of the local node, the to-be-sent data in the local shared storage space to a target proxy node of the target node by using the remote proxy channel.
  • a device for interprocess communication including:
  • a channel determining unit configured to determine, according to a target node to which the data to be sent of the local node is to be sent, a target channel between the local node and the target node;
  • a data writing unit configured to write the to-be-sent data into a local shared storage space corresponding to the target channel determined by the channel determining unit;
  • a sending unit configured to: if the target node is a remote node, the target channel between the local node and the target node is a local proxy node of the local node and a target proxy node of the target node And a remote proxy channel, by which the to-be-sent data in the local shared storage space is sent to a target proxy node of the target node by a local proxy node of the local node.
  • the embodiment of the present invention has the following advantages: the channel management scheme is adopted, and the cross-machine communication is realized through the proxy node, and the process that does not need to care about the communication is running on the same host or different hosts, so the developer does not need to Understand the mechanics and details of machine core cross-machine communication, so you can improve development efficiency and reduce errors.
  • FIG. 1 is a schematic flowchart of a method according to an embodiment of the present invention.
  • FIG. 2 is a schematic structural diagram of a system according to an embodiment of the present invention.
  • FIG. 3 is a schematic flowchart of a method according to an embodiment of the present invention.
  • FIG. 4 is a schematic flowchart of a method according to an embodiment of the present invention.
  • FIG. 5 is a schematic flowchart of a method according to an embodiment of the present invention.
  • FIG. 6 is a schematic flowchart of a method according to an embodiment of the present invention.
  • FIG. 7 is a schematic flowchart of a method according to an embodiment of the present invention.
  • FIG. 8 is a schematic structural view of an apparatus according to an embodiment of the present invention.
  • FIG. 9 is a schematic structural diagram of an apparatus according to an embodiment of the present invention.
  • FIG. 10 is a schematic structural diagram of an apparatus according to an embodiment of the present invention.
  • FIG. 11 is a schematic structural view of an apparatus according to an embodiment of the present invention.
  • FIG. 12 is a schematic structural diagram of an apparatus according to an embodiment of the present invention.
  • FIG. 13 is a schematic structural diagram of an apparatus according to an embodiment of the present invention.
  • Figure 14 is a schematic structural view of an apparatus according to an embodiment of the present invention.
  • FIG. 15 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
  • the embodiment of the invention provides a method for inter-process communication, as shown in FIG. 1 , including the following steps.
  • Step 102 Write the to-be-sent data into the local shared storage space corresponding to the target channel.
  • the embodiment of the present invention further provides a scheme for performing flow control, where the scheme performs the transmission control at the sending end of the data, as follows: the data to be sent is written into the local shared storage space corresponding to the determined target channel. Previously, it also included:
  • the transmission of data will continue. Once the state of the target channel changes to the pause state, this will indicate that the transmission speed exceeds the limit of the receiver and the transmission needs to be stopped.
  • the state of the target channel is specified by the receiving end, and a more detailed description will be given in the subsequent embodiments.
  • the target node is a remote node
  • the target channel between the local node and the target node is a remote end between a local proxy node of the local node and a target proxy node of the target node.
  • a proxy channel by using the remote proxy channel, to send the to-be-sent data in the local shared storage space to a target proxy node of the target node by using a local proxy node of the local node.
  • this embodiment may further include:
  • the target channel is a local channel between the local node and the target node, and the data to be sent written in the local shared storage space passes through the local Channel reception.
  • the channel management scheme is adopted, and the cross-machine communication is realized through the proxy node. You don't need to care about whether the communication process is running on the same host or a different host, so developers don't need to understand the mechanism and details of the machine core's communication between machines, so it can improve development efficiency and reduce errors.
  • the local device in the embodiment of the present invention refers to the device at the source end of the data to be sent.
  • the device can also be used as the receiving end of the data, and the embodiment of the present invention further provides The device is used as a solution used by the receiving end of the data, and performs flow control at the receiving end of the data, as follows:
  • the foregoing method further includes:
  • the proxy node receives data from the remote proxy node through the local proxy node and determining whether the received data has reached a local threshold of a channel between the local proxy node and the remote proxy node, and if so, to the remote end
  • the proxy node sends a pause indication message instructing the remote proxy node to suspend sending data to the home proxy node.
  • the local threshold is determined according to the storage space corresponding to the local target channel, and is used to prevent overflow.
  • the embodiment of the present invention further provides an implementation scheme for how to resume data transmission after the target channel is suspended (ie, after the data transmission is suspended) after the traffic control is performed, as follows:
  • the foregoing method further includes:
  • a recovery indication is sent to the remote proxy node, indicating that the remote proxy node continues to write data to the target channel.
  • the local target channel if it is not in the pause state, it should currently be in the process of sending data. If the local target channel is in the pause state, then there should be no data communication at present. In this case, it is necessary to determine under what circumstances to resume communication. In this embodiment, there is no data in the target channel, in fact, if the target It is also possible that the data amount of the channel is smaller than the total data capacity setting ratio of the target channel, which is not limited by the embodiment of the present invention.
  • the embodiment of the present invention further provides a node creation scheme, including a local node creation and a channel creation scheme according to the indication of the target proxy node, and the specific scheme is as follows: before determining the target channel according to the target node of the data to be sent, Also includes:
  • a local proxy node creates the local node and establishes a target channel between the local proxy node and the target proxy node, and allocates a local shared storage space for the target channel; or the local proxy node receives the target proxy node
  • the embodiment of the present invention further provides a technical solution for how to synchronize information of channels across devices, and uses proxy nodes to complete synchronization of channel information, as follows: before sending the data to be sent to the target proxy node through the local proxy node, Also includes:
  • Reading a configuration file determining an internet protocol address and a port number of the target proxy node, and establishing a transmission control protocol TCP connection between the local proxy node and the target proxy node by using the internet protocol address and a port number; Transmitting, by the TCP connection, channel information about the target channel created by the local proxy node to a target proxy node, so that the target proxy node establishes the target channel according to the channel information.
  • the embodiment of the present invention further provides a scheme for channel deletion, which is specifically as follows: the foregoing method further includes:
  • the channel between the local node and the remote node is closed, and the channel between the local node and the remote node is not used by other processes, and the local node and the remote node are destroyed.
  • the channel between the end nodes is destroyed.
  • the purpose of destroying the channel is to release the unnecessary storage space, and the specific operation may be to destroy the information in the storage space corresponding to the channel.
  • the process of destruction may be to release the storage space, such as memory, so that it can be used again, and does not necessarily need to perform storage space initialization.
  • the embodiment of the invention adopts a middleware scheme based on shared memory for inter-process communication. Developers can use it to easily exchange data between processes without worrying about whether the processes that need to exchange data are running on the same host or on different hosts. When processes are on the same host, data is transferred through shared memory; for processes on different hosts, the middleware transfers data to the remote host via the agent/agent via TCP/IP.
  • Host1 and host2 are two host devices; host1 contains two data sending and receiving points (peer), peer 1 and peer2, which belong to their respective processes; host2 contains two data sending and receiving points (peer), peer3 and The peer 4s are respectively in the process of the present invention; each of the hosts may include a plurality of processes, and each of the processes may include a plurality of peers.
  • FIG. 2 is only a schematic diagram and should not be construed as limiting the embodiments of the present invention.
  • the process in which the Agent is executing is a proxy service, which can be called a proxy node. The following sections describe the parts shown in Figure 2 in detail as follows:
  • the middleware is a client development package provided by the developer.
  • the development package is used to create a specific peer to receive and send messages.
  • Channel It is actually a shared memory.
  • the middleware creates a channel with the same name and binds to the peer. Each channel has a unique id, so there are multiple channel collections with the same channel name.
  • the peer receives data through this channel; when sending data, the middleware first finds the channel bound to the target peer and writes the data to the target channe.
  • the channel is divided into a local channel and a remote channel proxy.
  • the remote proxy channels shown in Figure 2 are: host2_channel4_proxy and host2_channel3_proxy in host1; host1_channel1_proxy and host1_channel2_proxy in host2.
  • Channel index actually a piece of shared memory. Store all The shared memory key (keyword) corresponding to the channel.
  • the peer's recv function (a function for receiving data from a connected datagram or streaming socket) is called each time. Receive a complete message.
  • the middleware mainly consists of two components:
  • the embodiment of the present invention is an inter-process communication middleware based on shared memory, and the data structure of the channel, the channel index, and the message in the shared memory is as follows:
  • the message is the basic unit of middleware data transmission.
  • the message will be reported as a data packet during the transmission process.
  • the maximum length of the data packet is 8K bytes.
  • the receiver will assemble these fragments into a complete message.
  • Table 3 The structure of the packet is shown in Table 3 below:
  • Channel creation The creation process of the channel is divided into a local channel actively created by the middleware client and a remote proxy channel created by the proxy service agent receiving the channel information transmitted from the peer end.
  • the process of the local channel actively created by the middleware client is as shown in FIG. 3, including:
  • Bind access channel index obtain the channel shm key and channel sem key corresponding to the peer
  • channel shm key and the channel sem key are keywords for identifying channel shm and channel sem respectively;
  • channel shm is a channel for receiving data, channel sem It is the channel used for searching.
  • This step initializes the storage space corresponding to the channel. As shown in Figure 2, channel1 to channel 4.
  • the proxy service agent receives the process of the remote proxy channel created by the channel information transmitted by the peer end, as shown in FIG. 4, including:
  • the agent receives the channel information sent by the peer end.
  • it may be channel information sent by the peer agent.
  • 402 Determine whether the channel corresponding to the received channel information exists, if yes, the process may end; otherwise, enter 403;
  • host2_channel4_proxy, host2_channel3_proxy, host1_channel1_proxy, and host1_channel2_proxy shown in Figure 2 are channels corresponding to the remote proxy peer.
  • Bind access channel index to obtain the channel shm key and channel sem key corresponding to the peer
  • the channel is created, the channel information is maintained in the memory, and the corresponding channel shared memory is created.
  • Cross-machine channel synchronization In this embodiment, it can be deployed as a front-end agent (agent) and a back-end agent.
  • the front-end agent needs to read remotehost.xml (the information of the remote host) to obtain all back-end agent information, including IP. (Internet Protocol Address) and Port (port) information, and actively establish a TCP connection with these backend agents for communication.
  • Host1 and host2 perform channel synchronization.
  • the specific process is shown in Figure 5. It includes:
  • 501A Read the configuration file to obtain the channel index configuration information that has been included in the Agent IP and the port.
  • the configuration file of the agent needs to include the following information:
  • channel corresponds to the maximum size of shared memory.
  • 503A Read remotehost.xml to obtain IP information of all peer Agents and ports;
  • 505A Obtain all new non-Agent created channels from the channel indx and send them to the peer agent.
  • 501B to 506B shown in FIG. 5 are steps completely corresponding to the above-described steps 501A to 506A, and will not be described again.
  • 603 Take the target channel from the channel list
  • 605 Determine whether the channel corresponding to the above shm is a local channel; if yes, enter 606, otherwise enter 607;
  • the local channel receives the data.
  • the remote proxy channel receives the data.
  • the proxy agent sends the data received by the remote proxy channel to the peer proxy agent.
  • the channel manager cyclically detects and reads whether there is data receiving in the channel created by the process, and refreshes the timestamp attribute (timestamp) of the channel every time, if there is data reception, To the user.
  • the local process can also obtain the channel created by other processes through the channel index, and periodically check whether the channel timestamp attribute (timestamp) is updated to determine whether the channel has been closed. If it is closed, the channel memory information will be destroyed. Refer specifically to the description of channel destruction in the subsequent embodiments.
  • multiple channels may be obtained through the target channel name, and one message channel is acquired each time as a target channel. This mechanism is also well-balanced.
  • the peer invokes the send method of the peer
  • 703 Determine whether the target channel is in a suspended state, if yes, suspend data transmission; if not, enter 704;
  • Agent 1 reads the remote channel sham data and sends it to the peer agent (Agent2).
  • the step is performed periodically: periodically determining that the channel state is paused and there is no data in the channel, the channel state is restored to normal.
  • the method of returning to the normal manner may be to send an indication message to the peer agent, indicating that the channel status is restored to normal.
  • Channel destruction in this embodiment the channel destruction rules are as follows:
  • the created peer is closed, and the corresponding channel memory information will be destroyed.
  • the channel may be used by multiple processes at the same time. Only all processes destroy the channel memory information, and the shared memory corresponding to the channel will be deleted from the system.
  • the present invention is a middleware solution for inter-process communication based on shared memory.
  • An embodiment of the present invention further provides an apparatus for inter-process communication, as shown in FIG. 8, including:
  • a channel determining unit 801 configured to determine, according to a target node to which the data to be sent of the local node is to be sent, a target channel between the local node and the target node;
  • a data writing unit 802 configured to write the to-be-sent data into a local shared storage space corresponding to the target channel determined by the channel determining unit;
  • a sending unit 804 configured to: if the target node is a remote node, the target channel between the local node and the target node is a local proxy node of the local node and a target proxy of the target node a remote proxy channel between the nodes, using the remote proxy channel
  • the local proxy node passing the local node transmits the to-be-sent data in the local shared storage space to a target proxy node of the target node.
  • the method may further include: a local channel unit 803, configured to: if the target node is another local node, the target channel is a local channel between the local node and the target node, Then, the data to be sent written in the local shared storage space is received through the local channel.
  • a local channel unit 803 configured to: if the target node is another local node, the target channel is a local channel between the local node and the target node, Then, the data to be sent written in the local shared storage space is received through the local channel.
  • the channel management scheme is adopted to implement cross-machine communication through the proxy node, and it is not necessary to care whether the communication process runs on the same host or different hosts, so the developer does not need to understand the mechanism and details of the inter-machine communication between the machine cores. This can improve development efficiency and reduce errors.
  • the local device in the embodiment of the present invention refers to the device at the source end of the data to be sent.
  • the device can also be used as the receiving end of the data, and the embodiment of the present invention further provides The device is used as a receiving end of the data, and performs flow control at the receiving end of the data, as follows:
  • the foregoing apparatus further includes:
  • the receiving unit 901 is configured to receive data from the remote proxy node by using the local proxy node;
  • a threshold determining unit 902 configured to determine whether the received data has reached a local threshold of a channel between the local proxy node and the remote proxy node;
  • the sending unit 804 is further configured to: after the threshold determining unit 902 determines that the received data has reached a local threshold of a channel between the local proxy node and the remote proxy node, then to the remote proxy node. Sending a pause indication message instructing the remote proxy node to suspend sending data to the home agent node.
  • the received data does not reach the local threshold of the target channel, then the data can continue to be received.
  • the above threshold is in accordance with the above local target
  • the local storage space corresponding to the track is determined to prevent overflow.
  • the embodiment of the present invention further provides an implementation scheme of how to resume data transmission after the target channel is suspended (ie, after the data transmission is suspended), as follows: As shown in FIG. 10, the foregoing apparatus further includes:
  • a first determining unit 1001 configured to determine whether a channel between the local proxy node and the remote proxy node is in a suspended state, and whether there is data
  • the sending unit 804 is further configured to: if the first determining unit 1001 determines that the channel between the local proxy node and the remote proxy node is in a suspended state and has no data, send a recovery indication to the remote proxy node. Instructing the remote proxy node to continue transmitting data to the home agent node.
  • the local target channel if it is not in the pause state, it should currently be in the process of sending data. If the local target channel is in the pause state, then there should be no data communication at present. In this case, it is necessary to determine under what circumstances to resume communication. In this embodiment, there is no data in the target channel, in fact, if the target It is also possible that the data amount of the channel is smaller than the total data capacity setting ratio of the target channel, which is not limited by the embodiment of the present invention.
  • the embodiment of the present invention further provides a scheme for performing flow control, where the scheme performs transmission control at a data sending end, as follows: as shown in FIG. 11, the foregoing apparatus further includes:
  • the second determining unit 1101 is configured to determine whether the target channel is in a suspended state before writing the to-be-sent data into the local shared storage space corresponding to the target channel;
  • the data writing unit 802 is further configured to: if the second determining unit 1101 determines that the target channel is not in a suspended state, write the to-be-sent data into the shared storage space corresponding to the determined target channel, otherwise stop the foregoing The shared memory space corresponding to the target channel writes data until the target channel returns to the non-suspended state.
  • the target channel if the target channel is not in the pause state, then the data will be sent. If the status of the target channel changes to a paused state, this will indicate that the transmission speed exceeds the receiver's limit and needs to stop sending.
  • the state of the target channel is specified by the receiving end, and a more detailed description will be given in the subsequent embodiments.
  • the embodiment of the present invention further provides a node creation scheme, including a local node creation and a channel creation scheme according to the indication of the peer proxy node.
  • a node creation scheme including a local node creation and a channel creation scheme according to the indication of the peer proxy node.
  • the node management unit 1201 is configured to create the local node and establish the local proxy before determining a target channel between the local node and the target node according to a target node to which the data to be sent of the local node is to be sent. a target channel between the node and the target proxy node, the local shared storage space is allocated to the target channel; or the channel information sent by the target proxy node is received, and if the channel information is not stored locally, the Target channel and monitor the target channel for data reception.
  • the embodiment of the present invention further provides a technical solution for how to synchronize the information of the channel across the device, and uses the proxy node to complete the synchronization of the channel information, as follows: As shown in FIG. 13, the foregoing apparatus further includes:
  • a synchronization management unit 1301 configured to send, by using the remote proxy channel, the to-be-sent data in the local shared storage space to a target proxy node of the target node by using a local proxy node of the local node, Reading a configuration file, determining an internet protocol address and a port number of the target proxy node, and establishing a transmission control protocol TCP connection between the local proxy node and the target proxy node by using the internet protocol address and a port number; Transmitting, by the TCP connection, channel information about the target channel created by the local proxy node to a target proxy node, so that the target proxy node establishes the target channel according to the channel information.
  • the embodiment of the present invention further provides a channel deletion scheme, which is specifically as follows: the synchronization management unit 1301 is further configured to: if the local node is closed, shut down the local node and the remote node. A channel between end nodes, and a channel between the local node and the remote node is not used by other processes, and the channel between the local node and the remote node is destroyed.
  • the purpose of destroying the channel is to release the unnecessary storage space, and the specific operation may be to destroy the information in the storage space corresponding to the channel.
  • the process of destruction may be to release the storage space, such as memory, so that it can be used again, and does not necessarily need to perform storage space initialization.
  • the embodiment of the present invention further provides an apparatus for inter-process communication, as shown in FIG. 14, comprising: a receiver 1401, a transmitter 1402, a processor 1403, and a memory 1404;
  • the processor 1403 is configured to determine, according to a target node to which the data to be sent of the local node is to be sent, a target channel between the local node and the target node, and write the to-be-sent data into the target channel.
  • a target node to which the data to be sent of the local node is to be sent
  • a target channel between the local node and the target node is a target proxy node of the local node and a target proxy node of the target node
  • a remote proxy channel by which the to-be-sent data in the local shared storage space is sent to a target proxy node of the target node by a local proxy node of the local node.
  • the processor 1403 may be further configured to: if the target node is another local node, the target channel is a local channel between the local node and the target node, and then write the local shared storage space. The data to be transmitted within is received through the local channel.
  • the channel management scheme is adopted to implement cross-machine communication through the proxy node, and it is not necessary to care whether the communication process runs on the same host or different hosts, so the developer does not need to understand the mechanism and details of the inter-machine communication between the machine cores. This can improve development efficiency and reduce errors.
  • the embodiment of the present invention further provides a scheme for performing flow control, where the scheme performs transmission control at a transmitting end of the data, as follows: the processor 1403 is further configured to write the to-be-sent data into the target. Before the channel corresponds to the local shared storage space, determine the location Whether the target channel is in a pause state; if the target channel is in a pause state, stopping writing data to the local shared storage space corresponding to the target channel until the target channel returns to a non-suspended state.
  • the transmission of data will continue. Once the state of the target channel changes to the pause state, this will indicate that the transmission speed exceeds the limit of the receiver and the transmission needs to be stopped.
  • the state of the target channel is specified by the receiving end, and a more detailed description will be given in the subsequent embodiments.
  • the local device in the embodiment of the present invention refers to the device at the source end of the data to be sent.
  • the device can also be used as the receiving end of the data, and the embodiment of the present invention further provides The device is used as a receiving end of the data, and performs flow control at the receiving end of the data, as follows: the processor 1403 is further configured to receive data from the remote proxy node through the local proxy node, and determine the received data. Whether the data has reached a local threshold of a channel between the local proxy node and the remote proxy node, and if so, sending a pause indication message to the remote proxy node, instructing the remote proxy node to suspend to the The local proxy node sends the data.
  • the received data does not reach the threshold of the local target channel, the data can continue to be received.
  • the above threshold is determined according to the storage space corresponding to the local target channel described above, and is used to prevent overflow.
  • the embodiment of the present invention further provides an implementation scheme of how to resume data transmission after the target channel is suspended (that is, after the data transmission is suspended) after the traffic control is performed, as follows: the processor 1403 is further configured to: if the local When the channel between the proxy node and the remote proxy node is in a suspended state and there is no data, a recovery indication is sent to the remote proxy node, indicating that the remote proxy node continues to send data to the local proxy node.
  • the local target channel if it is not in the pause state, it should currently be in the process of sending data. If the above local target channel is in the pause state, then it should be If there is no data communication, it is necessary to determine under what circumstances to resume communication. In this embodiment, there is no data in the target channel. In fact, if the data volume of the target channel is smaller than the total data capacity setting of the target channel. The ratio is also possible, and the embodiment of the invention does not limit this uniquely.
  • the embodiment of the present invention further provides a node creation scheme, including a local node creation and a channel creation scheme according to the indication of the peer proxy node.
  • the processor 1403 is further configured to be based on the local node. Before the target node to which the to-be-sent data is to be sent determines the target channel between the local node and the target node, create the local node, and establish a target between the local proxy node and the target proxy node Channel, the local shared storage space is allocated to the target channel; or, receiving channel information sent by the target proxy node, if the channel information is not stored locally, creating the target channel, and monitoring whether the target channel has Data reception.
  • the embodiment of the present invention further provides a technical solution for how to synchronize the information of the channel across the device, and uses the proxy node to complete the synchronization of the channel information.
  • the processor 1403 is further configured to use the remote proxy channel to pass the Before the local proxy node of the local node sends the to-be-sent data in the local shared storage space to the target proxy node of the target node, the configuration file is read, and the Internet Protocol address and port number of the target proxy node are determined.
  • the channel information is sent to the target proxy node, so that the target proxy node establishes the target channel according to the channel information.
  • the embodiment of the present invention further provides a channel deletion scheme, which is specifically as follows: the processor 1403 is further configured to: if the local node is closed, close a channel between the local node and the remote node, and the The channel between the local node and the remote node is not used by other processes, and the channel between the local node and the remote node is destroyed.
  • the purpose of destroying the channel is to release the unnecessary storage space, and the specific operation may be to destroy the information in the storage space corresponding to the channel.
  • the process of destruction may be to release the storage space, such as memory, so that it can be used again, and does not necessarily need to perform storage space initialization.
  • the embodiment of the present invention further provides a terminal.
  • a terminal As shown in FIG. 15 , for the convenience of description, only parts related to the embodiment of the present invention are shown. If the specific technical details are not disclosed, please refer to the method part of the embodiment of the present invention.
  • the terminal may be any terminal device including a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a POS (Point of Sales), an in-vehicle computer, and the terminal is a mobile phone as an example:
  • FIG. 15 is a block diagram showing a partial structure of a mobile phone related to a terminal provided by an embodiment of the present invention.
  • the mobile phone includes: a radio frequency (RF) circuit 1510 , a memory 1520 , an input unit 1530 , a display unit 1540 , a sensor 1550 , an audio circuit 1560 , a wireless fidelity (WiFi) module 1570 , and a processor 1580 .
  • RF radio frequency
  • the RF circuit 1510 can be used for receiving and transmitting signals during the transmission or reception of information or during a call. Specifically, after receiving the downlink information of the base station, the processing is processed by the processor 1580. In addition, the data designed for the uplink is sent to the base station.
  • RF circuit 1510 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like.
  • LNA Low Noise Amplifier
  • RF circuitry 1510 can also communicate with the network and other devices via wireless communication.
  • the above wireless communication may use any communication standard or protocol, including but not limited to Global System of Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (Code Division). Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), E-mail, Short Messaging Service (SMS), and the like.
  • GSM Global System of Mobile communication
  • GPRS General Packet Radio Service
  • CDMA Code Division Multiple Access
  • WCDMA Wideband Code Division Multiple Access
  • LTE Long Term Evolution
  • E-mail Short Messaging Service
  • the memory 1520 can be used to store software programs and modules, and the processor 1580 executes various functional applications and data processing of the mobile phone by running software programs and modules stored in the memory 1520.
  • the memory 1520 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application required for at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may be stored according to Data created by the use of the mobile phone (such as audio data, phone book, etc.).
  • memory 1520 can include high speed random access memory, and can also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
  • the input unit 1530 can be configured to receive input numeric or character information and to generate key signal inputs related to user settings and function controls of the handset.
  • the input unit 1530 may include a touch panel 1531 and other input devices 1532.
  • the touch panel 1531 also referred to as a touch screen, can collect touch operations on or near the user (such as the user using a finger, a stylus, or the like on the touch panel 1531 or near the touch panel 1531. Operation), and drive the corresponding connecting device according to a preset program.
  • the touch panel 1531 may include two parts: a touch detection device and a touch controller.
  • the touch detection device detects the touch orientation of the user, and detects a signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts the touch information into contact coordinates, and sends the touch information.
  • the processor 1580 is provided and can receive commands from the processor 1580 and execute them.
  • the touch panel 1531 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves.
  • the input unit 1530 may also include other input devices 1532.
  • other input devices 1532 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.), trackballs, mice, joysticks, and the like.
  • the display unit 1540 can be used to display information input by the user or information provided to the user as well as various menus of the mobile phone.
  • the display unit 1540 can include a display panel 1541.
  • the display panel 1541 can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
  • the touch panel 1531 may cover the display panel 1541. After the touch panel 1531 detects a touch operation on or near the touch panel 1531, the touch panel 1531 transmits to the processor 1580 to determine the type of the touch event, and then the processor 1580 according to the touch event. The type provides a corresponding visual output on display panel 1541.
  • touch panel 1531 and the display panel 1541 are used as two independent components to implement the input and input functions of the mobile phone in FIG. 15, in some embodiments, the touch panel 1531 and the display panel 1541 may be integrated. Realize the input and output functions of the phone.
  • the handset may also include at least one type of sensor 1550, such as a light sensor, motion sensor, and other sensors.
  • the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 1541 according to the brightness of the ambient light, and the proximity sensor may close the display panel 1541 and/or when the mobile phone moves to the ear. Or backlight.
  • the accelerometer sensor can detect the magnitude of acceleration in all directions (usually three axes). When it is stationary, it can detect the magnitude and direction of gravity.
  • the mobile phone can be used to identify the gesture of the mobile phone (such as horizontal and vertical screen switching, related Game, magnetometer attitude calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for the mobile phone can also be configured with gyroscopes, barometers, hygrometers, thermometers, infrared sensors and other sensors, no longer Narration.
  • the gesture of the mobile phone such as horizontal and vertical screen switching, related Game, magnetometer attitude calibration
  • vibration recognition related functions such as pedometer, tapping
  • the mobile phone can also be configured with gyroscopes, barometers, hygrometers, thermometers, infrared sensors and other sensors, no longer Narration.
  • An audio circuit 1560, a speaker 1561, and a microphone 1562 can provide an audio interface between the user and the handset.
  • the audio circuit 1560 can transmit the converted electrical data of the received audio data to the speaker 1561, and convert it into a sound signal output by the speaker 1561.
  • the microphone 1562 converts the collected sound signal into an electrical signal, and the audio circuit 1560. After receiving, it is converted into audio data, and then processed by the audio data output processor 1580, sent to, for example, another mobile phone via the RF circuit 1510, or outputted to the memory 1520 for further processing.
  • WiFi is a short-range wireless transmission technology.
  • the mobile phone through the WiFi module 1570 can help users to send and receive e-mail, browse the web and access streaming media, etc. It provides users with wireless broadband Internet access.
  • FIG. 15 shows the WiFi module 1570, it can be understood that it does not belong to the essential configuration of the mobile phone, and may be omitted as needed within the scope of not changing the essence of the invention.
  • the processor 1580 is a control center for the handset that connects various portions of the entire handset using various interfaces and lines, by executing or executing software programs and/or modules stored in the memory 1520, and invoking data stored in the memory 1520, The phone's various functions and processing data, so that the overall monitoring of the phone.
  • the processor 1580 may include one or more processing units; preferably, the processor 1580 may integrate an application processor and a modem processor, where the application processor mainly processes an operating system, a user interface, an application, and the like.
  • the modem processor primarily handles wireless communications. It will be appreciated that the above described modem processor may also not be integrated into the processor 1580.
  • the handset also includes a power source 1590 (such as a battery) that supplies power to the various components.
  • a power source 1590 such as a battery
  • the power source can be logically coupled to the processor 1580 via a power management system to manage functions such as charging, discharging, and power management through the power management system.
  • the mobile phone may further include a camera, a Bluetooth module, and the like, and details are not described herein again.
  • the processor 1580 included in the terminal further has the following functions:
  • the target node Determining, by the target node to which the data to be sent of the local node is to be sent, a target channel between the local node and the target node; and writing the to-be-sent data into a local shared storage space corresponding to the target channel;
  • the target node is a remote node, and the target channel between the local node and the target node is a remote proxy channel between a local proxy node of the local node and a target proxy node of the target node, And transmitting, by the local proxy node of the local node, the to-be-sent data in the local shared storage space to a target proxy node of the target node by using the remote proxy channel.
  • the processor 1580 also And if the target node is another local node, the target channel is a local channel between the local node and the target node, and the data to be sent in the local shared storage space is written. Local channel reception.
  • the channel management scheme is adopted to implement cross-machine communication through the proxy node, and it is not necessary to care whether the communication process runs on the same host or different hosts, so the developer does not need to understand the mechanism and details of the inter-machine communication between the machine cores. This can improve development efficiency and reduce errors.
  • the embodiment of the present invention further provides a scheme for performing flow control, where the scheme performs transmission control at the transmitting end of the data, as follows: the processor 1580 is further configured to write the to-be-sent data into the target. Before the local shared storage space corresponding to the channel, determining whether the target channel is in a suspended state, if yes, stopping writing data to the local shared storage space corresponding to the target channel until the target channel returns to a non-suspended state.
  • the transmission of data will continue. Once the state of the target channel changes to the pause state, this will indicate that the transmission speed exceeds the limit of the receiver and the transmission needs to be stopped.
  • the state of the target channel is specified by the receiving end, and a more detailed description will be given in the subsequent embodiments.
  • the local device in the embodiment of the present invention refers to the device at the source end of the data to be sent.
  • the device can also be used as the receiving end of the data, and the embodiment of the present invention further provides The device is used as a solution used by the receiving end of the data, and performs flow control at the receiving end of the data, as follows: the processor 1580 is further configured to receive data from the remote proxy node through the local proxy node, and determine the received data. Whether the data has reached a local threshold of a channel between the local proxy node and the remote proxy node, and if so, sending a pause indication message to the remote proxy node, instructing the remote proxy node to suspend to the The local proxy node sends the data.
  • the threshold of the target channel can continue to receive data.
  • the above threshold is determined according to the storage space corresponding to the local target channel described above, and is used to prevent overflow.
  • the embodiment of the present invention further provides an implementation scheme of how to resume data transmission after the target channel is suspended (ie, after the data transmission is suspended) after the traffic control is performed, as follows: the processor 1580 is further configured to be used if the local When the channel between the proxy node and the remote proxy node is in a suspended state and there is no data, a recovery indication is sent to the remote proxy node, indicating that the remote proxy node continues to send data to the local proxy node.
  • the local target channel if it is not in the pause state, it should currently be in the process of sending data. If the local target channel is in the pause state, then there should be no data communication at present. In this case, it is necessary to determine under what circumstances to resume communication. In this embodiment, there is no data in the target channel, in fact, if the target It is also possible that the data amount of the channel is smaller than the total data capacity setting ratio of the target channel, which is not limited by the embodiment of the present invention.
  • the embodiment of the present invention further provides a node creation scheme, including a local node creation and a channel creation scheme according to the indication of the peer proxy node, and the specific scheme is as follows: the processor 1580 is further configured to be based on the local node. Before the target node to which the to-be-sent data is to be sent determines the target channel between the local node and the target node, create the local node, and establish a target between the local proxy node and the target proxy node Channel, the local shared storage space is allocated to the target channel; or, receiving channel information sent by the target proxy node, if the channel information is not stored locally, creating the target channel, and monitoring whether the target channel has Data reception.
  • the processor 1580 is further configured to be based on the local node. Before the target node to which the to-be-sent data is to be sent determines the target channel between the local node and the target node, create the local node, and establish a target between the local proxy node and the target proxy node Channel, the local shared
  • the embodiment of the present invention further provides a technical solution for how to synchronize the information of the channel across the device, and uses the proxy node to complete the synchronization of the channel information.
  • the processor 1580 is further configured to use the remote proxy channel to pass the a local proxy node of the local node sends the to-be-sent data in the local shared storage space to a target proxy node of the target node And reading a configuration file, determining an internet protocol address and a port number of the target proxy node, and establishing a transmission control protocol TCP between the local proxy node and the target proxy node by using the internet protocol address and the port number And connecting, by the TCP connection, channel information about the target channel created by the local proxy node to a target proxy node, so that the target proxy node establishes the target channel according to the channel information.
  • the embodiment of the present invention further provides a channel deletion scheme, which is specifically as follows: the processor 1580 is further configured to: if the local node is closed, close a channel between the local node and the remote node, and the The channel between the local node and the remote node is not used by other processes, and the channel between the local node and the remote node is destroyed.
  • the purpose of destroying the channel is to release the unnecessary storage space, and the specific operation may be to destroy the information in the storage space corresponding to the channel.
  • the process of destruction may be to release the storage space, such as memory, so that it can be used again, and does not necessarily need to perform storage space initialization.
  • the included units are only divided according to functional logic, but are not limited to the foregoing division, as long as the corresponding functions can be implemented; in addition, the specific names of the functional units It is also for convenience of distinguishing from each other and is not intended to limit the scope of protection of the present invention.
  • the storage medium may be a read only memory, a magnetic disk or an optical disk or the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

L'invention concerne un procédé et un dispositif de communication inter-processus. Dans le procédé : un canal cible entre le nœud local et le nœud cible est déterminé d'après un nœud cible auquel des données d'un nœud local doivent être envoyées ; les données devant être envoyées sont écrites dans un espace de stockage local partagé correspondant au canal cible ; si le nœud cible est un nœud distant, le canal cible entre le nœud local et le nœud cible est un canal proxy distant entre un nœud proxy local du nœud local et un nœud proxy cible du nœud cible, et le canal proxy distant est utilisé pour envoyer les données devant être envoyées dans l'espace de stockage local partagé, au nœud proxy cible du nœud cible via le nœud proxy local du nœud local. Dans la présente solution, peu importe qu'un processus de communication soit en cours d'exécution sur un même hôte ou sur un hôte différent. Cela permet d'améliorer une efficacité de développement et de réduire des erreurs.
PCT/CN2015/073166 2013-12-16 2015-02-16 Procédé et dispositif de communication inter-processus WO2015090250A1 (fr)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310690566.7A CN104133728B (zh) 2013-12-16 2013-12-16 一种进程间通讯的方法、及装置
CN201310690566.7 2013-12-16

Publications (1)

Publication Number Publication Date
WO2015090250A1 true WO2015090250A1 (fr) 2015-06-25

Family

ID=51806413

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/073166 WO2015090250A1 (fr) 2013-12-16 2015-02-16 Procédé et dispositif de communication inter-processus

Country Status (3)

Country Link
CN (1) CN104133728B (fr)
TW (1) TWI528182B (fr)
WO (1) WO2015090250A1 (fr)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109766199A (zh) * 2018-12-29 2019-05-17 歌尔股份有限公司 一种机器人操作系统中的节点通信方法和装置

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104133728B (zh) * 2013-12-16 2015-07-22 腾讯科技(深圳)有限公司 一种进程间通讯的方法、及装置
CN106598756B (zh) * 2016-12-13 2020-06-16 重庆川仪自动化股份有限公司 不同应用程序之间的数据交互方法
DE102017201966A1 (de) * 2017-02-08 2018-08-09 Robert Bosch Gmbh Steuergerät für ein Kraftfahrzeug und entsprechendes Kraftfahrzeug
CN107608632B (zh) * 2017-09-21 2021-02-02 苏州浪潮智能科技有限公司 一种分布式存储集群的通信方法、装置及系统
CN107682460B (zh) * 2017-11-21 2021-01-12 苏州浪潮智能科技有限公司 一种分布式存储集群数据通信方法及系统
CN108667903B (zh) * 2018-04-03 2019-11-12 新华三技术有限公司 数据发送方法、装置和存储介质
CN111901490A (zh) * 2019-05-06 2020-11-06 鸿富锦精密电子(郑州)有限公司 资源共享方法、装置、计算机装置及存储介质
TWI791316B (zh) 2021-11-05 2023-02-01 財團法人工業技術研究院 實現程式間通訊的方法及系統
CN115883654A (zh) * 2022-11-29 2023-03-31 深圳市汇川技术股份有限公司 进程通信方法、装置、设备及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7095828B1 (en) * 2000-08-11 2006-08-22 Unisys Corporation Distributed network applications platform architecture
CN1842064A (zh) * 2005-03-29 2006-10-04 腾讯科技(深圳)有限公司 一种即时通信中数据传输的方法及系统
CN1859327A (zh) * 2006-02-09 2006-11-08 华为技术有限公司 一种消息传递的方法、装置和系统
CN104133728A (zh) * 2013-12-16 2014-11-05 腾讯科技(深圳)有限公司 一种进程间通讯的方法、及装置

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100547995C (zh) * 2004-06-30 2009-10-07 联想(北京)有限公司 一种网络中设备间的数据传输方法
CN101938484B (zh) * 2010-09-09 2013-05-15 奇智软件(北京)有限公司 一种分布式流量控制方法及系统
US9996403B2 (en) * 2011-09-30 2018-06-12 Oracle International Corporation System and method for providing message queues for multinode applications in a middleware machine environment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7095828B1 (en) * 2000-08-11 2006-08-22 Unisys Corporation Distributed network applications platform architecture
CN1842064A (zh) * 2005-03-29 2006-10-04 腾讯科技(深圳)有限公司 一种即时通信中数据传输的方法及系统
CN1859327A (zh) * 2006-02-09 2006-11-08 华为技术有限公司 一种消息传递的方法、装置和系统
CN104133728A (zh) * 2013-12-16 2014-11-05 腾讯科技(深圳)有限公司 一种进程间通讯的方法、及装置

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109766199A (zh) * 2018-12-29 2019-05-17 歌尔股份有限公司 一种机器人操作系统中的节点通信方法和装置
CN109766199B (zh) * 2018-12-29 2024-01-30 歌尔股份有限公司 一种机器人操作系统中的节点通信方法和装置

Also Published As

Publication number Publication date
TW201525698A (zh) 2015-07-01
TWI528182B (zh) 2016-04-01
CN104133728B (zh) 2015-07-22
CN104133728A (zh) 2014-11-05

Similar Documents

Publication Publication Date Title
WO2015090250A1 (fr) Procédé et dispositif de communication inter-processus
WO2018170833A1 (fr) Procédé de transmission de données de liaison montante, terminal, dispositif côté réseau, et système
WO2016150331A1 (fr) Procédé et dispositif d'exploitation d'un client de jeu
WO2018049887A1 (fr) Procédé de transmission de données et dispositif terminal
WO2018195924A1 (fr) Procédé de configuration de connexion de réseau et produit connexe
EP3179693B1 (fr) Procédé, dispositif, support de stockage et et produit programme informatique destinés à établir une connexion de données
WO2018049912A1 (fr) Procédé de transmission de données, et dispositifs associés
WO2019019182A1 (fr) Procédé de transmission de données et produit associé
CN107800585B (zh) 网络通信的方法和装置、推送消息的方法和装置
WO2018049971A1 (fr) Procédé de commutation de réseau à point d'accès sans fil et terminaux
WO2018049921A1 (fr) Procédé de traitement de transmission de données et dispositif associé
WO2017215511A1 (fr) Procédé de commande d'effet sonore de scène et produits associés
WO2018201411A1 (fr) Procédé de commande de transmission de demande de planification et produit associé
WO2018188278A1 (fr) Procédé d'attribution de ressources de mémoire et dispositif de terminal
WO2018049969A1 (fr) Procédé d'établissement de point d'accès sans fil et dispositif associé
WO2019028814A1 (fr) Procédé de commande de rapport de mesure et produit associé
WO2015062234A1 (fr) Procédé, dispositif et appareil de traitement de ressource de terminal mobile
WO2015062400A1 (fr) Procédé de gestion d'attribution de canal vidéo, dispositif associé, et système de communication
WO2018049968A1 (fr) Procédé d'établissement de zone d'accès sans fil et terminaux
TW201836330A (zh) 一種上行資料傳輸方法、終端、網路側設備及系統
WO2019028866A1 (fr) Procédé de transmission de données et produit associé
WO2018126407A1 (fr) Procédé et dispositif de transmission de données
WO2017166093A1 (fr) Système frontal
WO2018049896A1 (fr) Procédé et dispositif de transmission de données
WO2017049930A1 (fr) Procédé et terminal d'utilisation de ressources

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15729740

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 25.10.16)

122 Ep: pct application non-entry in european phase

Ref document number: 15729740

Country of ref document: EP

Kind code of ref document: A1