Socket protocol integrated communication system and method, equipment and medium
Through the integrated communication system of the socket protocol, load balancing and address mapping of the communication gateway module and data transmission module are used to solve the problem of unified access to socket protocols in industrial systems, efficient protocol identification and data transmission are achieved, and the system scalability and flexibility are improved.
Patent Information
- Application Number
- CN202510620130.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-14
- Publication Date
- 2025-07-18
AI Technical Summary
The lack of a unified socket protocol standard interface in existing industrial systems has led to high cost of customized development and high maintenance complexity, making it difficult to achieve rapid response and automatic adaptation at the protocol level.
An integrated communication system using socket protocol, including a communication gateway module, a data transmission module and an orchestration operation module, realizes the identification and data transmission of various socket protocols through load balancing and preset address mapping relationships, and supports point-to-point communication and internal load balancing.
It realizes unified integration of various socket protocols, reduces development costs, improves system scalability and flexibility, and supports fast access to new devices and automatic protocol adaptation.
Smart Images

Figure CN120343113A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of socket communication technology, and in particular, to an integrated communication system, method, device, and medium for a socket protocol. Background Art
[0002] With the rapid development of industrial informatization and Internet of Things technology, the data exchange between industrial devices, sensors, control systems, etc. is becoming increasingly frequent, and various communication protocols are emerging continuously. In practical applications, in order to meet different business requirements and device characteristics, the industrial field widely adopts the communication method based on Socket to achieve data transmission and interaction.
[0003] However, due to the large differences in data formats, communication mechanisms, data parsing methods, etc. among different manufacturers, different device types, and different application scenarios, there are a large number of customized Socket communication protocols in the current industrial system. These protocols usually have their own independent data structures, coding formats, message definitions, and interaction processes, lacking a unified standard interface and compatibility mechanism. When existing industrial platforms access these Socket protocols, they often need to develop adaptation logic separately for each protocol for customized docking. This point-to-point integration method not only has high development costs and large maintenance complexities, but also severely restricts the scalability and flexibility of the system. Especially when facing new devices or new protocols, the platform needs to redesign the access process, and it is difficult to achieve rapid response and automatic adaptation at the protocol level. Summary of the Invention
[0004] The present invention provides an integrated communication system, method, device, and medium for a socket protocol to solve the above technical problem that a general integration of various socket protocols cannot be provided.
[0005] In an embodiment of the present application, the present application provides an integrated communication system for a socket protocol, including: a communication gateway module, a data transmission module, and an orchestration operation module. The communication gateway module includes a proxy gateway and a load balancing gateway; the load balancing gateway is configured to generate an equilibrium control instruction to perform load balancing on a plurality of internal service nodes, and the internal service nodes are used to represent the nodes where the orchestration operation module and the data transmission module are located. The equilibrium control instruction includes an equilibrium transmission instruction and an equilibrium processing instruction; the proxy gateway is configured to receive initial message data from an external system, send the initial message data to a socket port in the corresponding data transmission module according to the equilibrium transmission instruction, and forward the target message data corresponding to the initial message data to the external system according to a preset address mapping relationship. The preset address mapping relationship is used to represent the corresponding relationship between the socket port and the communication address of the external system; the data transmission module is configured to route the initial message data to the corresponding orchestration operation module according to the equilibrium processing instruction and a preset port mapping relationship, and send the target message data received from the orchestration operation module to the proxy gateway. The preset port mapping relationship is used to represent the corresponding relationship between the socket port and the type of the socket protocol; the orchestration operation module is configured to respond to the initial message data, generate target message data, and send it to the data transmission module.
[0006] In an embodiment of the present application, the data transmission module includes: a data receiving unit, configured to monitor the initial message data of different socket ports, match the initial message data to the corresponding protocol processor according to a preset port mapping relationship and a first equilibrium instruction, and route the first message data to the corresponding orchestration operation module according to target protocol information and a second equilibrium instruction. The target protocol information and the first message data are obtained by the protocol processor performing protocol identification on the initial message data. The protocol processor has a corresponding relationship with the type of the socket protocol; a data sending unit, configured to receive target message data from the orchestration operation module, convert the communication address of the external system in the target message data into the gateway address of the proxy gateway, and send the converted target message data to the proxy gateway; wherein, the equilibrium processing instruction includes the first equilibrium instruction and the second equilibrium instruction, and the internal service node is further used to represent the service node corresponding to the protocol processor.
[0007] In an embodiment of the present application, the scheduling and running module includes: a socket server component for performing service identification on the first packet data; a data conversion component for performing format conversion on the packet data to be converted, where the packet data to be converted includes the first packet data after service identification and the second packet data generated based on the first packet data after format conversion; a socket client component for performing data encoding on the second packet data after format conversion to obtain target packet data and sending it to the data transmission module; wherein, data transmission between the socket server component, the data conversion component, and the socket client component is achieved through a service process.
[0008] In an embodiment of the present application, the integrated communication system further includes at least one of the following: a protocol management module for configuring a preset address mapping relationship between the integrated communication system and the external system, a preset port mapping relationship between the socket ports and the types of socket protocols in the data transmission module, communication protocol information of various socket protocols, and registering a socket connection between the integrated communication system and the external system; an orchestration configuration module for binding the registered socket connections to the socket server component and the socket client component respectively, and configuring the processing processes and processing methods of various components in the scheduling and running module, where the processing methods include configuring at least one of a service data structure and a data conversion format; a monitoring and alarm module for collecting corresponding monitoring metrics after embedding connection resource metrics of the socket connection and scheduling and running metrics of the scheduling and running module, and generating alarm information based on the monitoring metrics and a preset policy configuration.
[0009] In an embodiment of the present application, the number of the scheduling and running modules is multiple, and in response to the initial packet data, different or the same scheduling and running modules are used according to the type of the socket protocol and / or the service type of the initial packet data, and each scheduling and running module is located in a different or the same internal service node; the number of the communication gateway modules is two, the first communication gateway module is the primary communication gateway, and the second communication gateway module is the standby communication gateway.
[0010] In an embodiment of the present application, the present application provides an integrated communication method for a socket protocol, including: receiving initial message data from an external system through a proxy gateway, and sending the initial message data to a socket port in a corresponding data transmission module according to a load balancing instruction generated by a load balancing gateway; listening to the initial message data of the socket port, and routing the initial message data to a corresponding orchestration and operation module according to a preset port mapping relationship and a load balancing instruction generated by the load balancing gateway; generating target message data in response to the initial message data through the orchestration and operation module, and sending it to the data transmission module; sending the target message data to the proxy gateway through the data transmission module; forwarding the target message data to the external system through the proxy gateway according to a preset address mapping relationship; wherein, the preset port mapping relationship is used to represent the correspondence between the socket port and the type of the socket protocol, and the preset address mapping relationship is used to represent the correspondence between the socket port and the communication address of the external system.
[0011] In an embodiment of the present application, routing the initial message data to a corresponding orchestration and operation module according to a preset port mapping relationship and a load balancing instruction generated by the load balancing gateway includes: matching the received initial message data to a corresponding protocol processor according to the preset port mapping relationship and a first load balancing instruction; performing protocol identification on the initial message data through the protocol processor to obtain target protocol information and first message data; routing the first message data to a corresponding orchestration and operation module according to the target protocol information and a second load balancing instruction; wherein, the load balancing instruction generated by the load balancing gateway includes the first load balancing instruction and the second load balancing instruction, and the protocol processor has a corresponding relationship with the type of the socket protocol.
[0012] In an embodiment of the present application, sending the target message data to the proxy gateway includes: converting the communication address of the external system in the target message data into the gateway address of the proxy gateway; sending the converted target message data to the proxy gateway.
[0013] In an embodiment of the present application, generating target message data in response to the initial message data includes: performing service identification on the first message data; converting the format of the first message data after service identification, and generating second message data in response to the first message data after format conversion; converting the format of the second message data, and performing data encoding on the second message data after format conversion to obtain target message data.
[0014] In one embodiment of the present application, the present application provides an electronic device, which includes: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the electronic device implements the integrated communication method of the socket protocol as described in any one of the above embodiments.
[0015] In one embodiment of the present application, the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor of a computer, the computer executes the integrated communication method of the socket protocol as described in any one of the above embodiments.
[0016] Advantages of the embodiments of the present application: The present application provides an integrated communication system, method, device, and medium for the socket protocol. In the embodiments of the present application, point-to-point communication between the integrated communication system and an external system and load balancing of internal service nodes are achieved through two-layer gateways, and the problems of identification of various socket protocols and data transmission are solved through preset port mapping relationships and preset address mapping relationships, so that various socket protocols can be integrated and accessed.
[0017] It should be understood that the above general description and subsequent detailed description are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application. Obviously, the accompanying drawings in the following description are only some embodiments of the present application, and those of ordinary skill in the art can obtain other drawings based on these drawings without creative efforts. In the drawings:
[0019] Figure 1 Shows a schematic structural diagram of an integrated communication system according to an embodiment of the present application;
[0020] Figure 2 Shows a schematic diagram of the module architecture and overall process of an integrated communication system according to an embodiment of the present application;
[0021] Figure 3 Shows a schematic flowchart of an integrated communication method for a socket protocol according to an embodiment of the present application;
[0022] Figure 4 Shows a schematic implementation flowchart of an integrated communication method for a socket protocol according to an embodiment of the present application;
[0023] Figure 5The schematic diagram of the implementation process of the integrated communication method of the socket protocol according to another embodiment of the present application is shown;
[0024] Figure 6 The schematic diagram of the structure of the computer system of the electronic device suitable for implementing the embodiments of the present application is shown. Detailed implementation manners
[0025] The following uses specific specific examples to illustrate the implementation manners of the present application. Those skilled in the art can easily understand other advantages and effects of the present application from the content disclosed in this specification. The present application can also be implemented or applied through other different specific implementation manners. Various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that, without conflict, the following embodiments and the features in the embodiments can be combined with each other.
[0026] It should be noted that the diagrams provided in the following embodiments only illustrate the basic concept of the present application in a schematic manner. Therefore, only the components related to the present application are shown in the diagrams, rather than being drawn according to the number, shape, and size of the components in actual implementation. The form, quantity, and ratio of each component in its actual implementation can be an arbitrary change, and the layout form of its components may also be more complex.
[0027] In the following description, a large number of details are explored to provide a more thorough explanation of the embodiments of the present application. However, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present application difficult to understand.
[0028] In the related art, there is a technical problem that a general technology for integrating various socket protocols cannot be provided.
[0029] Please refer to Figure 1 , Figure 1 The schematic diagram of the structure of the integrated communication system according to an embodiment of the present application is shown. As Figure 1As shown in the figure, the integrated communication system includes: a communication gateway module 110, a data transmission module 120, and an orchestration and operation module 130. The communication gateway module 110 includes a proxy gateway 111 and a load balancing gateway 112. The load balancing gateway 112 is used to generate an equilibrium control instruction to perform load balancing on multiple internal service nodes. The internal service nodes are used to represent the nodes where the orchestration and operation module and the data transmission module are located. The equilibrium control instruction includes an equilibrium transmission instruction and an equilibrium processing instruction. The proxy gateway 111 is used to receive initial message data from an external system, send the initial message data to a socket port in the corresponding data transmission module according to the equilibrium transmission instruction, and forward the target message data corresponding to the initial message data to the external system according to a preset address mapping relationship. The preset address mapping relationship is used to represent the corresponding relationship between the socket port and the communication address of the external system. The data transmission module 120 is used to route the initial message data to the corresponding orchestration and operation module according to the equilibrium processing instruction and the preset port mapping relationship, and send the target message data received from the orchestration and operation module to the proxy gateway. The preset port mapping relationship is used to represent the corresponding relationship between the socket port and the type of the socket protocol. The orchestration and operation module 130 is used to respond to the initial message data, generate target message data, and send it to the data transmission module.
[0030] In an embodiment of the present application, an outer proxy gateway is built through a High Availability Proxy (HAProxy), and a fixed gateway address is provided to the outside through the proxy gateway to achieve point-to-point communication between the integrated communication system and the external system.
[0031] In an embodiment of the present application, the gateway address of the proxy gateway includes the IP address (Internet Protocol address) and the port address of the proxy gateway.
[0032] In an embodiment of the present application, the load balancing gateway can generate an equilibrium control instruction by monitoring the data volume received by the proxy gateway and the resource occupancy of the internal service nodes. Among them, an internal load balancing gateway can be built through HAProxy, so as to support the clustered deployment of internal service nodes.
[0033] In an embodiment of the present application, other technologies can also be selected to build the communication gateway module based on the type of the socket protocol, such as Traefik (dynamic application gateway) and Nginx (high-performance Web server).
[0034] In one embodiment of the present application, the number of orchestration operation modules is multiple, and the initial message data is responded to in different or the same orchestration operation modules according to the type of socket protocol and / or service type of the initial message data. Each orchestration operation module is located in a different or the same internal service node; the number of communication gateway modules is two, the first communication gateway module is the primary communication gateway, and the second communication gateway module is the standby communication gateway.
[0035] In one embodiment of the present application, failover is achieved through a primary / standby mechanism to ensure the stability of the communication gateway module.
[0036] In one embodiment of the present application, the data transmission module includes: a data receiving unit, which is used to listen for the initial message data on different socket ports, and according to the preset port mapping relationship and the first balancing instruction, match the initial message data to the corresponding protocol processor, and according to the target protocol information and the second balancing instruction, route the first message data to the corresponding orchestration operation module. The target protocol information and the first message data are obtained by the protocol processor performing protocol identification on the initial message data, and there is a corresponding relationship between the protocol processor and the type of socket protocol; a data sending unit, which is used to receive the target message data from the orchestration operation module, convert the communication address of the external system in the target message data into the gateway address of the proxy gateway, and send the converted target message data to the proxy gateway; wherein, the balancing processing instruction includes the first balancing instruction and the second balancing instruction, and the internal service node is also used to represent the service node corresponding to the protocol processor.
[0037] In one embodiment of the present application, in the data transmission module, the initial message data on different socket ports is listened for through a preset server and client framework, and the target message data is sent to the proxy gateway. Wherein, the preset server and client framework includes Netty.
[0038] In one embodiment of the present application, based on Netty, the socket port is listened for, the corresponding protocol processor is selected according to the preset port mapping relationship between the socket port and the type of socket protocol, the initial message data is subjected to protocol identification, and the first message data is routed to the corresponding orchestration operation module.
[0039] In one embodiment of the present application, the data receiving unit includes at least one protocol processor for processing the initial message data of the same type of socket protocol.
[0040] In one embodiment of the present application, the data receiving unit includes multiple protocol processors for processing the initial message data of different types of socket protocols.
[0041] In one embodiment of the present application, the protocol processor decodes the initial message data through preset encoding information, thereby realizing the protocol recognition of the initial message data, and obtaining the target protocol information and the first message data.
[0042] In one embodiment of the present application, the first message data is used to represent the service message content in the initial message data.
[0043] In one embodiment of the present application, the target protocol information includes the protocol header information, service identifier, status flag, message body field, etc. of the initial message data. Among them, the status flag is used to represent the integrity, correctness of the initial message data, and whether it is a heartbeat packet; the protocol header information includes the type of the socket protocol of the initial message data.
[0044] In one embodiment of the present application, the orchestration operation module is bound to the registered socket connection.
[0045] In one embodiment of the present application, according to the second balancing instruction, and the service identifier and / or the type of the socket sub-protocol, the first message data is routed to the corresponding orchestration operation module.
[0046] In one embodiment of the present application, the communication address of the external system includes the IP address and port address of the external system.
[0047] In one embodiment of the present application, the orchestration operation module includes: a socket server component, which is used to perform service recognition on the first message data; a data conversion component, which is used to perform format conversion on the message data to be converted, and the message data to be converted includes the first message data after service recognition and the second message data generated based on the first message data after format conversion; a socket client component, which is used to perform data encoding on the second message data after format conversion to obtain the target message data and send it to the data transmission module; among them, data transmission is realized between the socket server component, the data conversion component and the socket client component through the service process.
[0048] In one embodiment of the present application, the orchestration operation module further includes an execution service component, which is used to respond to the first message data after format conversion and generate the second message data; the number of execution service components is at least one.
[0049] In one embodiment of the present application, for the same type of socket protocol, the first packet data of different service types can be processed by different orchestration operation modules respectively, and each orchestration operation module includes an execution service component corresponding to the service type; the first packet data of different service types can also be processed by the same orchestration operation module, and this orchestration operation module includes multiple execution service components to respond to the first packet data of different service types. Among them, different orchestration operation modules can be located on different internal service nodes or on the same service node.
[0050] In one embodiment of the present application, the first packet data for different types of socket protocols is processed by different orchestration operation modules. Among them, different orchestration operation modules can be located on different internal service nodes or on the same service node.
[0051] In one embodiment of the present application, the business processes between various components are executed through a preset rule engine and process orchestration framework. Among them, the preset rule engine and process orchestration framework include the LiteFlow orchestration engine.
[0052] In one embodiment of the present application, the socket server component identifies the service information of the first packet data through a pre-configured business data structure. The data conversion component performs format conversion on the first packet data after service identification through a pre-configured data conversion format.
[0053] In one embodiment of the present application, the integrated communication system further includes at least one of the following: a protocol management module, which is used to configure the preset address mapping relationship between the integrated communication system and an external system, the preset port mapping relationship between the socket ports and the types of socket protocols in the data transmission module, the communication protocol information of various socket protocols, and register the socket connection between the integrated communication system and the external system; an orchestration configuration module, which is used to bind the registered socket connections to the socket server component and the socket client component respectively, and configure the processing processes and processing methods of various components in the orchestration operation module, and the processing methods include configuring at least one of the business data structure and the data conversion format; a monitoring and alarm module, which is used to collect the corresponding monitoring metrics after collecting the connection resource metrics of the socket connection and the orchestration operation metrics of the orchestration operation module, and generate alarm information based on the monitoring metrics and the preset policy configuration.
[0054] In one embodiment of the present application, the connection resource metrics include the number of connection failures, the success rate of data transmission, and the number of communication times, etc.
[0055] In one embodiment of the present application, the orchestration operation metrics include the number of executions, the success rate, and the elapsed time, etc.
[0056] In one embodiment of the present application, monitoring metrics are collected through Promethues (an open-source system monitoring and alert toolkit), and the monitoring metrics include connection resource metrics and orchestration operation metrics.
[0057] In one embodiment of the present application, the monitoring metrics are persisted into a time series database, and then PromQL (the query language of Promethues) is used for metric aggregation query. Finally, the monitoring metrics are presented to the business users through Echart (a visualization chart library), and alarm information is sent based on the preset policy configuration.
[0058] In one embodiment of the present application, in the protocol management module, routing capabilities from the internal service nodes of the integrated communication system to external systems are provided by configuring the IP address and port address of the integrated communication system, as well as the preset address mapping relationship.
[0059] In one embodiment of the present application, the communication protocol information includes protocol name, message structure, transport layer protocol, etc. The transport layer protocol includes Transmission Control Protocol (TCP) or User Datagram Protocol (UDP). The communication protocol information is configured to support various customized socket protocols.
[0060] In one embodiment of the present application, registering the socket protocol includes configuring the IP address and port address of both communication parties, heartbeat detection configuration, encoding method, etc., for use in the orchestration operation module.
[0061] In one embodiment of the present application, in the orchestration configuration module, a socket connection is bound in the socket server component so that when the initial message data is received, it can be matched to the corresponding orchestration operation module for processing; a socket connection is bound in the socket client component so that the target message data can be sent to the specified external system; by configuring the business data structure of the initial message data in the socket server component and the data conversion format in the data conversion component, the business recognition and format conversion of the initial message data are realized.
[0062] In one embodiment of the present application, please refer to Figure 2 , Figure 2 shows the module architecture and overall process schematic diagram of the integrated communication system according to one embodiment of the present application. As Figure 2As shown in the figure, the integrated communication system includes a communication gateway module 210, a data transmission module 220, an orchestration operation module 230, a protocol management module 240, an orchestration configuration module 250, and a monitoring and alerting module 260. The communication gateway module 210 includes a proxy gateway 211 and a load balancing gateway 212; the load balancing gateway 212 generates an equalization processing instruction by monitoring the data volume received by the proxy gateway 211 and the resource occupancy of the internal service nodes, so as to send the initial message data to the socket port in the corresponding data transmission module. The data transmission module 220 includes a data receiving unit 221 and a data sending unit 222; the data receiving unit 221 listens through a port and matches the protocol processor corresponding to the initial message data to obtain the target protocol information and the first message data, so as to route the first message data to the corresponding orchestration operation module; the data sending unit 222 is used to convert the communication address of the external system in the target message data into the gateway address of the proxy gateway, and send the converted target message data to the proxy gateway through a data sender; the data transmission module 220 depends on the protocol management module 240 to configure a preset address mapping relationship, a preset port mapping relationship, communication protocol information, and a registered socket connection. The orchestration operation module 230 includes a socket server component 231, a data conversion component 232, and a socket client component 233; the function of responding to the initial message data, generating the target message data, and sending the target message data to the data transmission module 220 is implemented through the orchestration operation module 230; the orchestration operation module 230 depends on the orchestration configuration module 250 to implement the binding configuration of the socket server component, the socket client component, and the socket connection, and configure the processing flow and processing method of each component; the monitoring and alerting module 260 monitors the connection resource metrics and the orchestration operation metrics to implement the alerting of the integrated communication system.
[0063] Please refer to Figure 3 , Figure 3 shows a schematic flow chart of an integrated communication method for a socket protocol according to an embodiment of the present application. As Figure 3 shown, in an exemplary embodiment, the integrated communication method for the socket protocol at least includes steps S310 to S350, which are introduced in detail as follows:
[0064] Step S310, receiving the initial message data of the external system through the proxy gateway, and sending the initial message data to the socket port in the corresponding data transmission module according to the equalization transmission instruction generated by the load balancing gateway.
[0065] Step S320, listening to the initial message data of the socket port, and routing the initial message data to the corresponding orchestration operation module according to the preset port mapping relationship and the equalization processing instruction generated by the load balancing gateway.
[0066] Among them, the preset port mapping relationship is used to represent the correspondence between the socket port and the type of socket protocol.
[0067] In an embodiment of the present application, according to the load balancing gateway and the preset port mapping relationship to generate the balancing processing instruction, the initial message data is routed to the corresponding orchestration operation module, including: according to the preset port mapping relationship and the first balancing instruction, the received initial message data is matched to the corresponding protocol processor; the protocol processor performs protocol identification on the initial message data to obtain the target protocol information and the first message data; according to the target protocol information and the second balancing instruction, the first message data is routed to the corresponding orchestration operation module; wherein, the balancing processing instruction generated by the load balancing gateway includes the first balancing instruction and the second balancing instruction, and there is a corresponding relationship between the protocol processor and the type of socket protocol.
[0068] Step S330, the orchestration operation module responds to the initial message data, generates target message data, and sends it to the data transmission module.
[0069] In an embodiment of the present application, responding to the initial message data to generate target message data includes: performing service identification on the first message data; converting the format of the first message data after service identification, and responding to the first message data after format conversion to generate the second message data; converting the format of the second message data, and performing data encoding on the second message data after format conversion to obtain the target message data.
[0070] Step S340, the data transmission module sends the target message data to the proxy gateway.
[0071] In an embodiment of the present application, sending the target message data to the proxy gateway includes: converting the communication address of the external system in the target message data into the gateway address of the proxy gateway; sending the converted target message data to the proxy gateway.
[0072] Step S350, the proxy gateway forwards the target message data to the external system according to the preset address mapping relationship.
[0073] Among them, the preset address mapping relationship is used to represent the correspondence between the socket port and the communication address of the external system.
[0074] In an embodiment of the present application, please refer to Figure 4 , Figure 4 shows the schematic diagram of the implementation process of the integrated communication method of the socket protocol according to an embodiment of the present application. As Figure 4As shown in the figure, an external system sends a socket request to the integrated communication system; the proxy gateway receives the initial message data, and selects a corresponding internal service node in the service cluster through the load balancing gateway to send the initial message data to the socket port in the data receiving module; the corresponding protocol processor is matched through a preset port mapping relationship and a first balancing instruction. For example, for the A-type socket protocol, the A_1 protocol processor or the A_2 protocol processor can be selected to identify the protocol of the initial message data. For the B-type socket protocol, the B protocol processor is used to identify the protocol of the initial message data to obtain the target protocol information and the first message data; Orchestration routing: According to the target protocol information and the second balancing instruction, route the first message data to the corresponding orchestration operation module: Execute orchestration: Execute the business processes of the socket server component, the format conversion component, and the execution business component to respond to the initial message data; Perform service identification on the first message data through the socket server component; Perform format conversion on the first message data after service identification through the format conversion component; Respond to the first message data after format conversion through the execution business component to generate the second message data.
[0075] In an embodiment of the present application, please refer to Figure 5 , Figure 5 shows a schematic diagram of the implementation process of the integrated communication method for the socket protocol according to another embodiment of the present application. As Figure 5 shown, execute orchestration: Execute the business processes of the format conversion component and the socket client component to generate and send the target message data; Perform format conversion on the second message data through the format conversion component; Encode the second message data after format conversion through the socket client component to obtain the target message data, and send it to the proxy gateway; Forward the target message data to the external system through the proxy gateway.
[0076] The configuration functions provided by the protocol management module and the orchestration configuration module in the present application can both be configured in a visual manner on the web interface; the present application supports point-to-point communication with external systems with a fixed gateway address, supports automatic primary and standby switching of the communication gateway module, and supports cluster deployment of internal service nodes through the load balancing gateway to achieve overall high availability, high stability, and high concurrency; the present application supports accessing and integrating different types of socket protocols in a general manner.
[0077] An embodiment of the present application also provides an electronic device, including: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the electronic device implements the integrated communication method for the socket protocol provided in each of the above embodiments.
[0078] Please refer to Figure 6 , Figure 6The figure shows a schematic structural diagram of a computer system of an electronic device suitable for implementing the embodiments of the present application. It should be noted that Figure 6 The computer system 600 of the shown electronic device is only an example and should not impose any limitations on the functions and usage scope of the embodiments of the present application.
[0079] As Figure 6 shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 602 or the program loaded from the storage section 608 into the random access memory (RAM) 603, such as executing the methods in the above embodiments. In the RAM 603, various programs and data required for system operations are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0080] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed so that a computer program read from it can be installed into the storage section 608 as needed.
[0081] Specifically, according to the embodiments of the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments of the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication section 609, and / or installed from the removable medium 611. When the computer program is executed by the central processing unit (CPU) 601, various functions defined in the system of the present application are executed.
[0082] It should be noted that the computer-readable medium shown in the embodiments of the present application may be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as a part of a carrier wave, which carries a computer-readable computer program. Such a propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium may be transmitted by any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0083] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present application. Among them, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the above module, program segment, or part of code contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order from that marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and the combination of blocks in the block diagram or flowchart, may be implemented by a dedicated hardware-based system for performing the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.
[0084] The units involved in the embodiments described in this application can be implemented in software or in hardware, and the described units can also be provided in a processor. Among them, the names of these units do not, in some cases, constitute a limitation on the units themselves. Therefore, the technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiments of this application.
[0085] Another aspect of this application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor of a computer, it enables the computer to execute the integrated communication method of the socket protocol provided in each of the above embodiments. The computer-readable storage medium can be included in the electronic device described in the above embodiments, or can exist alone without being assembled into the electronic device.
[0086] In the above embodiments, unless otherwise specified, when using serial numbers such as "first" and "second" to describe a common object, it only indicates different instances of the same object, rather than indicating that the object to be described must be in a given order, whether in terms of time, space, sorting, or any other way.
[0087] The above embodiments only exemplarily illustrate the principles and effects of this application, rather than limiting this application. Any person familiar with this technology can modify or change the above embodiments without departing from the spirit and scope of this application. Therefore, all equivalent modifications or changes completed by those with ordinary knowledge in the technical field without departing from the spirit and technical ideas disclosed in this application should still be covered by the claims of this application.
Claims
1. An integrated communication system for a socket protocol, characterized in that, The integrated communication system includes: a communication gateway module, a data transmission module, and an orchestration and operation module. The communication gateway module includes a proxy gateway and a load balancing gateway; The load balancing gateway is used to generate an equilibrium control instruction to perform load balancing on multiple internal service nodes, where the internal service nodes are used to represent the nodes where the orchestration and operation module and the data transmission module are located. The equilibrium control instruction includes an equilibrium transmission instruction and an equilibrium processing instruction; The proxy gateway is used to receive initial message data from an external system, send the initial message data to a socket port in the corresponding data transmission module according to the equilibrium transmission instruction, and forward the target message data corresponding to the initial message data to the external system according to a preset address mapping relationship. The preset address mapping relationship is used to represent the corresponding relationship between the socket port and the communication address of the external system; The data transmission module is used to route the initial message data to the corresponding orchestration and operation module according to the equilibrium processing instruction and a preset port mapping relationship, and send the target message data received from the orchestration and operation module to the proxy gateway. The preset port mapping relationship is used to represent the corresponding relationship between the socket port and the type of socket protocol; The orchestration and operation module is used to respond to the initial message data, generate target message data, and send it to the data transmission module.
2. The integrated communication system of the socket protocol according to claim 1, characterized in that, The data transmission module includes: A data receiving unit, which is used to monitor the initial message data of different socket ports, match the initial message data to the corresponding protocol processor according to the preset port mapping relationship and the first equilibrium instruction, and route the first message data to the corresponding orchestration and operation module according to the target protocol information and the second equilibrium instruction. The target protocol information and the first message data are obtained by the protocol processor performing protocol identification on the initial message data. The protocol processor has a corresponding relationship with the type of socket protocol; A data sending unit, which is used to receive the target message data from the orchestration and operation module, convert the communication address of the external system in the target message data into the gateway address of the proxy gateway, and send the converted target message data to the proxy gateway; Wherein, the equilibrium processing instruction includes the first equilibrium instruction and the second equilibrium instruction, and the internal service nodes are also used to represent the service nodes corresponding to the protocol processor.
3. The integrated communication system of the socket protocol according to claim 2, wherein The orchestration and operation module includes: A socket server component, which is used to perform service identification on the first message data; A data conversion component, which is used to perform format conversion on the message data to be converted. The message data to be converted includes the first message data after service identification and the second message data generated based on the first message data after format conversion; A socket client component, which is used to perform data encoding on the second message data after format conversion to obtain target message data, and send it to the data transmission module; Wherein, data transmission is realized among the socket server component, the data conversion component and the socket client component through a service process.
4. The integrated communication system of the socket protocol according to claim 3, wherein, The integrated communication system further includes at least one of the following: A protocol management module, configured to configure a preset address mapping relationship between the integrated communication system and the external system, a preset port mapping relationship between the socket port and the type of socket protocol in the data transmission module, communication protocol information of various socket protocols, and register a socket connection between the integrated communication system and the external system; An orchestration configuration module, configured to bind the registered socket connections to the socket server component and the socket client component respectively, and configure the processing flows and processing methods of various components in the orchestration operation module, where the processing methods include at least one of configuring a service data structure and a data conversion format; A monitoring and alarm module, configured to collect corresponding monitoring metrics after embedding the connection resource metrics of the socket connection and the orchestration operation metrics of the orchestration operation module, and generate alarm information based on the monitoring metrics and preset policies.
5. The integrated communication system of the socket protocol according to any one of claims 1-4, characterized in that, The number of the orchestration operation modules is multiple, and in response to the initial message data, the initial message data is processed in different or the same orchestration operation modules according to the type of the socket protocol and / or the service type of the initial message data, and each of the orchestration operation modules is located in different or the same internal service nodes; The number of the communication gateway modules is two, the first communication gateway module is the primary communication gateway, and the second communication gateway module is the standby communication gateway.
6. An integrated communication method for a socket protocol, characterized in that, The integrated communication method includes: Receiving initial message data from an external system through a proxy gateway, and sending the initial message data to a socket port in a corresponding data transmission module according to an equalization transmission instruction generated by a load balancing gateway; Listening for the initial message data on the socket port, and routing the initial message data to a corresponding orchestration operation module according to a preset port mapping relationship and an equalization processing instruction generated by the load balancing gateway; Responding to the initial message data through the orchestration operation module to generate target message data, and sending the target message data to the data transmission module; Sending the target message data to the proxy gateway through the data transmission module; Forwarding the target message data to the external system through the proxy gateway according to a preset address mapping relationship; Wherein, the preset port mapping relationship is used to represent the corresponding relationship between the socket port and the type of socket protocol, and the preset address mapping relationship is used to represent the corresponding relationship between the socket port and the communication address of the external system.
7. The integrated communication method of the socket protocol according to claim 6, characterized in that, Routing the initial message data to a corresponding orchestration operation module according to a preset port mapping relationship and an equalization processing instruction generated by the load balancing gateway includes: Matching the received initial message data to a corresponding protocol processor according to a preset port mapping relationship and a first equalization instruction; Performing protocol identification on the initial message data through the protocol processor to obtain target protocol information and first message data; Routing the first message data to a corresponding orchestration operation module according to the target protocol information and a second equalization instruction; Among them, the load balancing gateway-generated balancing processing instructions include the first balancing instruction and the second balancing instruction, and there is a corresponding relationship between the protocol processor and the type of the socket protocol.
8. The integrated communication method of the socket protocol according to claim 7, wherein Sending the target packet data to the proxy gateway includes: Converting the communication address of the external system in the target packet data into the gateway address of the proxy gateway; Sending the converted target packet data to the proxy gateway.
9. The integrated communication method of the socket protocol according to claim 7, characterized in that Responding to the initial packet data to generate target packet data includes: Performing service identification on the first packet data; Converting the format of the first packet data after service identification, and generating second packet data in response to the first packet data after format conversion; Converting the format of the second packet data, and performing data encoding on the second packet data after format conversion to obtain the target packet data.
10. An electronic device, characterized in that, The electronic device includes: One or more processors; A storage device for storing one or more programs, which when executed by the one or more processors, enable the electronic device to implement the integrated communication method of the socket protocol as described in any one of claims 6 to 9.
11. A computer-readable storage medium, characterized in that, A computer program is stored thereon, which when executed by the processor of the computer, causes the computer to execute the integrated communication method of the socket protocol as described in any one of claims 6 to 9.