Cloud gateway system and data interaction method based on ModbusTCP protocol
By introducing cloud-based ModbusTCP gateway module, distributed task scheduling module and distributed cache module into the cloud-based gateway system of ModbusTCP protocol, the problems of single-unit architecture in high concurrency and maintenance are solved, and the system's high availability and flexibility are achieved Supports multi-instance deployment and protocol conversion, ensuring the stability and flexibility of data communication.
Patent Information
- Application Number
- CN202111473749.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-30
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2041-11-30
AI Technical Summary
When the existing single-unit architecture based on ModbusTCP protocol faces high concurrency, multi-process and other conditions, the server performance consumes a lot, lacks high availability, and is difficult to maintain and upgrade the system, and has high coupling, so it is impossible to achieve horizontal scaling.
The cloud gateway system based on the ModbusTCP protocol is adopted, including the cloud ModbusTCP gateway module, distributed task scheduling module and distributed cache module, is deployed in a microservice cluster, and data interaction is achieved through timed polling and shared register values, supporting multiple instances Deployment and protocol conversion ensure high availability and flexibility of the system.
It realizes high availability, stability and flexibility in data communication between systems and systems, and systems and devices, supports smooth deployment and grayscale release, and avoids single point of failure and maintenance impact.
Smart Images

Figure CN116208443B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of integrated monitoring, and more specifically, to a cloud gateway system and a data interaction method based on the ModbusTCP protocol. Background Art
[0002] The existing solutions based on ModbusTCP protocol communication all adopt a monolithic architecture, and the communication method is point-to-point transmission between Modbus slave and Modbus master. This monolithic architecture can stably meet some initial business needs when collecting device data and transmitting data between systems. However, with the development of information technology, the traditional monolithic structure is unable to cope with high concurrency and multi-process situations. Not only does it have higher and higher requirements for server performance, but it also has no better backup solution when facing single-point server failures. In addition, in an operating environment where systems are highly coupled, the monolithic ModbusTCP protocol communication solution faces many difficulties in system maintenance and upgrades. Summary of the invention
[0003] A series of simplified concepts are introduced in the Summary of the Invention, which will be further described in detail in the Detailed Description of the Invention. The Summary of the Invention does not mean to attempt to define the key features and essential technical features of the claimed technical solution, nor does it mean to attempt to determine the scope of protection of the claimed technical solution.
[0004] In view of the deficiencies of the prior art, a first aspect of an embodiment of the present invention proposes a cloud gateway system based on the ModbusTCP protocol, the cloud gateway system comprising:
[0005] A cloud-based ModbusTCP gateway module, which is deployed in a microservice cluster. The microservice cluster includes multiple server groups, each of which includes multiple Modbus host instances for data interaction with lower-layer device slaves.
[0006] A distributed task scheduling module, connected to the cloud-based ModbusTCP gateway module, is used to periodically poll each Modbus host instance so that the Modbus host instance receives data from the lower-layer device slave through the ModbusTCP protocol;
[0007] A distributed cache module is connected to the cloud-based ModbusTCP gateway module and is used to deploy the shared memory of the multiple server groups.
[0008] In one embodiment, the Modbus master instance includes registers for storing the data from the lower layer device slave.
[0009] In one embodiment, the cloud-based ModbusTCP gateway module is further used to uniformly cache data in registers of multiple Modbus host instances into the distributed cache module to generate a shared register value.
[0010] In one embodiment, when sending a message to an upper layer system via the ModbusTCP protocol, the cloud-based ModbusTCP gateway module is also used to read and upload the shared register value in the distributed cache module.
[0011] In one embodiment, when sending a message to an upper layer system through the ModbusTCP protocol, the cloudified ModbusTCP gateway module establishes a Modbus slave instance, and reads and uploads the shared register value through the Modbus slave instance.
[0012] In one embodiment, the Modbus host instance further includes a protocol conversion module;
[0013] When sending a message to the upper-layer system through a communication protocol other than the ModbusTCP protocol, the cloud-based ModbusTCP gateway module reads the data in the register of the Modbus host instance, converts it into a format corresponding to the other communication protocol through a protocol conversion module, and uploads it to the upper-layer system through the other communication protocol.
[0014] In one embodiment, the distributed task scheduling module calls one Modbus master instance each time, and each Modbus master instance is connected to one lower-layer device slave each time.
[0015] In one embodiment, the distributed cache module includes a distributed key-value storage cluster module.
[0016] Another aspect of the present invention provides a data interaction method, the method comprising:
[0017] Periodically poll each Modbus host instance of the cloud-based ModbusTCP gateway module, so that the Modbus host instance receives data from the lower-layer device slave through the ModbusTCP protocol;
[0018] Storing the data of the lower layer device slave in the register of the Modbus master instance;
[0019] Cache the data in the registers of the plurality of Modbus host instances uniformly into the distributed cache module to generate a shared register value;
[0020] When a message is sent to an upper-layer system through the ModbusTCP protocol, the shared register value in the distributed cache module is read and uploaded through the cloud-based ModbusTCP gateway module.
[0021] In one embodiment, when sending a message to an upper layer system via the ModbusTCP protocol, the method further comprises:
[0022] A Modbus slave instance is established in the cloudified ModbusTCP gateway module, and the shared register value is read and uploaded through the Modbus slave instance.
[0023] In one embodiment, the method further comprises:
[0024] When sending a message to the upper system through other communication protocols except ModbusTCP protocol, the data in the register of the Modbus host instance is read, converted into a format corresponding to the other communication protocol, and uploaded to the upper system through the other communication protocol.
[0025] In one embodiment, the timing polling each Modbus host instance of the cloud ModbusTCP gateway module so that the Modbus host instance receives data from the lower-layer device slave through the ModbusTCP protocol includes:
[0026] Each time one Modbus master instance is called, each Modbus master instance is connected to one lower layer device slave each time.
[0027] The embodiment of the present invention proposes a cloud gateway system based on the ModbusTCP protocol at the Internet level, which can connect to other systems upward and collect data from multiple devices downward. It can deploy multiple instances for horizontal expansion and establish a multi-server group to ensure high availability, stability and flexibility of data communication between systems and systems, and between systems and devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The above and other purposes, features and advantages of the present invention will become more apparent by describing the embodiments of the present invention in more detail in conjunction with the accompanying drawings. The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings, the same reference numerals generally represent the same components or steps.
[0029] Figure 1This is a flow chart of communication via ModbusTCP protocol;
[0030] Figure 2 It is a schematic block diagram of a ModbusTCP communication system;
[0031] Figure 3 is a schematic block diagram of a data monitoring system;
[0032] Figure 4 Schematic diagram of a cloud gateway system based on the ModbusTCP protocol according to an embodiment of the present invention;
[0033] Figure 5 A structural diagram of a cloud-based ModbusTCP gateway module according to an embodiment of the present invention;
[0034] Figure 6 A communication flow chart of a cloud gateway system based on the ModbusTCP protocol according to an embodiment of the present invention;
[0035] Figure 7 A functional schematic diagram of a cloud gateway system according to an embodiment of the present invention;
[0036] Figure 8 The figure is a schematic flow chart of a data interaction method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0037] In order to make the purpose, technical solutions and advantages of the present application more obvious, the example embodiments according to the present application will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application, and it should be understood that the present application is not limited to the example embodiments described herein. Based on the embodiments of the present application described in the present application, all other embodiments obtained by those skilled in the art without creative work should fall within the scope of protection of the present application.
[0038] In the following description, a large number of specific details are provided to provide a more thorough understanding of the present application. However, it is apparent to those skilled in the art that the present application can be implemented without one or more of these details. In other examples, in order to avoid confusion with the present application, some technical features well known in the art are not described.
[0039] It should be understood that the present application can be implemented in different forms and should not be interpreted as being limited to the embodiments set forth herein. On the contrary, providing these embodiments will make the disclosure thorough and complete, and will fully convey the scope of the present application to those skilled in the art.
[0040] The purpose of the terms used herein is only to describe specific embodiments and is not intended to be limiting of the present application. When used herein, the singular forms "one", "an" and "said / the" are also intended to include plural forms, unless the context clearly indicates otherwise. It should also be understood that the terms "consisting of" and / or "comprising", when used in this specification, determine the presence of the features, integers, steps, operations, elements and / or parts, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, parts and / or groups. When used herein, the term "and / or" includes any and all combinations of the relevant listed items.
[0041] In order to thoroughly understand the present application, a detailed structure will be proposed in the following description to illustrate the technical solution proposed by the present application. The optional embodiments of the present application are described in detail as follows, but in addition to these detailed descriptions, the present application may also have other implementation methods.
[0042] like Figure 1 As shown in the figure, the existing ModbusTCP protocol communication solution adopts a single-body architecture, and its communication method is point-to-point transmission between Modbus slave and Modbus maste. This single-body architecture can stably meet some initial business needs when collecting device data and transmitting data between systems, such as the collection of device data such as PLC (Programmable Logic Controller) and data interaction between devices and systems. For details, please refer to Figure 2 The ModbusTCP communication system shown in Figure 3 The data monitoring system shown in the figure. In actual operation, the current technology has the following shortcomings:
[0043] 1. Data transmission has bottlenecks. When faced with high concurrency and multi-threading, the server performance is greatly consumed, and the server may become unresponsive or crash.
[0044] 2. Low availability. When a single server fails, the transmission process cannot be completed normally, which will cause the subsequent data to fail to be transmitted. A high availability solution is needed.
[0045] 3. The coupling degree is high. If you want to upgrade and maintain the system and equipment, you need to shut down the entire system, which greatly affects the overall operation.
[0046] Therefore, in the context of the increasing amount of data interaction between devices and systems, and between systems, and the increasingly complex operating environment of devices and systems, an embodiment of the present invention proposes a cloud gateway system based on the ModbusTCP protocol to meet various complex business needs.
[0047] See also Figure 4 , Figure 4 The schematic diagram of a cloud gateway system based on the ModbusTCP protocol of an embodiment of the present invention. The cloud gateway system based on the ModbusTCP protocol of an embodiment of the present invention includes a cloud ModbusTCP gateway module 410, a distributed task scheduling module 420 and a distributed cache module 430. The cloud ModbusTCP gateway module 410 is deployed in a microservice cluster, and the microservice cluster includes multiple server groups, each server group includes multiple Modbus host instances, which are used to interact with the lower-level device slaves for data; the distributed task scheduling module 420 is connected to the cloud ModbusTCP gateway module 410, and is used to periodically poll each Modbus host instance, so that the Modbus host instance receives data from the lower-level device slave through the ModbusTCP protocol; the distributed cache module 430 is connected to the cloud ModbusTCP gateway module 410, and is used to deploy the shared memory of multiple server groups. Among them, the ModbusTCP protocol is the Modbus Ethernet communication protocol.
[0048] like Figure 5 As shown, the cloud ModbusTCP gateway module 410 is deployed in a microservice cluster, which includes multiple server groups, each of which includes multiple Modbus host instances, for receiving uploaded data from the lower-level device slaves for uploading to the upper-level system. Among them, the lower-level devices connected to the cloud ModbusTCP gateway module 410 include devices such as programmable logic controllers (PLCs); the upper-level systems connected to the cloud ModbusTCP gateway module 410 include Internet of Things systems (IOTs) and integrated monitoring systems (ISCSs), etc.
[0049] In the existing single-server solution, when a single server fails, all message transmissions will be forced to stop; in the multi-instance cluster deployment solution adopted in the embodiment of the present invention, when a single server fails, the distributed task scheduling module 420 will automatically poll other servers in the server group, which will not affect the normal operation of the module and the entire system, and has high availability. Among them, the distributed task scheduling module 420 includes a distributed timed task scheduler (XXL_JOB) for setting timed tasks and polling each host instance for data collection, such as polling the Modbus host instance in the server group at a time interval of 500ms. Exemplarily, the distributed task scheduling module 420 calls a Modbus host instance each time, and each Modbus host instance is connected to a lower-level device slave each time.
[0050] The distributed cache module 430 includes a highly available distributed key-value storage cluster (ETCD) for storing memory and realizing the statelessness of the module. The distributed cache module 430 is mainly used to establish a "shared register" to aggregate the register values received by all Modbus host instances in the server group, thereby realizing the statelessness of ModbusTCP transmission data. Only a slave instance needs to be established, and the upper system can read the register value in the distributed cache module 430, which is also the status data reported by all devices. The embodiment of the present invention uses an ETCD cluster to establish a shared memory of a server group, and realizes the statelessness of microservices through microservice technology and load balancing technology, so that multiple instances can be deployed for horizontal expansion, solving the problem that horizontal expansion cannot be achieved due to the limitation of a single architecture.
[0051] In addition, the existing monolithic architecture needs to suspend the operation of the entire system when the module needs maintenance or upgrade. The cloud gateway system of the embodiment of the present invention adopts microservice technology, supports CICD, namely continuous integration (CI) and continuous delivery (CD), and can achieve gray release or canary release. It only needs to suspend the microservice to achieve flexible deployment, and realize smooth and controllable deployment and upgrade without affecting the original functions of the system.
[0052] Exemplarily, the Modbus master instance includes a register for storing the data from the lower layer device slave. Subsequently, different methods may be used to upload the data from the lower layer device slave according to the communication protocols supported by different upper layer systems.
[0053] In order to upload data through the ModbusTCP protocol, the cloud-based ModbusTCP gateway module 410 is also used to uniformly cache the data in the registers of multiple Modbus host instances into the distributed cache module 430 to generate shared register values. When sending a message to the upper-level system through the ModbusTCP protocol, the cloud-based ModbusTCP gateway module 410 reads the shared register value in the distributed cache module and uploads it to the upper-level system through the ModbusTCP protocol. Further, when sending a message to the upper-level system through the ModbusTCP protocol, the cloud-based ModbusTCP gateway module 410 can establish a Modbus slave instance, and read and upload the shared register value through the Modbus slave instance. Since the distributed cache module 430 summarizes the register values received by all Modbus host instances, it only needs to establish a slave instance to upload the status data reported by all lower-level devices, realizing the statelessness of ModbusTCP transmission data.
[0054] The embodiment of the present invention also supports the use of other communication protocols to upload data. Figure 5 As shown, the Modbus host instance also includes a protocol conversion module. When sending a message to the upper-level system through a communication protocol other than the ModbusTCP protocol, the cloud ModbusTCP gateway module 410 reads the data in the register of the Modbus host instance, converts it into a format corresponding to other communication protocols through the protocol conversion module, and uploads it to the upper-level system through other communication protocols, thereby realizing data upload of multiple different communication protocols.
[0055] See also Figure 6 , Figure 6 A schematic diagram of uploading data to an upper layer system using two different protocols, ModbusTCP protocol and MQTT (message strategy telemetry transmission) protocol, is shown. Specifically, the distributed task scheduling module 420 starts a timer to poll the Modbus host instance in the server group at a certain time interval, and the called Modbus host instance starts to receive data from the lower layer device slave through the ModbusTCP protocol, and each lower layer device slave corresponds to a Modbus host instance. The data uploaded by the lower layer device slave is stored in the register of the Modbus host instance, and the register is stored in the memory.
[0056] When sending a message to ISCS through the ModbusTCP protocol, the register values of each Modbus host instance are uniformly cached in ETCD, and all Modbus host instances share a set of register values cached in ETCD; to forward Modbus messages, the cloud-based ModbusTCP gateway module only needs to establish a Modbus slave instance, directly read the shared register values in ETCD, and forward them to ISCS through the ModbusTCP protocol.
[0057] When a message is sent to the IOT via the MQTT protocol, the data in the register of the Modbus host instance is read, converted into information in the MQTT format by the protocol conversion module of the Modbus host instance, and then forwarded to the IOT via the MQTT protocol.
[0058] See also Figure 7 , Figure 7 The functional diagram of each module of the cloud gateway system is shown. The distributed task scheduling module 420 can realize the timed data collection, the distributed cache module 430 can realize the stateless microservice, and the cloud ModbusTCP gateway module 410 adopts a multi-instance cluster deployment mode, which has the characteristics of high availability, horizontal scalability and flexible deployment.
[0059] In summary, the embodiment of the present invention proposes a cloud gateway system based on the ModbusTCP protocol at the Internet level, which can connect to other systems upward, collect data from multiple devices downward, deploy multiple instances for horizontal expansion, and establish multi-server groups to ensure high availability, stability and flexibility of data communication between systems and systems, and between systems and devices.
[0060] See below Figure 8 , Figure 8 FIG. 8 is a schematic flow chart of a data interaction method 800 according to an embodiment of the present invention. Figure 8 As shown, the data interaction method 800 of the embodiment of the present invention includes the following steps:
[0061] In step S810, each Modbus host instance of the cloud-based ModbusTCP gateway module is polled periodically, so that the Modbus host instance receives data from the lower-layer device slave through the ModbusTCP protocol;
[0062] In step S820, the data of the lower layer device slave is stored in the register of the Modbus master instance;
[0063] In step S830, data in registers of the plurality of Modbus host instances are uniformly cached in the distributed cache module to generate a shared register value;
[0064] In step S840, when a message is sent to an upper-layer system through the ModbusTCP protocol, the shared register value in the distributed cache module is read and uploaded through the cloud ModbusTCP gateway module.
[0065] In one embodiment, when sending a message to an upper-layer system through the ModbusTCP protocol, the method further includes: establishing a Modbus slave instance in the cloudified ModbusTCP gateway module, and reading and uploading a shared register value through the Modbus slave instance.
[0066] In another embodiment, when sending a message to an upper system via a communication protocol other than the ModbusTCP protocol, the data in the register of the Modbus host instance is read, converted into a format corresponding to the other communication protocol, and uploaded to the upper system via the other communication protocol.
[0067] Exemplarily, each Modbus host instance of the cloud-based ModbusTCP gateway module is polled periodically so that the Modbus host instance receives data from the lower-level device slave through the ModbusTCP protocol, further comprising: calling a Modbus host instance each time, and each Modbus host instance connects to one lower-level device slave each time.
[0068] The data interaction method 800 of the embodiment of the present invention can be implemented in the cloud gateway system based on the ModbusTCP protocol as described above. For more specific details, please refer to the relevant description above and will not be repeated here. The data interaction method 800 of the embodiment of the present invention can flexibly and stably realize data collection of lower-level devices and data upload to upper-level systems.
[0069] Although example embodiments have been described herein with reference to the accompanying drawings, it should be understood that the above example embodiments are merely exemplary and are not intended to limit the scope of the present application thereto. Various changes and modifications may be made therein by one of ordinary skill in the art without departing from the scope and spirit of the present application. All such changes and modifications are intended to be included within the scope of the present application as required by the appended claims.
[0070] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0071] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed.
[0072] In the description provided herein, a large number of specific details are described. However, it is understood that the embodiments of the present application can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0073] Similarly, it should be understood that in order to streamline the present application and help understand one or more of the various inventive aspects, in the description of the exemplary embodiments of the present application, the various features of the present application are sometimes grouped together into a single embodiment, figure, or description thereof. However, the method of the present application should not be interpreted as reflecting the following intention: the claimed application requires more features than the features clearly stated in each claim. More specifically, as reflected in the corresponding claims, the inventive point is that the corresponding technical problem can be solved with features less than all the features of a single disclosed embodiment. Therefore, the claims following the specific embodiment are hereby explicitly incorporated into the specific embodiment, wherein each claim itself serves as a separate embodiment of the present application.
[0074] It will be understood by those skilled in the art that, except for mutually exclusive features, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this specification may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature that provides the same, equivalent or similar purpose.
[0075] In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present application and form different embodiments. For example, in the claims, any one of the claimed embodiments can be used in any combination.
[0076] The various component embodiments of the present application can be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) can be used in practice to implement some or all functions of some modules according to the embodiments of the present application. The application can also be implemented as a device program (e.g., computer program and computer program product) for executing a part or all of the methods described herein. Such a program implementing the present application can be stored on a computer-readable medium, or can have the form of one or more signals. Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0077] It should be noted that the above embodiments illustrate rather than limit the present application, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets should not be constructed as a limitation to the claims. The present application may be implemented by means of hardware including several different elements and by means of a suitably programmed computer. In a unit claim that lists several devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words may be interpreted as names.
[0078] The above is only a specific implementation method or an explanation of a specific implementation method of the present application, and the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. The protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A cloud gateway system based on ModbusTCP protocol, characterized in that: The cloud gateway system includes: A cloud-based ModbusTCP gateway module, wherein the cloud-based ModbusTCP gateway module is deployed in a microservice cluster, wherein the microservice cluster includes multiple server groups, each of which includes multiple Modbus host instances for data interaction with lower-layer device slaves, and wherein the Modbus host instance includes registers for storing data from the lower-layer device slaves; A distributed task scheduling module, connected to the cloud-based ModbusTCP gateway module, is used to periodically poll each of the Modbus host instances so that the Modbus host instances receive data from the lower-layer device slaves through the ModbusTCP protocol; A distributed cache module, connected to the cloud-based ModbusTCP gateway module, for deploying a shared memory of the multiple server groups; The cloud-based ModbusTCP gateway module is also used to uniformly cache the data in the registers of multiple Modbus host instances into the distributed cache module to generate shared register values. When sending a message to the upper-layer system through the ModbusTCP protocol, the cloud-based ModbusTCP gateway module is also used to establish a Modbus slave instance, and read and upload the shared register value in the distributed cache module through the Modbus slave instance.
2. The cloud gateway system according to claim 1, characterized in that: When sending a message to the upper layer system through the ModbusTCP protocol, the cloudified ModbusTCP gateway module establishes a Modbus slave instance, and reads and uploads the shared register value through the Modbus slave instance.
3. The cloud gateway system according to claim 1, characterized in that: The Modbus host instance also includes a protocol conversion module; When sending a message to the upper-layer system through a communication protocol other than the ModbusTCP protocol, the cloud-based ModbusTCP gateway module reads the data in the register of the Modbus host instance, converts it into a format corresponding to the other communication protocol through a protocol conversion module, and uploads it to the upper-layer system through the other communication protocol.
4. The cloud gateway system according to claim 1, characterized in that: The distributed task scheduling module calls one Modbus host instance each time, and each Modbus host instance is connected to one lower-layer device slave each time.
5. The cloud gateway system according to any one of claims 1 to 4, characterized in that: The distributed cache module includes a distributed key-value storage cluster module.
6. A data interaction method, characterized in that: The method comprises: Periodically polling each Modbus host instance of the cloud-based ModbusTCP gateway module, so that the Modbus host instance receives data from the lower-layer device slave through the ModbusTCP protocol, wherein the cloud-based ModbusTCP gateway module is deployed in a microservice cluster, the microservice cluster includes multiple server groups, each of the server groups includes multiple Modbus host instances for data interaction with the lower-layer device slave, and the Modbus host instance includes a register for storing the data from the lower-layer device slave; Storing the data of the lower layer device slave in the register of the Modbus master instance; Cache the data in the registers of the plurality of Modbus host instances uniformly into a distributed cache module to generate a shared register value; When sending a message to the upper system through the ModbusTCP protocol, the shared register value in the distributed cache module is read and uploaded through the cloud ModbusTCP gateway module; When sending a message to an upper layer system through the ModbusTCP protocol, the method further includes: A Modbus slave instance is established in the cloudified ModbusTCP gateway module, and the shared register value is read and uploaded through the Modbus slave instance.
7. The method according to claim 6, characterized in that The method further comprises: When sending a message to the upper system through other communication protocols except ModbusTCP protocol, the data in the register of the Modbus host instance is read, converted into a format corresponding to the other communication protocol, and uploaded to the upper system through the other communication protocol.
8. The method according to claim 6, characterized in that The timed polling of each Modbus host instance of the cloud-based ModbusTCP gateway module enables the Modbus host instance to receive data from the lower-layer device slave through the ModbusTCP protocol, including: Each time one Modbus master instance is called, each Modbus master instance is connected to one lower layer device slave each time.
