Communication conversion method, gateway device, network system and computer medium
By analyzing and processing the news from the release system, the communication conversion between the client-server system and release-subscription system was realized, the problem of manual configuration and lack of automated scanning was solved, and communication efficiency and development convenience were improved.
Patent Information
- Application Number
- CN202080100288.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-05-28
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2040-05-28
AI Technical Summary
In the prior art, engineers need to manually configure Pub/Sub function blocks to enable communication between client-server system and publish-subscribe system, and lack the functionality of automated scanning and broadcast services.
By receiving messages from the release system, analyzing the theme of the message and effective load, determining the host and service provider of the target service, and sending the request message to it. At the same time, receive response messages and add consumer logo information to the release system to realize the communication conversion between the server client system and the release of the subscription system.
The communication conversion between the server client system and the release of the subscription system does not need to be configured by hand, each data point, automatic scanning and broadcasting services, dynamically creating the PUB/SUB client, reducing the burden of technical personnel, increasing the industry's industry The efficiency of communication.
Smart Images

Figure CN115462054B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure generally relates to the field of network technology, and more particularly to a communication conversion method, a gateway device, a network system, and a computer medium for implementing communication between a server-client system and a publish-subscribe system. Background Art
[0002] Recently, the OPC Foundation added publish-subscribe (pub-sub) capabilities to the specification as an alternative to the client-server model and its request-response approach. Conceptually, the publisher (data source) in the pub-sub model sends messages to the Broker (message broker), and the Broker relays the messages to data consumer nodes that have previously requested messages about a specific topic. Compared to the client-server model, the pub-sub model decouples data sources and data consumers and transforms the system from a centralized model to a distributed model.
[0003] The key benefit of this framework is the simplification of the software running on IT systems such as programmable logic controllers, human machine interface (HMI) systems, and enterprise resource planning (ERP) systems across different vendors' systems. The result is that factories can be built more quickly and more information can be collected and analyzed. These additional analyses can improve operational efficiency and reduce downtime by detecting problems earlier.
[0004] In the prior art, Eclipse 4diac TM An open source architecture is provided for distributed industrial process measurement and control systems based on the IEC 61499 standard. It can use publishers and subscribers for application communication. However, in this approach, engineers need to manually configure Pub / Sub function blocks for each data point.
[0005] Reference 1: US7720914B2, Acting on messages received from a publish / subscribe service, https: / / patents.google.com / patent / US7720914B2 / en.
[0006] Reference 2: US7890572B2 (same as US7720914B2), Pub / Sub message calls to the subscriber's application https: / / patents.google.com / patent / US7890572B2 / en. Summary of the invention
[0007] A brief overview of the present invention is given below in order to provide a basic understanding of certain aspects of the present invention. It should be understood that this overview is not an exhaustive overview of the present invention. It is not intended to identify key or important parts of the present invention, nor is it intended to limit the scope of the present invention. Its purpose is merely to give certain concepts in a simplified form as a prelude to a more detailed description discussed later.
[0008] In view of the above, the present disclosure proposes a method that can simply and conveniently implement communication conversion between a traditional client-server based system and a publish-subscribe based system.
[0009] According to one aspect of the present disclosure, a method for realizing communication conversion between a server-client system and a publish-subscribe system is provided, comprising: receiving a message from a publish-subscribe system, wherein the subject of the message includes information related to a target service in the server-client system to which the message is to be sent, and the payload of the message includes identification information of a consumer in the publish-subscribe system to which a response message from the server-client system is to be received; parsing the message to determine a host and a service provider providing the target service and a consumer to receive the response message; sending a request message for the target service to the service provider on the determined host; receiving a response message from the service provider; and adding the identification information of the consumer to the response message, and sending the response message to the publish-subscribe system.
[0010] Optionally, in an example of the above aspect, the subject of the message includes the name of the host providing the target service, the name of the service provider, and the name of the target service.
[0011] Optionally, in an example of the above aspect, the payload of the message further includes: a function name and parameters corresponding to the target service to which the consumer wants to subscribe.
[0012] Optionally, in an example of the above aspect, before receiving a message from the publish-subscribe system, the method further includes: scanning services provided by service providers in the server client system; and publishing the services in the publish-subscribe system, so that consumers in the publish-subscribe system can establish connections with service providers of the services they are interested in.
[0013] According to another aspect of the present disclosure, a gateway device is provided, including: a publish-subscribe system message receiving unit, configured to receive a message from a publish-subscribe system, wherein the subject of the message includes information related to a target service in a server-client system to which the message is to be sent, and the payload of the message includes identification information of a consumer in the publish-subscribe system that is to receive a response message from the server-client system; a parsing unit, configured to parse the message, determine a host and a service provider that provide the target service, and a consumer that receives the response message; a request message sending unit, configured to send a request message for the target service to the service provider on the determined host; a response message receiving unit, configured to receive a response message from the service provider; and a server-client system message sending unit, configured to add the identification information of the consumer to the response message, and send it to the publish-subscribe system.
[0014] Optionally, in an example of the above aspect, the subject of the message includes the name of the host providing the target service, the name of the service provider, and the name of the target service.
[0015] Optionally, in an example of the above aspect, the payload of the message further includes: a function name and parameters corresponding to the target service to which the consumer wants to subscribe.
[0016] Optionally, in an example of the above aspect, the gateway device also includes: a service scanning unit, configured to scan services provided by service providers in the server client system, and publish the services in the publish-subscribe system, so that consumers in the publish-subscribe system can establish a connection with the service providers of the services they want to subscribe to.
[0017] According to another aspect of the present disclosure, a network system is provided, including: a server-client system and a publish-subscribe system, wherein a gateway device according to the above is arranged in the server-client system, and the server-client system and the publish-subscribe system communicate via the gateway device.
[0018] According to another aspect of the present disclosure, a gateway device is provided, comprising: at least one processor; and a memory coupled to the at least one processor, the memory being used to store instructions, which, when executed by the at least one processor, causes the processor to execute the method as described above.
[0019] According to another aspect of the present disclosure, a non-transitory machine-readable storage medium is provided, which stores executable instructions. When the instructions are executed, the machine performs the method as described above.
[0020] According to another aspect of the present disclosure, a computer program is provided, comprising computer executable instructions, which, when executed, cause at least one processor to perform the method described above.
[0021] According to another aspect of the present disclosure, a computer program product is provided, which is tangibly stored on a computer-readable medium and includes computer-executable instructions, which when executed cause at least one processor to perform the method as described above.
[0022] In the method and gateway device according to the present disclosure, the roles in the network system, as well as the subject and payload of the sent message are redefined, so as to support the communication between the server-client system and the publish-subscribe system.
[0023] In the method and gateway device according to the present disclosure, services that can be provided by the server can be automatically scanned and broadcasted without manual configuration for each data point.
[0024] In the method and gateway device according to the present disclosure, Pub / Sub clients may be created dynamically and automatically.
[0025] The method for realizing communication conversion between a server-client system and a publish-subscribe system according to the present disclosure provides a method for integrating IT and OT systems. The method according to the present disclosure is a low-code method, which reduces the development burden of technical personnel and improves the efficiency of industrial communications.
[0026] By adopting the method according to the present disclosure, the application scenarios of the product can be expanded and the competitiveness of the product can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The above and other purposes, features and advantages of the present invention will be more easily understood by referring to the following description of the embodiments of the present invention in conjunction with the accompanying drawings. The components in the accompanying drawings are only for illustrating the principles of the present invention. In the accompanying drawings, the same or similar technical features or components will be represented by the same or similar reference numerals.
[0028] Figure 1 A flowchart showing an exemplary process of implementing a method for communication conversion between a server-client system and a publish-subscribe system according to an embodiment of the present invention;
[0029] Figure 2 is a block diagram showing an exemplary configuration of a gateway device 200 according to another embodiment of the present disclosure;
[0030] Figure 3 A schematic block diagram of a network system for communicating using a gateway device according to the present disclosure is shown;
[0031] Figure 4 An operation flow chart of a network system for communicating using a gateway device according to another embodiment of the present disclosure is shown;
[0032] Figure 5 An operation flow chart showing communication between a server-client system and a publish-subscribe system according to yet another embodiment of the present disclosure; and
[0033] Figure 6 A block diagram of a gateway device for implementing a method for communication conversion between a server-client system and a publish-subscribe system according to an embodiment of the present disclosure is shown.
[0034] Reference numerals
[0035] DETAILED DESCRIPTION
[0036] The subject matter described herein will now be discussed with reference to example embodiments. It should be understood that the discussion of these embodiments is only to enable those skilled in the art to better understand and implement the subject matter described herein, and is not a limitation of the scope of protection, applicability or examples set forth in the claims. The function and arrangement of the elements discussed can be changed without departing from the scope of protection of the present disclosure. Various examples can omit, replace or add various processes or components as needed. For example, the described method can be performed in an order different from the described order, and various steps can be added, omitted or combined. In addition, the features described relative to some examples can also be combined in other examples.
[0037] As used herein, the term "including" and its variations represent open terms, meaning "including but not limited to". The term "based on" means "based at least in part on". The terms "one embodiment" and "an embodiment" mean "at least one embodiment". The term "another embodiment" means "at least one other embodiment". The terms "first", "second", etc. may refer to different or the same objects. Other definitions may be included below, whether explicit or implicit. Unless the context clearly indicates otherwise, the definition of a term is consistent throughout the specification.
[0038] In a client-server system, a server provides functions or services to one or more clients, and the clients initiate requests for these functions or services. The client and server exchange messages in a request-response pattern. The client sends a request with the server address, and the server replies with a response with the client address.
[0039] In a publish-subscribe (pub-sub) system, publishers publish messages to an intermediate message broker (message proxy) or event bus, and subscribers register their subscriptions with the broker, allowing the broker to filter. This model decouples service providers and consumers, and consumers only need to pre-configure the broker's address.
[0040] In the present disclosure, a method is proposed that can simply and conveniently implement communication conversion between a traditional client-server based system and a publish-subscribe based system.
[0041] The following describes a method for implementing communication conversion between a server-client system and a publish-subscribe system, a gateway device, and a network system according to an embodiment of the present disclosure in conjunction with the accompanying drawings.
[0042] Figure 1 A flowchart of an exemplary process of implementing a method 100 for communication conversion between a server-client system and a publish-subscribe system according to an embodiment of the present invention is shown.
[0043] First, in step S102, a message is received from a publish-subscribe system, wherein the subject of the message includes information related to a target service in a server-client system to which the message is to be sent, and the payload of the message includes identification information of a consumer in the publish-subscribe system that is to receive a response message from the server-client system.
[0044] In the scheme according to the present disclosure, a message sent from a publish-subscribe system to a server-client system is defined. The subject of the message includes relevant information that can represent the target service in the server-client system to which the message is to be sent. For example, the subject of the message can be defined as a string including the name of the host providing the target service, the name of the service provider, and the name of the target service, so that after receiving the message, the server-client system can determine which server provider of which host the message is to be sent to; the payload of the message can include identification information of the consumer in the publish-subscribe system to receive the response message, so that after the response message of the server-client system is sent to the publish-subscribe system, the Broker therein can know which consumer to forward the response message to.
[0045] The subject and payload of the message may be defined as a string in JSON format, or in XML format, binary format, etc. In the present invention, the specific forms of the subject and payload of the message are not limited.
[0046] In addition, optionally, the payload of the message may also include the function name corresponding to the target service, function parameters, etc.
[0047] In this way, the function name and function parameters are placed in the payload instead of the subject of the message, which can reduce the number of topics; in addition, it can be mapped to a specific function for calling, thereby triggering the server service.
[0048] After receiving the message from the publish-subscribe system, in step S104, the message is parsed to determine the host and service provider that provide the target service and the consumer that is to receive the response message.
[0049] In step S106, a request message for the target service is sent to the service provider on the determined host.
[0050] In the method according to the present disclosure, the data communication mode executed on the server-client system side is the common request-response mode. Since the host and service provider providing the target service are determined in the previous step S104, the request message for the target service can be sent directly to the corresponding service provider.
[0051] Next, in step S108, a response message from the service provider may be received.
[0052] In step S110, according to the consumer who is to receive the response message in the publish-subscribe system determined in step S104, the identification information of the consumer is added to the response message. For example, the identification information can be added to the subject of the response message sent to the publish-subscribe system, and then the message is sent to the publish-subscribe system.
[0053] After receiving the message, the Broker in the publish-subscribe system can determine to which consumer the response message is to be sent based on the identification information about the consumer. Those skilled in the art can understand the specific process of how the Broker forwards the message in the publish-subscribe system, which will not be described in detail here.
[0054] In the above method, a request-response mode is adopted in the server-client system, and a publish-subscribe mode is adopted in the publish-subscribe system. The communication conversion between the server-client system and the publish-subscribe system can be realized without making any changes to the respective systems. Through the above steps, consumers in the publish-subscribe system can request services of interest to the server in the server client.
[0055] In one example, before a server client receives a message from a consumer of a publish-subscribe system, step S101 may be included, first scanning services provided by service providers in the server client system, and then publishing the services in the publish-subscribe system so that consumers in the publish-subscribe system can establish connections with service providers of services of interest to them.
[0056] In this way, services can be automatically scanned and broadcasted, and Pub / Sub clients can be dynamically and automatically created by the gateway.
[0057] In a specific example, the service libraries of all service providers can be scanned, and then the corresponding topics can be subscribed. All services, including the corresponding function names and parameters, can be organized into JSON format messages, and their topics are defined as "adv", i.e., advertisement.
[0058] Preferably, advertisement messages may be broadcast periodically, and each consumer may subscribe to a topic of interest and obtain the service of interest by parsing the advertisement, for example, the function name and parameters.
[0059] Figure 2 2 is a block diagram showing an exemplary configuration of a gateway device 200 according to another embodiment of the present disclosure. The communication conversion between the server-client system and the publish-subscribe system is implemented through the gateway device.
[0060] like Figure 2 As shown, the gateway device 200 includes: a publish-subscribe system message receiving unit 202 , a parsing unit 204 , a request message sending unit 206 , a response message receiving unit 208 , and a server-client system message sending unit 210 .
[0061] Among them, the publish-subscribe system message receiving unit 202 is configured to receive a message from the publish-subscribe system, wherein the subject of the message includes information related to a target service in a server-client system to which the message is to be sent, and the payload of the message includes identification information of a consumer in the publish-subscribe system that is to receive a response message from the server-client system.
[0062] The parsing unit 204 is configured to parse the message, determine the host and service provider that provide the target service, and the consumer that receives the response message.
[0063] The request message sending unit 206 is configured to send a request message for the target service to the service provider on the determined host.
[0064] The response message receiving unit 208 is configured to receive a response message from the service provider.
[0065] The server-client system message sending unit 210 is configured to add the identification information of the consumer to the response message and send it to the publish-subscribe system.
[0066] The subject of the message may include the name of the host providing the target service, the name of the service provider, and the name of the target service.
[0067] The effective load of the message may also include: the function name and parameters corresponding to the target service to which the consumer wants to subscribe.
[0068] In one example, the gateway device may also include: a service scanning unit 201, which is configured to scan services provided by service providers in the server client system, and publish the services in the publish-subscribe system, so that consumers in the publish-subscribe system can establish connections with service providers of services they want to subscribe to.
[0069] Figure 2 The details of the operation and functions of the various parts of the gateway device 200 shown can be combined with reference to Figure 1 The related parts of the embodiment of the method 100 for implementing communication conversion between a server-client system and a publish-subscribe system of the present disclosure are the same or similar and will not be described in detail here.
[0070] The communication conversion between the server client system and the publish-subscribe system can be realized through the above-mentioned method or gateway device.
[0071] It should also be noted that Figure 2 The structures of the gateway device 200 and its components are only exemplary, and those skilled in the art may modify them as needed. Figure 2 Modify the structural block diagram shown.
[0072] Figure 3 A schematic block diagram of a network system 300 for performing communication using a gateway device according to the present disclosure is shown.
[0073] Figure 3 The network system 300 shown includes a server-client system 301 and a publish-subscribe system 302. A gateway device 200 as described above is provided in the server-client system 301. The server-client system 301 and the publish-subscribe system 302 can communicate through the gateway device 200.
[0074] Refer to the following Figure 4 , describes in detail a specific example of the server client system 401 and the publish-subscribe system 402 communicating through the gateway device 200, in Figure 4 The detailed process of consumer A 405 and consumer B 406 in the publish-subscribe system 402 subscribing to the service in the server client system 401 is specifically described.
[0075] exist Figure 4In the figure, 401 represents a server Host1 in the client server system, 402 represents the publish-subscribe system, 403 represents a Provider1 (service provider) on Host1, 200 represents the gateway device as described above, 220 is a Client1 (client) created by the gateway device, 404 is a Broker (message broker), 405 is consumer A, and 406 is consumer B.
[0076] First, in step S411 , the gateway device 220 subscribes to “Sub Host1 / Provider1 / Interface1” from the Broker 404 .
[0077] Next, consumer A 405 subscribes in S412-1, "Sub ClientA / InterfaceReply1". Then, in step S413-1, it publishes "Pub Host1 / Provider1 / Interface1" to Broker 404. The subject of the message includes the host name Host1 of the service to be subscribed, the service provider name Provider1, and the service name Interface1 to be customized. Similarly, consumer B 406 subscribes in S412-2, "ClientB / InterfaceReply1", and then in S413-2, it publishes "Pub Host1 / Provider1 / Interface1" to Broker 404. The subject of the message includes the host name Host1 of the service to be subscribed, the service provider name Provider1, and the service name Interface1 to be customized.
[0078] In step S414, Broker 404 forwards the message "Fwd Host1 / Provider1 / Interface1".
[0079] In step S415 , a client Client1 220 is created in the gateway device 200 , and Client1 220 sends a request message “Interface1” to Provider1 403 .
[0080] In step S416 , Client1 220 receives a response message “InterfaceReply1 ” from Provider1 403 .
[0081] In step S417 - 1 and step S417 - 2 , Client1 220 publishes “Pub ClientA / InterfaceReply1” and “Pub ClientB / InterfaceReply1” respectively.
[0082] In steps S418 - 1 and S418 - 2 , Broker 404 forwards “FwdClientA / InterfaceReply1” and “FwdClientB / InterfaceReply1” to Consumer A and Consumer B, respectively.
[0083] Through the above steps, the entire process of consumers A and B in the publish-subscribe system subscribing to service Interface1 from service provider Provider1 on host Host1 in the server-client system is completed.
[0084] In the above process, the service provider (server) subscribes to the services that can be provided, the consumer publishes messages as requests, and the consumer can also subscribe to the topics received as responses to the requests.
[0085] Refer to the following Figure 5 A specific example of communication between a server-client system and a publish-subscribe system according to another embodiment of the present disclosure is described.
[0086] Figure 5 In the figure, 501 represents Host1 (server), 502 represents the publish-subscribe system, and Host1 501 is provided with Provider1 (service provider) 503 and gateway 200. 504 represents Broker, and 505 represents consumer A.
[0087] The entire communication process can be divided into five steps, including scanning S51, discovery S52, connection S53, request / response S54 and disconnection S55.
[0088] Specifically, the scanning step S51 includes: in sub-step S511, the gateway 200 scans all services that the service provider of Host1 501 can provide, and then in sub-step S512, the gateway 200 subscribes to all services "Sub all interface" from the Broker 504 of the publish-subscribe system.
[0089] The discovery step S52 includes: in sub-step S521, consumer A 505 in the publish-subscribe system subscribes to the advertisement "Sub Host1 adv" about Host1 501; in sub-step S522, gateway 200 publishes the advertisement "Pub Host1 adv" of all services that Host1501 can provide to Broker 504; in sub-step S523, Broker 504 forwards the advertisement to consumer A 505 "Forward Host1 adv".
[0090] The connection step S53 includes: in sub-step S531, consumer A 505 subscribes to the "onConnect" message "Sub "onConnect" message" from Broker 504; in sub-step S532, consumer A 505 publishes the "Connect" message "Pub "Connect" message" to Broker 504; in sub-step S533, Broker 504 forwards the "Connect" message to gateway 200 "Forward "Connect" message"; in sub-step S534, gateway 200 creates a client, and in sub-step S535, the client sends a connection request message "Interface1 Connect()" for the service "Interface1" to Provider1 503; in sub-step S536, Provider1 503 sends a response message "Interface1 Connected()" to gateway 200; in sub-step S537, gateway 200 sends a response message "Interface1 Connected()" to Broker 504 publishes the message “Pub “onConnect” message; in sub-step S538, Broker 504 forwards the “onConnect” message to consumer A505 “Forward “onConnect” message”.
[0091] The request / response step S54 includes: in sub-step S541, consumer A 505 subscribes to the "onGet" message "Sub"onGet"message" from Broker 504; in sub-step S542, consumer A 505 publishes the "Get" message "Pub"Get"message" to Broker 504; in sub-step S543, Broker 504 forwards the "Get" message to gateway 200 "Forward"Get"message"; in sub-step S544, the client sends a request message "Interface1 Get()" for the service "Interface1" to Provider1 503; in sub-step S545, Provider1 503 sends a response message "Interface1 onGet()" to gateway 200; in sub-step S546, gateway 200 publishes the message "Pub"onGet"message" to Broker504; in sub-step S547, Broker 504 Forward the "onGet" message to consumer A "Forward "onGet" message".
[0092] Finally, the disconnection step S55 includes: in sub-step S551, consumer A 505 publishes a "Disconnect" message to Broker 504, "Pub "disconnect" message"; in sub-step S552, Broker 504 forwards the "Disconnect" message to gateway 200 "Forward "Disconnect" message"; in sub-step S553, gateway 200 deletes the created client, and in sub-step S554, sends an "Interface1 Disconnect()" message to Provider1 503.
[0093] In the above process, since the subject of the message received by the gateway from the publish-subscribe system carries the name of the host providing the service in the server-client system, the name of the service provider, and the name of the service, the gateway can send a request message for the target service to the corresponding service provider. For the response message returned by the server, the gateway can identify the target consumer of the response message in the response message based on the information of the consumer sending the message included in the payload of the received message.
[0094] Reference above Figure 5 , describes in detail a specific example of communication between a server-client system and a publish-subscribe system. Those skilled in the art will appreciate that the method according to the present disclosure is not limited to the various steps shown in this example.
[0095] For example, those skilled in the art will appreciate that after the connection is established, the connection may be maintained so that multiple communications are performed between the consumer and the server, or the connection may be established before each communication and disconnected after the communication.
[0096] As above Figures 1 to 5 , describes the method for realizing communication conversion between a server-client system and a publish-subscribe system, a gateway device and an embodiment of a network system according to an embodiment of the present disclosure. The gateway device described above can be implemented by hardware, software or a combination of hardware and software.
[0097] Figure 6 A block diagram of a gateway device 600 for implementing a method for communication conversion between a server-client system and a publish-subscribe system according to an embodiment of the present disclosure is shown. According to one embodiment, the gateway device 600 may include at least one processor 602, which executes at least one computer-readable instruction (i.e., the above-mentioned element implemented in the form of software) stored or encoded in a computer-readable storage medium (i.e., memory 604).
[0098] In one embodiment, the memory 604 stores computer executable instructions which, when executed, cause the at least one processor 602 to perform the above-referenced Figure 1 The described method realizes the communication conversion between the server-client system and the publish-subscribe system.
[0099] It should be understood that the computer executable instructions stored in the memory 604, when executed, cause at least one processor 602 to perform the above combined operations in various embodiments of the present disclosure. Figure 1-5 Describes the various operations and functions.
[0100] According to one embodiment, a non-transitory machine-readable medium is provided. The non-transitory machine-readable medium may have machine-executable instructions (i.e., the above-mentioned elements implemented in the form of software), which, when executed by a machine, causes the machine to execute the above-mentioned combination of various embodiments of the present disclosure. Figure 1-5 Describes the various operations and functions.
[0101] According to one embodiment, a computer program is provided, including computer executable instructions, which, when executed, cause at least one processor to perform the above combined operation in various embodiments of the present disclosure. Figure 1-5 Describes the various operations and functions.
[0102] According to one embodiment, a computer program product is provided, including computer executable instructions, which, when executed, cause at least one processor to perform the above combined operation in various embodiments of the present disclosure. Figure 1-5 Describes the various operations and functions.
[0103] In the method and gateway device according to the present disclosure, the roles in the network system, as well as the subject and payload of the sent message are redefined, so as to support the communication between the server-client system and the publish-subscribe system.
[0104] In the method and gateway device according to the present disclosure, services that can be provided by the server can be automatically scanned and broadcasted without manual configuration for each data point.
[0105] In the method and gateway device according to the present disclosure, Pub / Sub clients may be created dynamically and automatically.
[0106] The method for realizing communication between a server-client system and a publish-subscribe system according to the present disclosure provides a method for integrating IT and OT systems. The method according to the present disclosure is a low-code method, which reduces the development burden of technical personnel and improves the efficiency of industrial communication.
[0107] By adopting the method according to the present disclosure, the application scenarios of the product can be expanded and the competitiveness of the product can be improved.
[0108] The specific embodiments described above in conjunction with the accompanying drawings describe exemplary embodiments, but do not represent all embodiments that can be implemented or fall within the scope of protection of the claims. The term "exemplary" used throughout this specification means "used as an example, instance or illustration" and does not mean "preferred" or "having advantages" over other embodiments. For the purpose of providing an understanding of the described technology, the specific embodiments include specific details. However, these technologies can be implemented without these specific details. In some instances, in order to avoid making the concepts of the described embodiments difficult to understand, well-known structures and devices are shown in block diagram form.
[0109] The above description of the present disclosure is provided to enable any person of ordinary skill in the art to implement or use the present disclosure. Various modifications to the present disclosure will be apparent to those of ordinary skill in the art, and the general principles defined herein may be applied to other variations without departing from the scope of protection of the present disclosure. Therefore, the present disclosure is not limited to the examples and designs described herein, but is consistent with the widest range of principles and novel features disclosed herein.
Claims
1. A method for implementing communication conversion between a server-client system and a publish-subscribe system, the method being executed by a gateway device between the server-client system and the publish-subscribe system, the method comprising: Receiving a message from a publish-subscribe system, wherein the subject of the message includes information related to a target service in a server-client system to which the message is to be sent, and the payload of the message includes identification information of a consumer in the publish-subscribe system that is to receive a response message from the server-client system; Parsing the message to determine a host and service provider that provides the target service and a consumer that is to receive the response message; Sending a request message for the target service to a service provider on the determined host; receiving a response message from the service provider; and Adding the identification information of the consumer to the response message and sending it to the publish-subscribe system; The subject of the message includes the name of the host providing the target service, the name of the service provider, and the name of the target service; The effective load of the message also includes: the function name and parameters corresponding to the target service to which the consumer wants to subscribe.
2. The method of claim 1, wherein: Before receiving the message from the publish-subscribe system, the method further includes: Scan the services provided by the service provider in the server client system; and The service is published in a publish-subscribe system, so that consumers in the publish-subscribe system can establish connections with service providers of the services they are interested in.
3. Gateway equipment, including: a publish-subscribe system message receiving unit, configured to receive a message from a publish-subscribe system, wherein the subject of the message includes information related to a target service in a server-client system to which the message is to be sent, and the payload of the message includes identification information of a consumer in the publish-subscribe system that is to receive a response message from the server-client system; A parsing unit configured to parse the message, determine a host and a service provider that provide the target service and a consumer that receives a response message; a request message sending unit, configured to send a request message for the target service to the service provider on the determined host; a response message receiving unit, configured to receive a response message from the service provider; and A server client system message sending unit, configured to add the identification information of the consumer to the response message and send it to the publish-subscribe system; The subject of the message includes the name of the host providing the target service, the name of the service provider, and the name of the target service; The payload of the message also includes: the function name and parameters corresponding to the target service to which the consumer wants to subscribe; The server-client system and the publish-subscribe system communicate via the gateway device.
4. The gateway device according to claim 3, further comprising: The service scanning unit is configured to scan services provided by service providers in the server client system and publish the services in the publish-subscribe system so that consumers in the publish-subscribe system can establish connections with service providers of services they want to subscribe to.
5. Network system, including: A server-client system and a publish-subscribe system, wherein a gateway device according to any one of claims 3-4 is arranged in the server-client system, and the server-client system and the publish-subscribe system communicate via the gateway device.
6. Gateway device (600), comprising: at least one processor (602); as well as A memory (604) coupled to the at least one processor (602), the memory being used to store instructions, which, when executed by the at least one processor (602), causes the processor (602) to perform the method according to any one of claims 1-2.
7. A non-transitory machine-readable storage medium storing executable instructions, which, when executed, cause the machine to perform the method according to any one of claims 1 to 2.
8. A computer program product comprising computer executable instructions which, when executed, cause at least one processor to perform the method according to any one of claims 1-2.
9. A computer program product tangibly stored on a computer readable medium and comprising computer executable instructions which, when executed, cause at least one processor to perform the method according to any one of claims 1-2.
Citation Information
Patent Citations
Performing an operation on a message received from a publish / subscribe service
US7720914B2
Pub / sub message invoking a subscribers client application program
US7890572B2
Service layer interworking using MQTT protocol
US20180213378A1