A communication connection method and device
By using the combination of TCP server and client in the power Internet of Things system, using Netty technology and IEC104 standard, the fast communication connection between slaves and masters is achieved, and the connection efficiency and high complexity caused by dynamic IP address changes is solved. The problem.
Patent Information
- Application Number
- CN202111520476.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-13
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2041-12-13
AI Technical Summary
In the prior art, the dynamic IP address obtained by the power Internet of Things equipment will change, resulting in the centralized control center needing to re-establish communication connections, reducing the efficiency of the communication connection and increasing the complexity.
By establishing a TCP connection between the master and slave station, the master station configures the TCP server, and the slave station configures the TCP client, using Netty technology to realize the IEC104 standard TCP connection, obtaining the fixed IP address and service port of the master station, achieving rapid connect.
It solves the problem that the master station needs to re-establish a connection when the slave IP address changes, improves the efficiency of communication connections, and reduces the complexity of communication connections under the Internet of Things.
Smart Images

Figure CN114401305B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of smart grids, and in particular to a communication connection method and device. Background Art
[0002] The power Internet of Things is the application of the Internet of Things in the smart grid. It is the result of the development of information and communication technology to a certain stage. It will effectively integrate communication infrastructure resources and power system infrastructure resources, improve the level of informatization of the power system, and improve the utilization efficiency of the existing infrastructure of the power system. It will provide important technical support for the power grid's generation, transmission, transformation, distribution, and consumption.
[0003] In the power Internet of Things, distributed photovoltaics, small energy stations and other power Internet of Things devices can access the Internet through 5G and obtain dynamic IP addresses. Subsequently, the centralized control center establishes a communication connection with the power Internet of Things devices and exchanges data based on the IP addresses of the power Internet of Things devices.
[0004] However, since the dynamic IP address obtained by the power Internet of Things device will change, when the IP address of the power Internet of Things device changes, the centralized control center needs to re-establish the communication connection with the power Internet of Things device based on the changed IP address, which reduces the efficiency of the communication connection and increases the complexity of the communication connection under the power Internet of Things. Summary of the invention
[0005] The purpose of this section is to summarize some aspects of embodiments of the present invention and briefly introduce some preferred embodiments. Some simplifications or omissions may be made in this section and the specification abstract and the invention title of this application to avoid blurring the purpose of this section, the specification abstract and the invention title, and such simplifications or omissions cannot be used to limit the scope of the present invention.
[0006] In view of the above existing problems, the present invention is proposed.
[0007] Therefore, the technical problem solved by the present invention is that the communication connection efficiency of the prior art is low.
[0008] In order to solve the above technical problems, the present invention provides a communication connection method, which is applied to a communication system including a master station and a slave station; the master station is configured with a Transmission Control Protocol TCP server; the slave station is configured with a TCP client; the communication connection method includes: the slave station obtains connection information of the master station; the connection information includes the Internet Protocol IP address of the master station and the service port of the TCP server; based on the connection information and the TCP client, the slave station sends a communication connection request to the master station for requesting access to the master station.
[0009] As a preferred solution of the communication connection method described in the present invention, wherein: the TCP server is a server established on the master station according to the Netty technology; the TCP client is a client established on the slave station according to the Netty technology; the TCP server and the TCP client establish a TCP connection through the IEC104 standard.
[0010] As a preferred solution of the communication connection method of the present invention, after sending a communication connection request for requesting access to the main station to the main station based on the connection information and the TCP client, it also includes:
[0011] The communication connection success message sent by the master station through the TCP server is received; the communication connection success message is used to instruct the master station to establish a TCP connection with the slave station.
[0012] As a preferred solution of the communication connection method of the present invention, after receiving the communication connection success message sent by the master station through the TCP server, it also includes:
[0013] Receive the IEC104 startup frame message sent by the master station through the TCP connection;
[0014] In response to the IEC104 start frame message, an IEC104 confirmation frame message is sent to the master station through the TCP connection.
[0015] As a preferred solution of the communication connection method of the present invention, wherein: in response to the IEC104 start frame message, after sending the IEC104 confirmation frame message to the master station through the TCP connection, it also includes:
[0016] Receive data acquisition request sent by the master station through TCP connection;
[0017] In response to the data acquisition request, data corresponding to the data acquisition request is sent to the master station through the TCP connection.
[0018] As a preferred solution of the communication connection method of the present invention, wherein: in response to the data acquisition request, after sending the data corresponding to the data acquisition request to the master station through the TCP connection, it also includes:
[0019] Receive control instructions sent by the master station through TCP connection; control instructions are used to control the configuration parameters of the slave station;
[0020] In response to the control instruction, adjusting the configuration parameters corresponding to the control instruction to obtain adjusted data;
[0021] The adjusted data is sent to the master via a TCP connection.
[0022] As a preferred solution of the communication connection method of the present invention, when the data corresponding to the data acquisition request sent to the master station through the TCP connection is voltage data, and the voltage value corresponding to the voltage data is greater than a preset threshold; in response to the data acquisition request, after sending the data corresponding to the data acquisition request to the master station through the TCP connection, it also includes:
[0023] Receive the voltage reduction control instruction sent by the master station through the TCP connection;
[0024] In response to the voltage reduction control instruction, adjusting the voltage of the slave station to obtain adjusted voltage data;
[0025] The adjusted voltage data is sent to the master via a TCP connection.
[0026] As a preferred solution of the communication connection method of the present invention, after receiving the communication connection success message sent by the master station through the TCP server, it also includes:
[0027] When the TCP connection between the master station and the slave station is disconnected, a communication connection request for requesting access to the master station is resent to the master station based on the connection information and the TCP client.
[0028] As a preferred solution of the communication connection method of the present invention, the execution process of the TCP connection is a three-way handshake of the TCP protocol.
[0029] In order to solve the above technical problems, the present invention also provides a communication connection device, which is applied to a communication system including a master station and a slave station; the master station is configured with a transmission control protocol TCP server; the slave station is configured with a TCP client; the communication connection device includes: an acquisition unit and a sending unit;
[0030] An acquisition unit, used to acquire connection information of the master station; the connection information includes an Internet Protocol IP address of the master station and a service port of a TCP server;
[0031] The sending unit is used to send a communication connection request for requesting access to the main station to the main station based on the connection information and the TCP client.
[0032] Beneficial effects of the present invention: Since the master station is configured with a TCP server and the slave station is configured with a TCP client, the slave station can obtain the connection information of the master station, and based on the connection information and the TCP client, send a communication connection request to the master station for requesting access to the master station; since the connection information includes the IP address of the master station and the service port of the TCP server, and the IP address of the master station is fixed, the slave station can quickly connect to the master station according to the fixed IP of the master station, which solves the technical problem that when the IP address of the slave station changes, the master station needs to re-establish a communication connection with the slave station according to the changed IP address, thereby improving the efficiency of the communication connection and reducing the complexity of the communication connection under the power Internet of Things. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. Among them:
[0034] Figure 1 A schematic diagram of the structure of a communication connection system provided by one embodiment of the present invention;
[0035] Figure 2 A flow chart of a communication connection method provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0036] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.
[0037] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0038] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.
[0039] The present invention is described in detail with reference to schematic diagrams. When describing the embodiments of the present invention, for the sake of convenience, the cross-sectional diagrams showing the device structure will not be partially enlarged according to the general scale, and the schematic diagrams are only examples, which should not limit the scope of protection of the present invention. In addition, in actual production, the three-dimensional dimensions of length, width and depth should be included.
[0040] At the same time, in the description of the present invention, it should be noted that the directions or positional relationships indicated by the terms "upper, lower, inner and outer" are based on the directions or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore cannot be understood as limiting the present invention. In addition, the terms "first, second or third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0041] In the present invention, unless otherwise clearly specified and limited, the terms "install, connect, connect" should be understood in a broad sense, for example: it can be a fixed connection, a detachable connection or an integral connection; it can also be a mechanical connection, an electrical connection or a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0042] Example 1
[0043] Reference Figure 1 , as an embodiment of the present invention, provides a communication connection system, including: a master station and a slave station.
[0044] The master station is configured with a Transmission Control Protocol (TCP) server; and the slave station is configured with a TCP client.
[0045] TCP is a connection-oriented, reliable, byte-stream-based transport layer communication protocol. TCP servers and TCP clients can perform data transmission via TCP.
[0046] Optionally, the TCP server is a server established on the master station according to the Netty technology; the TCP client is a client established on the slave station according to the Netty technology; the TCP server and the TCP client establish a TCP connection through the IEC104 standard.
[0047] The TCP server established on the master station through Netty technology can communicate based on the IEC104 standard, that is, the master station is established as an IEC104 master station.
[0048] Furthermore, the TCP client mode of the master station is changed to the server mode, thereby establishing the IEC104 master station server.
[0049] After establishing a TCP server on the master station through Netty technology, the master station can open the specified service port and configure the connection monitoring event. Later, after monitoring the slave station connection and establishing the connection, the master station can send the IEC104 startup frame message.
[0050] Optionally, a TCP client established on the slave station through Netty technology can communicate based on the IEC104 standard.
[0051] After establishing a TCP client on the slave station through Netty technology, the slave station can send a communication connection establishment request to the designated service port opened by the master station based on the fixed IP address of the master station. Subsequently, the master station monitors the connection request event in real time and establishes a connection after listening to the communication connection establishment request sent by the client.
[0052] Optionally, the master station can be connected via a wired network (such as a dedicated line, broadband, etc. Figure 1 Taking a dedicated line as an example) to access the Internet, so that the Internet assigns a fixed IP address to the main site.
[0053] The slave station can be connected through routers of various network standards (such as 4G routers, 5G routers, etc. Figure 1 Taking a 4G router as an example) access to the Internet, so that the Internet assigns a dynamic IP address to the slave station.
[0054] It should be noted that Figure 1 This is just an exemplary framework diagram. Figure 1 The number of slaves included in the .
[0055] Figure 1 The master station in the example can be the centralized control center in the power IoT scenario. The centralized control center has the function of monitoring and controlling power IoT devices, and is mainly used for centralized management of the power IoT devices connected to it.
[0056] Figure 1 The slave station in the network can be distributed photovoltaic, small energy station and other power Internet of Things devices connected to the master station.
[0057] Example 2
[0058] Reference Figure 2 , is an embodiment of the present invention, and provides a communication connection method, which is applied to a communication system including a master station and a slave station; the master station is configured with a TCP server; the slave station is configured with a TCP client; the communication connection method includes:
[0059] S201: The slave station obtains the connection information of the master station.
[0060] The connection information includes the IP address of the master station and the service port of the TCP server.
[0061] Specifically, combined with the above Figure 1 It can be seen that the master station can access the Internet through a wired network, so that the Internet can assign a fixed IP address to the master station. After establishing a TCP server on the master station through Netty technology, the master station can open the specified service port.
[0062] After the master station determines its own fixed IP address and designated service port, it can store its own fixed IP address and designated service port in a storage device. After establishing a TCP client on the slave station through Netty technology, the operation and maintenance personnel can obtain the IP address of the master station and the service port of the TCP server from the above storage device. Then, the operation and maintenance personnel can configure the IP address of the master station and the service port of the TCP server on the slave station, so that the slave station can obtain the connection information of the master station.
[0063] Optionally, after determining its own fixed IP address and designated service port, the master station can also directly send a notification message to the terminal held by the operation and maintenance personnel; the notification message includes the IP address of the master station and the service port of the TCP server. After establishing a TCP client on the slave station through Netty technology, the operation and maintenance personnel can directly configure the IP address of the master station and the service port of the TCP server on the slave station according to the notification message on the terminal, so that the slave station can obtain the connection information of the master station.
[0064] S202: The slave station sends a communication connection request for accessing the master station to the master station based on the connection information and the TCP client.
[0065] Specifically, after obtaining the connection information of the master station, since a TCP client is deployed on the slave station and a TCP server is deployed on the master station, the slave station can send a communication connection request to the master station for accessing the master station based on the connection information and the TCP client.
[0066] The communication connection request is used to request to establish a TCP connection with the master station.
[0067] The execution process of TCP connection is TCP Three-way Handshake.
[0068] The so-called "three-way handshake" refers to the three steps that the TCP server and client must go through to successfully establish a communication connection, which must be completed through three messages in total.
[0069] Generally speaking, the first party to send a SYN message is the client, and the server listens for connection requests from the client.
[0070] First handshake (HandshakeStep1):
[0071] The client sends a SYN message to the server to request to establish a connection.
[0072] At this time, the initial sequence number of the message is seq=x, and the confirmation number is ack=0. After sending, the client enters the SYN_SENT state.
[0073] Second handshake (HandshakeStep2):
[0074] After receiving the SYN message from the client, the server sends an ACK+SYN message (ACK=1, SYN=1) to confirm the client's request to establish a connection, and also initiates a connection request to it.
[0075] At this time, the sequence number of the message is seq=y, and the confirmation number is ack=x+1. After sending, the server enters the SYN_RCVD state.
[0076] The third handshake (HandshakeStep2):
[0077] After receiving the SYN message from the server, the client sends an ACK message (A) to confirm the server's request to establish a connection.
[0078] After sending, the client enters the ESTABLISHED state; when the server receives the message, it also enters the ESTABLISHED state.
[0079] At this point, the "three-way handshake" process is complete and the TCP communication connection is successfully established.
[0080] S203: The slave station receives a communication connection success message sent by the master station through the TCP server.
[0081] Specifically, the master station is configured with a connection monitoring event. After monitoring the communication connection request sent by the slave station based on the connection information and the TCP client, the master station can establish a TCP connection with the slave station. Then, the master station can send a communication connection success message to the slave station through the TCP server. Correspondingly, the slave station receives the communication connection success message sent by the master station through the TCP server.
[0082] The communication connection success message is used to instruct the master station to establish a TCP connection with the slave station.
[0083] S204: The slave station receives the IEC104 start frame message sent by the master station through the TCP connection.
[0084] Specifically, after the slave station establishes a TCP connection with the master station, the master station can send an IEC104 startup frame message to the slave station through the TCP connection. Correspondingly, the slave station receives the IEC104 startup frame message sent by the master station through the TCP connection.
[0085] The IEC104 startup frame message is a message indicating the startup of a TCP client based on the IEC104 standard.
[0086] IEC104 is an international standard widely used in power, urban rail transit and other industries. IEC104 is formulated by the International Electrotechnical Commission. IEC104 is a standard for transmitting the IEC101 Application Service Data Unit (ASDU) using the network protocol TCP / IP. This standard provides a communication protocol basis for network transmission of telecontrol information. By combining the 104 protocol with the 101 protocol's ASDU, the standardization of the protocol and the reliability of communication can be well guaranteed.
[0087] A frame is a transmission unit of the data link layer. It adds a header and a tail to the data passed in from the upper layer to form a frame.
[0088] A message is a unit of data exchanged and transmitted in a network, and is also a unit of network transmission. A message contains the complete data information to be sent, and its length does not need to be consistent. During the transmission process, messages are continuously encapsulated into groups, packets, and frames for transmission. The encapsulation method is to add a header composed of some control information, which is the message header.
[0089] S205: The slave station responds to the IEC104 start frame message and sends an IEC104 confirmation frame message to the master station through the TCP connection.
[0090] The IEC104 confirmation frame message is a message based on the IEC104 standard that confirms that the TCP client has been started.
[0091] Optionally, after the slave station sends an IEC104 confirmation frame message to the master station through the TCP connection in response to the IEC104 start frame message, the following further includes:
[0092] S206: The slave station receives the data acquisition request sent by the master station through the TCP connection.
[0093] Optionally, the data acquisition request is used to request data information from the slave station.
[0094] Among them, the data information includes the operating temperature, pressure, vibration frequency, angle and current of the distribution network.
[0095] For example, in the electric power Internet of Things scenario, various Internet of Things devices are involved in the process of power generation, transmission, transformation, distribution and consumption, such as various types of sensors, such as temperature sensors for measuring temperature, pressure sensors for measuring pressure, vibration sensors for measuring vibration, angle sensors for measuring angles, current sensors for measuring current, etc. Through this information, the operating status of the distribution network can be reflected from different angles.
[0096] S207: In response to the data acquisition request, the slave station sends data corresponding to the data acquisition request to the master station through the TCP connection.
[0097] After receiving the data acquisition request sent by the master station through the TCP connection, the slave station can send data corresponding to the data acquisition request to the master station through the TCP connection, so that the master station performs data preprocessing based on the data to obtain the operating status of the power Internet of Things.
[0098] Optionally, the master station has certain computing and storage capabilities, and can perform real-time analysis, processing and storage of data analysis results uploaded by the slave station.
[0099] S208: The slave station receives the control instruction sent by the master station through the TCP connection.
[0100] Among them, the control instructions are used to control the configuration parameters of the slave station.
[0101] The slave station can send data corresponding to the data acquisition request to the master station through the TCP connection, so that the master station can take corresponding actions according to the received data in a timely manner.
[0102] Optionally, when the data corresponding to the data acquisition request sent to the master station through the TCP connection is voltage data, and the voltage value corresponding to the voltage data is greater than a preset threshold; after the slave station responds to the data acquisition request and sends the data corresponding to the data acquisition request to the master station through the TCP connection, it also includes:
[0103] The slave receives the voltage reduction control instruction sent by the master through the TCP connection.
[0104] The slave station adjusts the voltage of the slave station in response to the voltage reduction control instruction to obtain adjusted voltage data.
[0105] The slave sends the adjusted voltage data to the master via TCP connection.
[0106] For example, if a slave station sends voltage data of 120V, the master station analyzes the voltage data 120V and determines that the voltage is higher than the preset voltage 100V, then the communication connection result that the voltage is higher than the preset voltage 100V is fed back to the slave station, so that the slave station can take corresponding actions, such as appropriately reducing the voltage.
[0107] S209: The slave station adjusts the configuration parameters corresponding to the control instruction in response to the control instruction to obtain adjusted data.
[0108] In combination with the above example, after receiving the control instruction sent by the master station, the slave station can respond to the control instruction and appropriately reduce the voltage to obtain a stepped-down voltage.
[0109] S210: The slave station sends the adjusted data to the master station via the TCP connection.
[0110] In combination with the above example, after the slave appropriately reduces the voltage to obtain the stepped-down voltage, the slave can send the stepped-down voltage to the master through the TCP connection.
[0111] Optionally, after the slave station receives the communication connection success message sent by the master station through the TCP server, it also includes:
[0112] S211: When the TCP connection between the master station and the slave station is disconnected, the slave station resends a communication connection request for accessing the master station to the master station based on the connection information and the TCP client.
[0113] Specifically, due to network reasons or when there is no data to transmit for a long time, the master station may disconnect the TCP connection with the slave station. In this case, the slave station can resend the communication connection request for requesting access to the master station based on the connection information and the TCP client.
[0114] Since the IP address of the master station is fixed, the slave station can quickly reconnect to the master station based on the fixed IP of the master station, which solves the technical problem that when the IP address of the slave station changes, the master station needs to re-establish the communication connection with the slave station based on the changed IP address. This improves the efficiency of the communication connection and reduces the complexity of the communication connection under the power Internet of Things.
[0115] It should be noted that the order of the above S204 - S210 and S211 is not limited.
[0116] Example 3
[0117] The present invention provides a communication connection device, which is applied to a communication system including a master station and a slave station; the master station is configured with a TCP server; the slave station is configured with a TCP client; the communication connection device includes: an acquisition unit and a sending unit;
[0118] An acquisition unit, used to acquire connection information of the master station; the connection information includes an Internet Protocol IP address of the master station and a service port of a TCP server;
[0119] The sending unit is used to send a communication connection request for requesting access to the main station to the main station based on the connection information and the TCP client.
[0120] Optionally, the TCP server is a server established on the master station according to the Netty technology; the TCP client is a client established on the slave station according to the Netty technology; the TCP server and the TCP client establish a TCP connection through the IEC104 standard.
[0121] Optionally, the receiving unit is further used to receive a communication connection success message sent by the master station through the TCP server; the communication connection success message is used to instruct the master station to establish a TCP connection with the slave station.
[0122] Optionally, the receiving unit is further used to receive an IEC104 start frame message sent by the master station through a TCP connection;
[0123] The sending unit is further used to send an IEC104 confirmation frame message to the master station through the TCP connection in response to the IEC104 start frame message.
[0124] Optionally, the receiving unit is further used to receive a data acquisition request sent by the master station through a TCP connection;
[0125] The sending unit is further used to respond to the data acquisition request and send data corresponding to the data acquisition request to the main station through the TCP connection.
[0126] Optionally, the receiving unit is further used to receive a control instruction sent by the master station through the TCP connection; the control instruction is used to control the configuration parameters of the slave station;
[0127] The sending unit is further used to adjust the configuration parameters corresponding to the control instruction in response to the control instruction to obtain adjusted data;
[0128] The sending unit is also used to send the adjusted data to the master station through the TCP connection.
[0129] Optionally, when the data corresponding to the data acquisition request sent to the master station through the TCP connection is voltage data, and the voltage value corresponding to the voltage data is greater than a preset threshold, the receiving unit is further used to receive a voltage reduction control instruction sent by the master station through the TCP connection;
[0130] The sending unit is further used to adjust the voltage of the slave station in response to the voltage reduction control instruction to obtain adjusted voltage data;
[0131] The sending unit is further used to send the adjusted voltage data to the master station through the TCP connection.
[0132] Optionally, the sending unit is further used to resend the communication connection request for requesting access to the master station to the master station based on the connection information and the TCP client when the TCP connection between the master station and the slave station is disconnected.
[0133] Optionally, the execution process of the TCP connection is a TCP protocol three-way handshake.
[0134] The present invention further provides an electronic device, the electronic device comprising:
[0135] processor;
[0136] a memory for storing processor-executable instructions;
[0137] The processor is configured to execute instructions to implement Figure 2 The communication connection method shown.
[0138] The present invention also provides a computer-readable storage medium, on which instructions are stored. When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device can execute the following Figure 2 The communication connection method shown.
[0139] It should be appreciated that embodiments of the present invention may be implemented or enforced by computer hardware, a combination of hardware and software, or by computer instructions stored in a non-transitory computer-readable memory. The method may be implemented in a computer program using standard programming techniques - including a non-transitory computer-readable storage medium configured with a computer program, wherein the storage medium so configured causes the computer to operate in a specific and predefined manner - according to the methods and drawings described in the specific embodiments. Each program may be implemented in a high-level procedural or object-oriented programming language to communicate with a computer system. However, if desired, the program may be implemented in an assembly or machine language. In any case, the language may be a compiled or interpreted language. In addition, the program may be run on a programmed ASIC for this purpose.
[0140] Furthermore, the operations of the processes described herein may be performed in any suitable order unless otherwise indicated herein or otherwise clearly contradicted by context. The processes described herein (or variations and / or combinations thereof) may be performed under the control of one or more computer systems configured with executable instructions, and may be implemented as code (e.g., executable instructions, one or more computer programs, or one or more applications) that is executed collectively on one or more processors, by hardware, or a combination thereof. The computer program includes a plurality of instructions that may be executed by one or more processors.
[0141] Further, the method can be implemented in any type of computing platform that is operably connected to a suitable computer, including but not limited to a personal computer, a minicomputer, a mainframe, a workstation, a network or distributed computing environment, a separate or integrated computer platform, or in communication with a charged particle tool or other imaging device, etc. Aspects of the present invention can be implemented in machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into a computing platform, such as a hard disk, an optical read and / or write storage medium, a RAM, a ROM, etc., so that it can be read by a programmable computer, and when the storage medium or device is read by the computer, it can be used to configure and operate the computer to perform the process described herein. In addition, the machine-readable code, or part thereof, can be transmitted via a wired or wireless network. When such media includes instructions or programs that implement the steps described above in conjunction with a microprocessor or other communication connector, the invention described herein includes these and other different types of non-transitory computer-readable storage media. When programmed according to the methods and techniques described in the present invention, the present invention also includes the computer itself. The computer program can be applied to input data to perform the functions described herein, thereby converting the input data to generate output data stored in a non-volatile memory. The output information can also be applied to one or more output devices such as a display. In a preferred embodiment of the present invention, the converted data represents a physical and tangible object, including a specific visual depiction of the physical and tangible object produced on a display.
[0142] As used in this application, the terms "component", "module", "system", etc. are intended to refer to a computer-related entity, which can be hardware, firmware, a combination of hardware and software, software, or software in operation. For example, a component can be, but is not limited to: a process running on a processor, a processor, an object, an executable file, a thread in execution, a program, and / or a computer. As an example, an application running on a computing device and the computing device can both be components. One or more components can exist in a process and / or thread in execution, and a component can be located in a computer and / or distributed between two or more computers. In addition, these components can be executed from various computer-readable media having various data structures thereon. These components can communicate in a local and / or remote process manner, such as according to a signal having one or more data packets (e.g., data from a component that interacts with another component in a local system, a distributed system, and / or interacts with other systems in a signal manner through a network such as the Internet).
[0143] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
Claims
1. A communication connection method, characterized in that: Applicable to a communication system including a master station and a slave station; the master station is configured with a transmission control protocol TCP server; the slave station is configured with a TCP client; the communication connection method includes: Acquire the connection information of the master station; the connection information includes the Internet Protocol IP address of the master station and the service port of the TCP server; The slave station sends a communication connection request for requesting access to the master station to the master station based on the connection information and the TCP client; The TCP server is a server established on the master station according to the Netty technology; the TCP client is a client established on the slave station according to the Netty technology; the TCP server and the TCP client establish a TCP connection through the IEC104 standard; After the slave station sends a communication connection request for requesting access to the master station based on the connection information and the TCP client, the slave station further includes: Receiving a communication connection success message sent by the master station through the TCP server; the communication connection success message is used to instruct the master station to establish the TCP connection with the slave station; The master station can access the Internet through a wired network, so that the Internet can assign a fixed IP address to the master station; after establishing a TCP server on the master station through Netty technology, the master station can open the specified service port; After the master station determines its own fixed IP address and designated service port, it can store its own fixed IP address and designated service port in a storage device; after establishing a TCP client on the slave station through Netty technology, the operation and maintenance personnel can obtain the IP address of the master station and the service port of the TCP server from the above storage device; then, the operation and maintenance personnel can configure the IP address of the master station and the service port of the TCP server on the slave station, so that the slave station can obtain the connection information of the master station; After determining its own fixed IP address and designated service port, the master station can also directly send a notification message to the terminal held by the operation and maintenance personnel; the notification message includes the IP address of the master station and the service port of the TCP server; after establishing a TCP client on the slave station through Netty technology, the operation and maintenance personnel can directly configure the IP address of the master station and the service port of the TCP server on the slave station according to the notification message on the terminal, so that the slave station can obtain the connection information of the master station; Wherein, the communication connection request is used to request to establish a TCP connection with the master station; The execution process of TCP connection is the TCP protocol three-way handshake. The so-called three-way handshake refers to the three steps that the TCP server and the client must go through to successfully establish a communication connection, which needs to be completed through three messages in total; The first party to send the SYN message is the client, and the server listens for the connection establishment request from the client; First handshake: The client sends a SYN message to the server to request to establish a connection; At this time, the initial sequence number of the message is seq=x, and the confirmation number is ack=0. After sending, the client enters the SYN_SENT state; Second handshake: After receiving the SYN message from the client, the server sends an ACK+SYN message ACK=1, SYN=1 to confirm the client's connection request, and also initiates a connection request to it; At this time, the sequence number of the message is seq=y, and the confirmation number is ack=x+1. After sending, the server enters the SYN_RCVD state; The third handshake: After receiving the SYN message from the server, the client sends an ACK message A to confirm the server's request to establish a connection; After sending, the client enters the ESTABLISHED state; when the server receives the message, it also enters the ESTABLISHED state; At this point, the three-way handshake process is complete and the TCP communication connection is successfully established; After receiving the communication connection success message sent by the master station through the TCP server, it also includes: Receiving an IEC104 startup frame message sent by the master station through the TCP connection; In response to the IEC104 start frame message, sending an IEC104 confirmation frame message to the master station through the TCP connection; In response to the IEC104 start frame message, after sending the IEC104 confirmation frame message to the master station through the TCP connection, the method further includes: Receiving a data acquisition request sent by the master station through the TCP connection; In response to the data acquisition request, sending data corresponding to the data acquisition request to the master station through the TCP connection; In response to the data acquisition request, after sending data corresponding to the data acquisition request to the master station through the TCP connection, the method further includes: receiving a control instruction sent by the master station through the TCP connection; the control instruction is used to control the configuration parameters of the slave station; In response to the control instruction, adjusting the configuration parameters corresponding to the control instruction to obtain adjusted data; Sending the adjusted data to the master station via the TCP connection; When the data corresponding to the data acquisition request sent to the master station through the TCP connection is voltage data, and the voltage value corresponding to the voltage data is greater than a preset threshold; after responding to the data acquisition request and sending the data corresponding to the data acquisition request to the master station through the TCP connection, the method further includes: receiving a voltage reduction control instruction sent by the master station through the TCP connection; In response to the voltage reduction control instruction, adjusting the voltage of the slave station to obtain adjusted voltage data; Sending the adjusted voltage data to the master station via the TCP connection; After receiving the communication connection success message sent by the master station through the TCP server, the method further includes: When the TCP connection between the master station and the slave station is disconnected, a communication connection request for requesting access to the master station is resent to the master station based on the connection information and the TCP client.
Citation Information
Patent Citations
Modbus serial communication method for industrial equipment
CN110213385A