Stadium communication method, system and storage medium based on multiple TCP connections

By establishing a primary TCP connection between the edge gateway and the cloud server, and establishing different sub-TCP connections according to the sub-connection creation instructions, the real-time data transmission problem caused by the concentration of communication tasks on a single link is solved, achieving more efficient data transmission and flexible communication task processing.

CN120281804BActive Publication Date: 2026-01-09SHENZHEN PAPA SPORTS TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510548154.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-28
Publication Date
2026-01-09
Estimated Expiration
2045-04-28

AI Technical Summary

Technical Problem

In existing technologies, the communication tasks between edge gateways and cloud servers are concentrated on a single link, resulting in poor real-time data transmission and affecting the real-time performance of data transmission.

Method used

A primary TCP connection is established between the edge gateway and the cloud server, and different sub-TCP connections are established according to the sub-connection creation instructions to perform different communication tasks, such as transparent transmission of control commands and HTTP requests.

Benefits of technology

By creating multiple TCP connections, communication tasks are avoided from being concentrated on a single link, improving the real-time performance and flexibility of data transmission and adapting to complex communication scenarios and business needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120281804B_ABST
    Figure CN120281804B_ABST
Patent Text Reader

Abstract

The application provides a stadium communication method and system based on multiple TCP connections, and a storage medium, and belongs to the technical field of communication. The method comprises the following steps: establishing a main TCP connection between an edge gateway and a cloud server; if the edge gateway receives a sub-connection creation instruction issued by the cloud server through the main TCP connection, establishing a sub-TCP connection with the cloud server according to the sub-connection creation instruction; receiving a control instruction issued by the cloud server through the sub-TCP connection by using the edge gateway, and transmitting the control instruction to a target terminal hardware in the stadium; and receiving an HTTP request issued by the cloud server through the sub-TCP connection by using the edge gateway, and forwarding the HTTP request to a target web service in a local area network where the edge gateway is located. Different TCP connections are created to perform different communication tasks, so that the problem of influencing the real-time data transmission caused by the fact that communication tasks are concentrated on a single link can be effectively avoided.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of communication, in particular to a stadium communication method and system based on multiple TCP connections and a storage medium. BACKGROUND

[0002] In the intelligent management scenario of a stadium, an edge gateway as a host computer is connected to terminal hardware in the stadium through a serial port protocol, or is connected to other services in a local area network through an RJ-45 network port, and needs to establish a stable TCP connection with a cloud server to transmit control instructions in real time and proxy forward HTTP requests to communicate with other services in the local area network. The traditional edge gateway usually uses a single TCP connection to connect to the server, and all communication tasks are concentrated on a single link, which can easily cause link congestion and affect data transmission real-time performance.

[0003] Therefore, the prior art has defects and needs to be improved and developed. SUMMARY

[0004] The technical problem to be solved by the present application is to provide a stadium communication method and device based on multiple TCP connections, a terminal and a storage medium, aiming at solving the problem of affecting data transmission real-time performance caused by the fact that the communication tasks of the edge gateway and the cloud server are concentrated on a single link in the prior art.

[0005] The technical solution adopted by the present application to solve the technical problem is as follows:

[0006] In a first aspect, the present application provides a stadium communication method based on multiple TCP connections, which comprises:

[0007] establishing a main TCP connection between the edge gateway and the cloud server;

[0008] If the edge gateway receives a sub-connection creation instruction issued by the cloud server through the main TCP connection, a sub-TCP connection with the cloud server is established according to the sub-connection creation instruction;

[0009] The edge gateway receives control instructions issued by the cloud server through the sub-TCP connection, and transmits the control instructions to target terminal hardware in the stadium;

[0010] The edge gateway receives HTTP requests issued by the cloud server through the sub-TCP connection, and forwards the HTTP requests to target web services in the local area network where the edge gateway is located.

[0011] In an embodiment, the main TCP connection between the edge gateway and the cloud server is established, comprising:

[0012] acquire and parse the preset connection data by using the edge gateway to obtain a username and a password of the edge gateway, an IP address and a port of the cloud server, and a first connection identifier, the first connection identifier containing a preset role number, a physical MAC fingerprint of the edge gateway, and a connection serial number;

[0013] initiate a TCP three-way handshake by using the edge gateway to a target address composed of the IP address and the port of the cloud server;

[0014] if the TCP three-way handshake is successful, generate a first identity authentication request based on the username, the password, and the local IP address of the edge gateway, and the first connection identifier, and send the first identity authentication request to the cloud server;

[0015] if the verification result of the first identity authentication request is passed, perform secondary authentication with the cloud server;

[0016] if the secondary authentication is passed, complete the establishment of the main TCP connection.

[0017] In an embodiment, the secondary authentication with the cloud server comprises:

[0018] receive an encrypted message generated by the cloud server by using the edge gateway, and decrypt the encrypted message to obtain an original data message;

[0019] modify a preset field in the original data message by using the edge gateway, and encrypt the modified data to obtain a second encrypted message;

[0020] send the second encrypted message to the cloud server by using the edge gateway.

[0021] In an embodiment, after the main TCP connection is established between the edge gateway and the cloud server, the method further comprises:

[0022] start a heartbeat mechanism to keep alive the main TCP connection.

[0023] In an embodiment, the sub-TCP connection with the cloud server is established according to the sub-connection creation instruction, comprising:

[0024] parse the sub-connection creation instruction to obtain a role type of the sub-connection;

[0025] establish a corresponding sub-TCP connection between the edge gateway and the cloud server according to the role type. In an embodiment, the corresponding sub-TCP connection between the edge gateway and the cloud server is established according to the role type, comprising:

[0026] If the role type is a working connection, then the role number corresponding to the working connection, the physical MAC fingerprint of the edge gateway, and the current TCP connection sequence number of the edge gateway are combined to form the second connection identifier.

[0027] The edge gateway is used to initiate a TCP three-way handshake to the target address consisting of the IP address and port of the cloud server;

[0028] If the TCP three-way handshake is successful, a second authentication request is generated based on the username, password, and local IP address of the edge gateway, as well as the second connection identifier, and sent to the cloud server.

[0029] If the verification result of the second identity authentication request is successful, then a second authentication is performed with the cloud server;

[0030] If the secondary authentication is successful, the protocol type corresponding to the role type is bound to complete the establishment of the working TCP connection, which is used to transmit control commands issued by the cloud server.

[0031] In one implementation, establishing a corresponding sub-TCP connection between the edge gateway and the cloud server based on the role type further includes:

[0032] If the role type is a proxy connection, then the second role number corresponding to the proxy connection, the physical MAC fingerprint of the edge gateway, and the current TCP connection sequence number of the edge gateway are combined to form the third connection identifier.

[0033] The edge gateway is used to initiate a TCP three-way handshake to the target address consisting of the IP address and port of the cloud server;

[0034] If the TCP three-way handshake is successful, a third authentication request is generated based on the username, password, and local IP address of the edge gateway, as well as the third connection identifier, and sent to the cloud server.

[0035] If the verification result of the third-party authentication request is successful, then a second authentication is performed with the cloud server;

[0036] If the secondary authentication is successful, the protocol type corresponding to the role type is bound to complete the establishment of the proxy TCP connection, which is used to transmit HTTP requests issued by the cloud server.

[0037] In one implementation, before establishing a corresponding sub-TCP connection between the edge gateway and the cloud server based on the role type, the method further includes:

[0038] Obtain the MAC address of the physical network interface card of the edge gateway;

[0039] The MAC address is hashed in the cloud to obtain the physical MAC fingerprint.

[0040] In a second aspect, the embodiments of the present application further provide a stadium communication system based on multiple TCP connections, which comprises:

[0041] a main TCP connection establishment module, configured to establish a main TCP connection between an edge gateway and a cloud server;

[0042] a dynamic TCP connection establishment module, configured to, if the edge gateway receives a sub-connection creation instruction issued by the cloud server through the main TCP connection, establish a sub-TCP connection with the cloud server according to the sub-connection creation instruction;

[0043] an instruction transparent transmission module, configured to receive a control instruction issued by the cloud server through the sub-TCP connection by using the edge gateway, and transparently transmit the control instruction to a target terminal hardware in the stadium;

[0044] an instruction forwarding module, configured to receive an HTTP request issued by the cloud server through the sub-TCP connection by using the edge gateway, and forward the HTTP request to a target web service in a local area network where the edge gateway is located.

[0045] In a third aspect, the embodiments of the present application further provide a computer readable storage medium, which stores a stadium communication program based on multiple TCP connections, and the stadium communication program based on multiple TCP connections can be executed to implement the steps of the stadium communication method based on multiple TCP connections.

[0046] The present application has the following beneficial effects: the present application establishes a main TCP connection between an edge gateway and a cloud server, establishes a sub-TCP connection with the cloud server according to a sub-connection creation instruction if the edge gateway receives the sub-connection creation instruction issued by the cloud server through the main TCP connection, receives a control instruction issued by the cloud server through the sub-TCP connection by using the edge gateway, and transparently transmits the control instruction to a target terminal hardware in the stadium, and receives an HTTP request issued by the cloud server through the sub-TCP connection by using the edge gateway, and forwards the HTTP request to a target web service in a local area network where the edge gateway is located. The present application can effectively avoid the problem of affecting the real-time data transmission caused by the communication tasks concentrated on a single link by creating different TCP connections to perform different communication tasks. BRIEF DESCRIPTION OF DRAWINGS

[0047] Figure 1 is a flowchart of a preferred embodiment of the stadium communication method based on multiple TCP connections in the present application.

[0048] Figure 2 is a flowchart of the main TCP connection establishment in the present application.

[0049] Figure 3 is a flow chart of role verification in the present application.

[0050] Figure 4 is a schematic diagram of establishing different TCP connections according to different instructions in the present application.

[0051] Figure 5 is a structural schematic diagram of a preferred embodiment of a stadium communication system based on multiple TCP connections in the present application. DETAILED DESCRIPTION

[0052] In order to make the purpose, technical solutions and advantages of the present application clearer and more explicit, the present application is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific examples described herein are only used to explain the present application and do not limit the present application.

[0053] In the intelligent management scenario of a stadium, an edge gateway as a host computer interfaces with terminal hardware in the stadium through a serial port protocol, or communicates with other services in a local area network through an RJ-45 network port, and at the same time needs to establish a stable TCP connection with a cloud server to real-time transparently transmit control instructions and proxy forward HTTP requests to communicate with other services in the local area network. The traditional edge gateway usually uses a single TCP connection to connect with the server, and all communication tasks are concentrated on a single link, which is easy to cause link congestion and affect data transmission real-time performance.

[0054] In view of the above defects of the prior art, the present application provides a stadium communication method, system and storage medium based on multiple TCP connections, which comprises the following steps:

[0055] Referring to Figure 1 , the stadium communication method based on multiple TCP connections described in the embodiments of the present application comprises the following steps:

[0056] Step S100, a main TCP connection is established between the edge gateway and the cloud server.

[0057] Specifically, the main TCP connection as the basic control channel of the communication system needs to be established and kept in a long connection state in priority. The instructions for creating all subsequent sub-TCP connections need to be issued through the main TCP connection.

[0058] In an implementation manner, the main TCP connection is established between the edge gateway and the cloud server, comprising:

[0059] The edge gateway is used to obtain and analyze preset connection data to obtain a username and a password of the edge gateway, an IP address and a port of the cloud server, and a first connection identifier, wherein the first connection identifier contains a preset role number, a physical MAC fingerprint of the edge gateway, and a connection serial number;

[0060] The edge gateway is used to initiate a TCP three-way handshake to a target address composed of the IP address and the port of the cloud server;

[0061] If the TCP three-way handshake is successful, a first identity authentication request is generated based on the username, the password, and the local IP address of the edge gateway, and the first connection identifier, and is sent to the cloud server;

[0062] If the verification result of the first identity authentication request is passed, secondary authentication is performed with the cloud server;

[0063] If the secondary authentication is passed, the establishment of the main TCP connection is completed.

[0064] Specifically, the connection data is preset in the edge gateway configuration file in the form of a standardized string. The format is username:password@tcp(IP:Port) / WorkerID. Among them, username is the username of the edge gateway, password is the password of the edge gateway, IP is the IP address of the server, Port is the port of the server, and WorkerID is the connection identifier. The format of the connection identifier is: device physical MAC fingerprint_role number_connection serial number. For example, the first connection identifier can be A1B2C3D4E5F6_00_0001. A1B2C3D4E5F6 is the physical MAC fingerprint of the edge gateway, 00 is the role number, indicating the role of the connection, and 0001 is the connection serial number, which is the serial number of the current TCP connection of the edge gateway. A counter is set in the edge gateway, and the counter is incremented by 1 to update the connection serial number each time a new TCP connection is established. In the present application, the role types involved include three types: master connection, worker connection, and proxy connection. The role number corresponding to the master connection is 00, the role number corresponding to the worker connection is 01, and the role number corresponding to the proxy connection is 02. Different connection roles limit different TCP link functions. For example, in the present application, the master connection can only be used to transmit sub-connection creation instructions. The worker connection is only used to transmit control instructions for terminal hardware in the sports venue, and the proxy connection is only used to transmit HTTP requests.

[0065] The flowchart of the master TCP connection establishment is shown in Figure 2 After the first identity authentication request is sent to the cloud server, the cloud server verifies the username, password, local IP address, and first connection identifier of the edge gateway in the first identity authentication request. Specifically, the cloud server stores the username, password, and local IP address of each edge gateway and compares them step by step. When the above comparisons are all passed, role verification is also performed. Specifically, the MAC fingerprint in the first connection identifier is verified, and if the verification is passed, the role number is further verified; if the verification is passed, the connection serial number is further verified to see if it is continuous. If any of the above verifications fails, the underlying transmission channel generated by the TCP three-way handshake is disconnected and an alarm information is generated. After all the verifications are passed, it is determined that the verification result of the first identity authentication request is passed, and a second authentication is initiated. This process can be as shown in Figure 3 .

[0066] In one implementation, if the TCP three-way handshake fails, the establishment of the master TCP connection is ended and an error log is recorded.

[0067] In one implementation, if the verification result of the first identity authentication request is failed, the establishment of the master TCP connection is ended and an error log is recorded.

[0068] In an implementation, if the secondary authentication fails, the establishment of the main TCP connection is ended and an error log is recorded.

[0069] In an implementation, the secondary authentication with the cloud server comprises:

[0070] The encrypted message generated by the cloud server is received by the edge gateway, and the encrypted message is decrypted to obtain an original data message;

[0071] The original data message is modified in a preset field by the edge gateway, and the modified data is encrypted to obtain a second encrypted message;

[0072] The second encrypted message is sent to the cloud server by the edge gateway.

[0073] Specifically, after the first identity authentication request is verified, the cloud server generates an original data message composed of a random number and a timestamp, encrypts the original data message by using an encryption algorithm, generates an encrypted message, and sends the encrypted message to the edge gateway. The original data message is obtained by the edge gateway after decryption, the random number is modified, the modified original data message is encrypted by using the same encryption algorithm to obtain a second encrypted message. The random number modification method can be to perform a fixed value operation on the random number. After the edge gateway sends the second encrypted message to the cloud server, the cloud server decrypts the second encrypted message, verifies the validity of the timestamp to prevent replay attacks. In addition, the modified random number is also verified to be obtained by performing a fixed value operation on the random number. Both verifications are successful, and the secondary authentication is successful. The present application can effectively improve the security of the TCP connection by setting the secondary authentication, and avoid illegal occupation of server resources or attacks.

[0074] In an implementation, after the main TCP connection is established between the edge gateway and the cloud server, the method further comprises:

[0075] A heartbeat mechanism is started to keep the main TCP connection alive.

[0076] Specifically, since the main TCP connection is a basic TCP connection, it needs to be kept alive. Therefore, a heartbeat is sent every 5 seconds to keep it alive. When there is an instruction transmission in the main TCP connection, the heartbeat sending is stopped.

[0077] Please refer to Figure 1 The multi-TCP connection-based stadium communication method according to the embodiments of the present application further comprises the following steps:

[0078] In step S200, if the edge gateway receives a sub-connection creation instruction issued by the cloud server through the main TCP connection, a sub-TCP connection with the cloud server is established according to the sub-connection creation instruction.

[0079] Specifically, after the main TCP connection is established, if a sub-connection creation instruction is received, different sub-TCP connections are established according to the sub-connection creation instruction. Subsequent control instructions of terminal hardware in the sports venue or HTTP requests can be transmitted based on the sub-TCP connections. The application can effectively avoid the problem of affecting the real-time data transmission caused by the communication tasks concentrated on a single link by creating different TCP connections to perform different communication tasks. In addition, this method can cope with complex communication scenarios and flexibly create new sub-TCP connections to meet different business needs.

[0080] In an implementation manner, the sub-TCP connection with the cloud server is established according to the sub-connection creation instruction, and the method comprises:

[0081] The sub-connection creation instruction is parsed to obtain a role type of the sub-connection.

[0082] The corresponding sub-TCP connection is established between the edge gateway and the cloud server according to the role type.

[0083] Specifically, the role type is included in the sub-connection creation instruction. Different role types have different ways of establishing sub-TCP connections.

[0084] In an implementation manner, the corresponding sub-TCP connection is established between the edge gateway and the cloud server according to the role type, and the method comprises:

[0085] If the role type is a working connection, a role number corresponding to the working connection, a physical MAC fingerprint of the edge gateway, and a current TCP connection sequence number of the edge gateway are combined to form a second connection identifier.

[0086] A TCP three-way handshake is initiated by the edge gateway to a target address composed of an IP address and a port of the cloud server.

[0087] If the TCP three-way handshake is successful, a second identity authentication request is generated based on a username, a password, and a local IP address of the edge gateway, and the second connection identifier, and is sent to the cloud server.

[0088] If the verification result of the second identity authentication request is passed, a second authentication is performed with the cloud server.

[0089] If the second authentication is passed, a protocol type corresponding to the role type is bound to complete the establishment of a working TCP connection. The working TCP connection is used to transmit control instructions issued by the cloud server and receive response data returned by the target terminal hardware.

[0090] Specifically, when the role type is a work connection, it means that the to-be-established sub-TCP connection is used for transmitting the control instruction for the terminal hardware in the stadium issued by the cloud server. When the work TCP connection is established, the three-way handshake, identity authentication and secondary authentication are also performed. The process here is consistent with the way of the main TCP connection, only the connection identifier is different, which will not be repeated here. The protocol type corresponding to the work connection includes the Modbus protocol and the level signal protocol. The Modbus protocol can be used for the lamp control module of the stadium, and the level signal protocol can be used for the gate relay, water control switch and the like of the stadium.

[0091] In an implementation manner, the corresponding sub-TCP connection is established between the edge gateway and the cloud server according to the role type, and further comprising:

[0092] If the role type is a proxy connection, a second role number corresponding to the proxy connection, a physical MAC fingerprint of the edge gateway and a current TCP connection serial number of the edge gateway are combined to form a third connection identifier;

[0093] A TCP three-way handshake is initiated by the edge gateway to a target address composed of an IP address and a port of the cloud server;

[0094] If the TCP three-way handshake is successful, a third identity authentication request is generated based on a username, a password and a local IP address of the edge gateway and the third connection identifier, and is sent to the cloud server;

[0095] If the verification result of the third identity authentication request is passed, secondary authentication is performed with the cloud server;

[0096] If the secondary authentication is passed, the protocol type corresponding to the role type is bound to complete the establishment of the proxy TCP connection, and the proxy TCP connection is used for transmitting the HTTP request issued by the cloud server and receiving the response data returned by the target web service.

[0097] Specifically, when the role type is a proxy connection, it means that the to-be-established sub-TCP connection is used for transmitting the HTTP request issued by the cloud server. When the proxy TCP connection is established, the three-way handshake, identity authentication and secondary authentication are also performed. The process here is consistent with the way of the main TCP connection, only the connection identifier is different, which will not be repeated here. The protocol type corresponding to the proxy connection is the HTTP protocol.

[0098] Please refer to Figure 1 The communication method of the stadium based on multiple TCP connections described in the embodiment of the application further comprises the following steps:

[0099] Step S300, receiving the control instruction issued by the cloud server through the sub-TCP connection by the edge gateway, and transmitting the control instruction to the target terminal hardware in the stadium.

[0100] Specifically, the control instruction contains the IP address of the target terminal hardware.

[0101] Please refer to Figure 1 The multi-TCP connection-based stadium communication method according to the embodiment of the application further includes the following steps:

[0102] Step S400, receiving the HTTP request issued by the cloud server through the sub-TCP connection by the edge gateway, and forwarding the HTTP request to the target web service in the local area network where the edge gateway is located.

[0103] Specifically, the HTTP request contains a URL address, and the corresponding target web service can be determined according to the URL address, and the HTTP request is forwarded.

[0104] The schematic diagram of the application according to different instructions to establish different TCP connections is shown in Figure 4 By creating different TCP connections to perform different communication tasks, the problem of affecting the real-time data transmission caused by the communication tasks concentrated on a single link can be effectively avoided.

[0105] In summary, the application establishes a main TCP connection between the edge gateway and the cloud server; if the edge gateway receives a sub-connection creation instruction issued by the cloud server through the main TCP connection, a sub-TCP connection with the cloud server is established according to the sub-connection creation instruction; the control instruction issued by the cloud server is received through the sub-TCP connection by the edge gateway, and the control instruction is transmitted to the target terminal hardware in the stadium; the HTTP request issued by the cloud server is received through the sub-TCP connection by the edge gateway, and the HTTP request is forwarded to the target web service in the local area network where the edge gateway is located. By creating different TCP connections to perform different communication tasks, the problem of affecting the real-time data transmission caused by the communication tasks concentrated on a single link can be effectively avoided.

[0106] In one embodiment, as shown in Figure 5 Based on the above multi-TCP connection-based stadium communication method, the application further provides a multi-TCP connection-based stadium communication system, which includes:

[0107] The main TCP connection establishment module is configured to establish a main TCP connection between the edge gateway and the cloud server.

[0108] The dynamic TCP connection establishment module is configured to establish a sub-TCP connection with the cloud server according to a sub-connection creation instruction issued by the cloud server through the main TCP connection if the edge gateway receives the sub-connection creation instruction.

[0109] The instruction transmission module is configured to receive a control instruction issued by the cloud server through the sub-TCP connection by using the edge gateway, and transmit the control instruction to a target terminal hardware in the stadium.

[0110] The instruction transmission module is configured to receive a control instruction issued by the cloud server through the sub-TCP connection by using the edge gateway, and transmit the control instruction to a target terminal hardware in the stadium.

[0111] In an embodiment, the main TCP connection establishment module comprises:

[0112] The data analysis unit is configured to acquire and analyze preset connection data by using the edge gateway to obtain a username and a password of the edge gateway, an IP address and a port of the cloud server, and a first connection identifier, wherein the first connection identifier comprises a preset role number, a physical MAC fingerprint of the edge gateway, and a connection serial number.

[0113] The main TCP three-way handshake unit is configured to initiate a TCP three-way handshake to a target address composed of the IP address and the port of the cloud server by using the edge gateway.

[0114] The main TCP identity authentication unit is configured to generate a first identity authentication request based on the username, the password, and the local IP address of the edge gateway, and the first connection identifier, and send the first identity authentication request to the cloud server if the TCP three-way handshake is successful.

[0115] The main TCP secondary authentication unit is configured to perform secondary authentication with the cloud server if the verification result of the first identity authentication request is passed.

[0116] The main TCP establishment unit is configured to complete the establishment of the main TCP connection if the secondary authentication is passed.

[0117] In an embodiment, the system further comprises:

[0118] The decryption unit is configured to receive an encrypted message generated by the cloud server by using the edge gateway, and decrypt the encrypted message to obtain an original data message.

[0119] The encryption unit is configured to modify a preset field in the original data message by using the edge gateway, and encrypt the modified data to obtain a second encrypted message.

[0120] A message sending unit is configured to send the second encrypted message to a cloud server by using the edge gateway.

[0121] In an embodiment, the system further comprises:

[0122] A keep-alive unit is configured to start a heartbeat mechanism to keep the main TCP connection alive.

[0123] In an embodiment, the system further comprises:

[0124] An analysis unit is configured to analyze the sub-connection creation instruction to obtain a role type of the sub-connection.

[0125] A sub-connection establishing unit is configured to establish a corresponding sub-TCP connection between the edge gateway and the cloud server according to the role type.

[0126] In an embodiment, the system further comprises:

[0127] A second connection identifier generating unit is configured to, if the role type is a working connection, generate a second connection identifier by combining a role number corresponding to the working connection, a physical MAC fingerprint of the edge gateway, and a current TCP connection sequence number of the edge gateway.

[0128] A working TCP three-way handshake unit is configured to initiate a TCP three-way handshake by using the edge gateway and sending a target address composed of an IP address and a port of the cloud server.

[0129] A working TCP identity authentication unit is configured to, if the TCP three-way handshake is successful, generate a second identity authentication request based on a username, a password, and a local IP address of the edge gateway, and the second connection identifier, and send the second identity authentication request to the cloud server.

[0130] A working TCP secondary authentication unit is configured to, if a verification result of the second identity authentication request is passed, perform secondary authentication with the cloud server.

[0131] A working TCP establishing unit is configured to, if the secondary authentication is passed, bind a protocol type corresponding to the role type to complete establishment of a working TCP connection, the working TCP connection being used to transmit a control instruction issued by the cloud server.

[0132] In an embodiment, the system further comprises:

[0133] A third connection identifier generating unit is configured to, if the role type is a proxy connection, generate a third connection identifier by combining a second role number corresponding to the proxy connection, a physical MAC fingerprint of the edge gateway, and a current TCP connection sequence number of the edge gateway.

[0134] The proxy TCP three-way handshake unit is configured to initiate a TCP three-way handshake with a target address composed of an IP address and a port of a cloud server by using the edge gateway.

[0135] The proxy TCP identity authentication unit is configured to generate a third identity authentication request based on a username, a password and a local IP address of the edge gateway and the third connection identifier, and send the third identity authentication request to the cloud server if the TCP three-way handshake succeeds.

[0136] The proxy TCP secondary authentication unit is configured to perform secondary authentication with the cloud server if the third identity authentication request passes the verification.

[0137] The proxy TCP establishment unit is configured to bind a protocol type corresponding to a role type to complete establishment of a proxy TCP connection if the secondary authentication passes, the proxy TCP connection being configured to transmit an HTTP request issued by the cloud server and receive response data returned by a target web service.

[0138] The embodiment of the present application further provides a computer readable storage medium, and the computer readable storage medium stores a multi-TCP connection based stadium communication program, and the multi-TCP connection based stadium communication program is executed by a processor to realize steps of any one of the multi-TCP connection based stadium communication methods provided by the embodiment of the present application.

[0139] It should be understood that the sequence numbers of the steps in the above embodiment do not mean the execution sequence, and the execution sequence of each process should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiment of the present application.

[0140] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above functional units and modules is taken as an example, and in actual application, the above functions can be completed by different functional units and modules according to needs, that is, the internal structure of the above device is divided into different functional units or modules to complete all or part of the above described functions. Each functional unit and module in the embodiment can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit, and the integrated unit can be realized in the form of hardware or software. In addition, the specific names of each functional unit and module are only for easy distinction, and do not limit the protection scope of the present application. The specific working process of the units and modules in the above device can refer to the corresponding process in the foregoing method embodiment, and will not be repeated here.

[0141] In the above embodiments, the description of each embodiment is focused on, and the part not described in detail or recorded in a certain embodiment can be referred to the relevant description of other embodiments.

[0142] Those skilled in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. The skilled person can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0143] In the embodiments provided by the present application, it should be understood that the disclosed apparatus / terminal device and method can be implemented in other ways. For example, the above-described apparatus / terminal device embodiments are merely illustrative. For example, the division of the above modules or units is merely a logical function division. In actual implementation, another division manner can be used. For example, a plurality of units or components can be combined or integrated into another apparatus, or some features can be ignored or not executed.

[0144] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand; it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements, and the corresponding technical solutions, do not deviate from the spirit and scope of the embodiments of the present application, and should be included in the protection scope of the present application.

Claims

1. A method for stadium communication based on multiple TCP connections, characterized in that, The method comprises: A main TCP connection is established between the edge gateway and the cloud server; if the edge gateway receives a sub-connection creation instruction issued by the cloud server through the main TCP connection, a sub-TCP connection with the cloud server is established according to the sub-connection creation instruction; The edge gateway receives a control instruction issued by the cloud server through the sub-TCP connection, and transmits the control instruction to a target terminal hardware in the stadium; The edge gateway receives an HTTP request issued by the cloud server through the sub-TCP connection, and forwards the HTTP request to a target web service in a local area network where the edge gateway is located; The sub-connection creation instruction is parsed to obtain a role type of the sub-connection; If the role type is a working connection, a second connection identifier is composed of a role number corresponding to the working connection, a physical MAC fingerprint of the edge gateway, and a current TCP connection sequence number of the edge gateway; If the TCP three-way handshake is successful, a second identity authentication request is generated based on a username, a password and a local IP address of the edge gateway, and the second connection identifier, and is sent to the cloud server; If the second identity authentication request passes the verification, secondary authentication with the cloud server is performed; If the secondary authentication passes, a protocol type corresponding to the role type is bound to complete establishment of a working TCP connection, and the working TCP connection is used to transmit the control instruction issued by the cloud server; If the role type is a proxy connection, a third connection identifier is composed of a second role number corresponding to the proxy connection, the physical MAC fingerprint of the edge gateway, and the current TCP connection sequence number of the edge gateway; If the TCP three-way handshake is successful, a third identity authentication request is generated based on the username, the password and the local IP address of the edge gateway, and the third connection identifier, and is sent to the cloud server; If the third identity authentication request passes the verification, secondary authentication with the cloud server is performed; If the secondary authentication passes, a protocol type corresponding to the role type is bound to complete establishment of a proxy TCP connection, and the proxy TCP connection is used to transmit the HTTP request issued by the cloud server; The protocol type corresponding to the working connection comprises a Modbus protocol and a level signal protocol, the Modbus protocol is used for a light control module of the stadium, and the level signal protocol is used for a gate relay and a water control switch of the stadium. The main TCP connection is established between the edge gateway and the cloud server, comprising: The edge gateway obtains and parses preset connection data to obtain a username and a password of the edge gateway, an IP address and a port of the cloud server, and a first connection identifier, the first connection identifier comprising a preset role number, a physical MAC fingerprint of the edge gateway, and a connection sequence number; ​ ​ ​ ​ ​ 2. The multi-TCP connection based communication method for a stadium according to claim 1, wherein, ​ ​ initiating, by the edge gateway, a TCP three-way handshake to a target address composed of an IP address and a port of the cloud server; if the TCP three-way handshake is successful, generating a first identity authentication request based on a username, a password, and a local IP address of the edge gateway, and a first connection identifier, and sending the first identity authentication request to the cloud server; if the first identity authentication request passes the verification, performing secondary authentication with the cloud server; if the secondary authentication passes, completing establishment of the main TCP connection.

3. The multi-TCP connection based communication method for a stadium according to claim 2, wherein, the secondary authentication with the cloud server includes: receiving, by the edge gateway, an encrypted message generated by the cloud server, and decrypting the encrypted message to obtain an original data message; modifying, by the edge gateway, a preset field in the original data message, and encrypting the modified data to obtain a second encrypted message; sending, by the edge gateway, the second encrypted message to the cloud server.

4. The multi-TCP connection based communication method for a stadium according to claim 1, wherein, after the main TCP connection is established between the edge gateway and the cloud server, further including: starting a heartbeat mechanism to keep the main TCP connection alive.

5. The multi-TCP connection based communication method for a stadium according to claim 2, characterized by the physical MAC fingerprint is obtained by hashing a physical MAC address.

6. A multi-TCP connection based stadium communication system, characterized by including: a main TCP connection establishment module, configured to establish a main TCP connection between the edge gateway and the cloud server; a dynamic TCP connection establishment module, configured to, if the edge gateway receives a sub-connection creation instruction issued by the cloud server through the main TCP connection, establish a sub-TCP connection with the cloud server according to the sub-connection creation instruction; establishing the sub-TCP connection with the cloud server according to the sub-connection creation instruction includes: parsing the sub-connection creation instruction to obtain a role type of the sub-connection; if the role type is a working connection, composing a second connection identifier from a role number corresponding to the working connection, a physical MAC fingerprint of the edge gateway, and a current TCP connection sequence number of the edge gateway; initiating, by the edge gateway, a TCP three-way handshake to a target address composed of an IP address and a port of the cloud server; if the TCP three-way handshake is successful, generating a second identity authentication request based on a username, a password, and a local IP address of the edge gateway, and the second connection identifier, and sending the second identity authentication request to the cloud server; if the second identity authentication request passes the verification, performing secondary authentication with the cloud server; if the secondary authentication passes, binding a protocol type corresponding to the role type to complete establishment of a working TCP connection, the working TCP connection being used to transmit a control instruction issued by the cloud server; if the role type is a proxy connection, composing a third connection identifier from a second role number corresponding to the proxy connection, a physical MAC fingerprint of the edge gateway, and a current TCP connection sequence number of the edge gateway; initiating, by the edge gateway, a TCP three-way handshake to a target address composed of an IP address and a port of the cloud server; if the TCP three-way handshake is successful, generating a third identity authentication request based on a username, a password, and a local IP address of the edge gateway, and the third connection identifier, and sending the third identity authentication request to the cloud server; if the third identity authentication request passes the verification, performing secondary authentication with the cloud server; ​ If the secondary authentication passes, the protocol type corresponding to the role type is bound to complete the establishment of the proxy TCP connection for transmitting the HTTP request issued by the cloud server; The protocol type corresponding to the work connection includes a Modbus protocol and a level signal protocol, the Modbus protocol is used for a lamp control module of the stadium, and the level signal protocol is used for a gate relay and a water control switch of the stadium; The instruction transparent transmission module is configured to receive the control instruction issued by the cloud server through the sub-TCP connection by using the edge gateway, and transparently transmit the control instruction to a target terminal hardware in the stadium. The instruction forwarding module is configured to receive the HTTP request issued by the cloud server through the sub-TCP connection by using the edge gateway, and forward the HTTP request to a target web service in a local area network where the edge gateway is located.

7. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a multi-TCP connection based stadium communication program, and the multi-TCP connection based stadium communication program is executed by the processor to realize the steps of the multi-TCP connection based stadium communication method in any one of claims 1-5.

Citation Information

Patent Citations

  • Data transmission method, device and system

    CN110460641A

  • Agricultural image transmission system based on wireless communication and intelligent gateway

    CN214256471U