A multi-process multi-port data transmission method based on communication middleware

CN117319491BActive Publication Date: 2026-10-27上海零念科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311244310.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-25
Publication Date
2026-10-27
Estimated Expiration
2043-09-25

AI Technical Summary

Technical Problem

[0003]因此,在数据传输的过程中客户端主进程必然受到影响,且在数据传输量较大时,客户端无法及时处理数据,从而导致页面卡顿,在数据源端更改数据格式后,客户端也需要更新

Benefits of technology

[0012]本发明提出一种基于通信中间件的多进程多端口数据传输方法,增加了通信中间件,将通信部分从客户端剥离。由通信中间件接收解析处理数据,在数据源端发送的数据格式发生改变时,只需要更新通信中间件,从而保证客户端不受影响。通过在该方法中加入三次判断步骤,第一次判断客户端发送的请求是接收数据源端的数据还是停止接收数据源端的数据,第二次判断数据源端发送的数据的数据类型是否为客户端要求接收的数据类型,第三次判断是否已经有了发送该类型数据的数据子进程,通过以上三次判断步骤,实现了客户端可以通过向通信中间件发起http请求来控制数据,从而实现数据的按需发送,进而减少客户端接收到的数据量。同时因为通信中间件将接收到的数据按照类型分别创建进程,不同进程中建立的socket连接的端口号不同,所以提高数据传输效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117319491B_ABST
    Figure CN117319491B_ABST
Patent Text Reader

Abstract

The application provides a multi-process multi-port data transmission method based on communication middleware, adds the communication middleware, and separates the communication part from the client. The communication middleware receives and analyzes the data, and when the data format sent by the data source end changes, only the communication middleware needs to be updated, so that the client is not affected. The client can control the data by initiating an http request to the communication middleware, realize on-demand sending of the data, and reduce the amount of data received by the client. The communication middleware creates processes according to the types of the received data, and the port numbers of the socket connections established in different processes are different, so that the data transmission efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer data transmission technology, and specifically to a multi-process, multi-port data transmission method based on communication middleware. Background Technology

[0002] Currently, data transmission between the client and the data source occurs by establishing socket communication between the client's main process and the data source; that is, communication and program integration are integrated. When the data source transmits a piece of data, the client receives it. After receiving the data, the client's main process needs to process the data further before transmitting it to the rendering process.

[0003] Therefore, the client's main process will inevitably be affected during data transmission. When the data transmission volume is large, the client cannot process the data in a timely manner, resulting in page lag. After the data format is changed on the data source side, the client also needs to be updated. Summary of the Invention

[0004] The technical problems this invention aims to solve are: 1. Establishing socket communication between the client's main process and the data source affects the main process. After receiving data, the client needs to parse and process it before use. When the data format changes at the data source, the client needs to perform an update operation. 2. The data source mechanically sends data to the client without considering whether the client needs a certain type of data. The client receives a large amount of data that is not currently in use, causing page lag.

[0005] To address the aforementioned technical problems, the present invention provides a multi-process, multi-port data transmission method based on communication middleware. The client receives data to be transmitted from a data source through the communication middleware. The method includes the following steps: Step 1: The communication middleware receives a data request from the client and parses the request type. Step 2: The communication middleware determines, based on the request type, whether the data request is a client requesting the data source to send the data to be transmitted. Step 3: If the data request is a client requesting the data source to send the data to be transmitted, the communication middleware establishes a socket connection with the data source. Step 4: The communication middleware receives the data to be transmitted from the data source and parses some fields of the data to obtain the data type. Step 5: The communication middleware determines, based on the data type, whether the client requests data of that data type. Step 6: If the client requests data of that data type, the communication middleware parses the data to be transmitted to obtain the parsing result. Step 7: The communication middleware determines, based on the data type, whether a sub-process sending the data type exists. Step 8: If a subprocess exists that sends the data type, then the data parsing result from Step 6 is sent to the client through the subprocess connected to the client socket.

[0006] Preferably, step 3 further includes: if the data request is a request from the client to the data source to stop sending the data to be transmitted, then the communication middleware deletes the records of the current and past data requests and the subprocess.

[0007] Preferably, step 6 further includes: if the client does not request data of the data type, then return to step 4.

[0008] Preferably, step 8 further includes: if there is no subprocess for sending the data type, then create a subprocess and send the data parsing result from step 6 to the client through the subprocess connected to the client socket.

[0009] Preferably, the communication middleware creates a subprocess for each type of data, each subprocess sends one type of data, and the socket connection established in each subprocess uses a port number.

[0010] Preferably, in step 8, after the subprocess obtains the data parsing result, it establishes a socket connection with the client using an independent port number and sends the data parsing result to the client through the socket connection.

[0011] Preferably, the client can automatically call the communication middleware program upon startup, thereby starting the method.

[0012] This invention proposes a multi-process, multi-port data transmission method based on a communication middleware. By adding a communication middleware, the communication component is separated from the client. The communication middleware receives, parses, and processes data. When the data format sent from the data source changes, only the communication middleware needs to be updated, ensuring the client remains unaffected. This method incorporates three judgment steps: first, determining whether the client's request is to receive data from the data source or to stop receiving data from the data source; second, determining if the data type sent from the data source is the type the client requires; and third, determining if a data subprocess already exists to send that type of data. These three judgment steps allow the client to control data transmission by initiating HTTP requests to the communication middleware, enabling on-demand data sending and reducing the amount of data received by the client. Furthermore, because the communication middleware creates separate processes for each data type, and different processes establish socket connections with different port numbers, data transmission efficiency is improved. Attached Figure Description

[0013] Figure 1 Here is the flowchart for the main process of the communication middleware;

[0014] Figure 2 For communication middleware subprocess

[0015] Figure 3 This is the client-side flowchart. Detailed Implementation

[0016] The present invention will be further illustrated below with reference to specific embodiments. It should be understood that these embodiments are for illustrative purposes only and are not intended to limit the scope of the invention. Furthermore, it should be understood that after reading the teachings of this invention, those skilled in the art can make various alterations or modifications to the invention, and these equivalent forms also fall within the scope defined by the appended claims.

[0017] The relevant terms and concepts used in this invention are as follows:

[0018] 1. Socket communication: A convention or method for communication between computers. Through the socket convention, one computer can receive data from other computers and also send data to other computers.

[0019] 2. Script: An executable file written in a specific descriptive language according to a certain format.

[0020] 3. HTTP: Hypertext Transfer Protocol, is a simple request-response protocol that specifies what messages a client may send to a server and what kind of response it may receive.

[0021] 4. Communication middleware: In the following text, communication middleware refers to the program that receives data from the data source, parses it, and then passes it to the client.

[0022] 5. Client: The program used by the user.

[0023] This invention provides a multi-process, multi-port data transmission method based on communication middleware, used by a client to receive data to be transmitted from a data source through the communication middleware. For example... Figure 1 As shown, this embodiment uses a communication middleware as the execution subject to introduce the execution steps of the present invention.

[0024] First, the communication middleware listens for and receives HTTP data requests from clients. It then records these requests and parses their request types. Next, it determines the type of the HTTP request, specifically whether it's a client requesting the data source to send data to be transmitted. If the HTTP request from the client indicates a request to stop receiving data of the corresponding data type, the communication middleware deletes the record for that data type from both the current and historical records, and destroys any child processes created for that data type. If the request is a client requesting the data source to send data to be transmitted, the communication middleware establishes a socket connection with the data source after receiving the client's command to start sending data.

[0025] Through a socket connection, the communication middleware receives data to be transmitted from the data source and parses some fields of the data to determine its data type. Based on the data type, the middleware determines whether the client requests data of that type. If the client does not request data of the specified data type (i.e., the client requests data from the data source, but the data sent by the data source is not the requested data), the middleware re-receives the data from the data source. If the client requests data of the specified data type, the middleware performs complete data parsing and makes appropriate adjustments to obtain the parsed result.

[0026] The communication middleware determines whether a child process capable of sending data of the aforementioned data type exists based on the data type described above. If no child process capable of sending the aforementioned data type exists, the communication middleware creates a child process for the data of that type. For example... Figure 2As shown, if a child process exists that sends the aforementioned data types, the communication middleware transmits the parsing result to the child process via the main process. After receiving the data (parsing result) from the main process, the child process establishes a socket connection with the client using an independent port number and sends the data from the main process to the client via this socket connection. In other words, the parsing result is sent to the client through the child process connected to the client's socket. This embodiment designs the communication middleware to create a child process for each type of data, with each child process responsible for sending only one type of data. Each child process establishes a socket connection using a single port number to achieve efficient data transmission on demand. This effectively avoids page lag issues caused by sending all data using a single process when the client's data demand is high.

[0027] like Figure 3 As shown, this embodiment uses the client as the execution subject to describe the execution steps of the present invention. First, the client starts, at which point the communication middleware program is automatically invoked to start the service. Then, the current operation is determined, i.e., opening a window, closing a window, or preparing to start data. If preparing to start data, an HTTP data request is sent to inform the communication middleware to receive data from the data source. If choosing to close a window, an HTTP data request is sent to inform the communication middleware of the data type being closed.

[0028] If a window is selected to open, the client sends an HTTP data request to inform the communication middleware of the data type it should receive. The client then determines whether to send an HTTP data request to the communication middleware to inform it to receive the data to be transmitted from the data source.

[0029] If the client receives data to be transmitted from the data source, it notifies the communication middleware of this request via an HTTP data request. The client then receives and parses the data from the middleware's subprocess via a socket connection. In other words, the client parses the data to be transmitted from the middleware, obtains the parsed result, and parses it again. The parsed data is then sent to the rendering process. The rendering process determines whether it needs the data based on its data ID. If needed, it receives the data and reconnects via a socket connection to receive and parse data from the middleware's subprocess. If not needed, it does not receive the data and instead receives and parses the next data from the middleware's subprocess via a socket connection.

[0030] If the client does not receive data from the data source, it informs the communication middleware via an HTTP data request that it is not receiving data from the data source, and then reconnects via socket to receive and parse data from the communication middleware subprocess.

[0031] This invention proposes a multi-process, multi-port data transmission method based on a communication middleware. By adding a communication middleware, the communication component is separated from the client. The communication middleware receives, parses, and processes data. When the data format sent from the data source changes, only the communication middleware needs to be updated, ensuring the client remains unaffected. This method incorporates three judgment steps: first, determining whether the client's request is to receive data from the data source or to stop receiving data from the data source; second, determining if the data type sent from the data source is the type the client requires; and third, determining if a data subprocess already exists to send that type of data. These three judgment steps allow the client to control data transmission by initiating HTTP requests to the communication middleware, enabling on-demand data sending and reducing the amount of data received by the client. Furthermore, because the communication middleware creates separate processes for each data type, and different processes establish socket connections with different port numbers, data transmission efficiency is improved.

Claims

1. A multi-process, multi-port data transmission method based on communication middleware, characterized in that, The client receives data to be transmitted from the data source through a communication middleware. The method includes the following steps: Step 1: The communication middleware receives data requests from the client and parses the request type. Step 2: The communication middleware determines whether the data request is a client request for the data source to send data to be transmitted based on the request type. Step 3: If the data request is a client requesting the data source to send the data to be transmitted, the communication middleware establishes a socket connection with the data source. Step 4: The communication middleware receives the data to be transmitted from the data source and parses some fields of the data to obtain the data type; Step 5: The communication middleware determines whether the client requests data of the specified data type based on the data type. Step 6: If the client requests data of a certain data type, the communication middleware will parse the data to be transmitted and obtain the data parsing result. Step 7: The communication middleware determines whether a child process sending the data type exists based on the data type. Step 8: If a subprocess exists that sends the data type, then the data parsing result from Step 6 is sent to the client through the subprocess connected to the client's socket.

2. The multi-process, multi-port data transmission method based on communication middleware as described in claim 1, characterized in that, Step 3 further includes: if the data request is a request from the client to the data source to stop sending the data to be transmitted, then the communication middleware deletes the records of the current and past data requests and the subprocess.

3. The multi-process, multi-port data transmission method based on communication middleware as described in claim 1, characterized in that, Step 6 further includes: if the client does not request data of the specified data type, then return to step 4.

4. The multi-process, multi-port data transmission method based on communication middleware as described in claim 1, characterized in that, Step 8 further includes: if there is no subprocess for sending the data type, then create a subprocess and send the data parsing result from step 6 to the client through the subprocess connected to the client socket.

5. The multi-process, multi-port data transmission method based on communication middleware as described in claim 1, characterized in that, The communication middleware creates a subprocess for each type of data, and each subprocess sends one type of data. The socket connection established in each subprocess uses a port number.

6. The multi-process, multi-port data transmission method based on communication middleware as described in claim 5, characterized in that, In step 8, after the subprocess obtains the data parsing result, it establishes a socket connection with the client using an independent port number and sends the data parsing result to the client through the socket connection.

7. The multi-process, multi-port data transmission method based on communication middleware as described in claim 1, characterized in that, The client can automatically call the communication middleware program upon startup, thereby initiating the method.

Citation Information

Patent Citations

  • Security system and method for operating systems

    CN104885092A

  • Architecture, system and method for real-time web applications

    US20110125854A1