CN117938932A - Communication connection method and system for central control equipment - Google Patents

Communication connection method and system for central control equipment Download PDF

Info

Publication number
CN117938932A
CN117938932A CN202311831608.4A CN202311831608A CN117938932A CN 117938932 A CN117938932 A CN 117938932A CN 202311831608 A CN202311831608 A CN 202311831608A CN 117938932 A CN117938932 A CN 117938932A
Authority
CN
China
Prior art keywords
central control
target
information
communication protocol
protocol format
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311831608.4A
Other languages
Chinese (zh)
Inventor
郭超军
钱建安
江涛
张瑛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Xiaoan Technology Co ltd
Original Assignee
Wuhan Xiaoan Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Xiaoan Technology Co ltd filed Critical Wuhan Xiaoan Technology Co ltd
Priority to CN202311831608.4A priority Critical patent/CN117938932A/en
Publication of CN117938932A publication Critical patent/CN117938932A/en
Pending legal-status Critical Current

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention provides a communication connection method and a communication connection system for central control equipment, wherein the method comprises the following steps: acquiring a login message to be analyzed; judging whether the login message to be analyzed is a message sent by the first target central control equipment or not based on a preset communication protocol format, and if not, determining a target communication protocol format according to the login message to be analyzed; based on the mapping relation between the communication protocol format and the equipment gateway information, acquiring the communication connection information of the target equipment gateway corresponding to the login message to be analyzed according to the target communication protocol format; and sending the communication connection information to the second target central control equipment according to the long connection object information corresponding to the second target central control equipment so that the second target central control equipment can establish communication connection with the target equipment gateway according to the communication connection information. The invention improves the communication efficiency between the central control equipment and the equipment gateway.

Description

Communication connection method and system for central control equipment
Technical Field
The present invention relates to the field of network communications technologies, and in particular, to a method and a system for communication connection between central control devices.
Background
In the field of sharing electric bicycles, a platform end supports access of central control equipment produced by different suppliers, because communication protocol formats used by the central control equipment produced by different suppliers are different, the platform end needs to develop different equipment gateways for different communication protocol formats to communicate with the central control equipment, and in the communication process, the central control equipment (hereinafter referred to as central control A) produced by the supplier A is inevitably connected to the equipment gateway B, or the central control equipment B (hereinafter referred to as central control B) is connected to the equipment gateway A.
Fig. 1 is a communication schematic diagram of a central control device and a device gateway in the prior art, and can be referred to as fig. 1, wherein a solid line indicates a normal communication process of the central control device in an uplink and a downlink of a cloud platform through the device gateway; the broken line indicates that the central control a is connected to the device gateway B (or the central control B is connected to the device gateway a), at this time, the device gateway B parses the login message sent by the central control a according to the communication protocol format provided by the provider B, which will cause a parsing failure, if the central control a cannot receive the login response message of the corresponding device gateway (i.e. the device gateway a) in a short time (generally 5 seconds), actively disconnects, resends the login message after one minute, retries three times of still fails, and the central control device starts a self-protection mechanism and restarts every 20 minutes.
Because the device gateway can not analyze the unique identifier IMEI (International Mobile Equipment Identity) of the central control device from the login message, the cloud platform end can not issue a connection address instruction for resetting the central control device according to the IMEI, so that the cloud platform end is correctly connected to the device gateway A, and finally the central control A is not available. Therefore, there is a need for a method and a system for communication connection between central control devices to solve the above problems.
Disclosure of Invention
Aiming at the problems existing in the prior art, the invention provides a communication connection method and a communication connection system for central control equipment.
The invention provides a communication connection method of central control equipment, which comprises the following steps:
acquiring a login message to be analyzed;
Judging whether the login message to be analyzed is a message sent by first target central control equipment or not based on a preset communication protocol format, if not, determining a target communication protocol format according to the login message to be analyzed, wherein the first target central control equipment is central control equipment for generating the login message with the preset communication protocol format;
based on the mapping relation between the communication protocol format and the equipment gateway information, acquiring the communication connection information of the target equipment gateway corresponding to the login message to be analyzed according to the target communication protocol format;
and sending the communication connection information to the second target central control equipment according to the long connection object information corresponding to the second target central control equipment, so that the second target central control equipment can establish communication connection with the target equipment gateway according to the communication connection information, wherein the second target central control equipment is central control equipment for sending the login message to be analyzed.
According to the communication connection method of the central control device provided by the invention, before the login message to be analyzed is obtained, the method further comprises the following steps:
Establishing TCP long connection with the second target central control equipment according to the TCP long connection request sent by the second target central control equipment;
The obtaining the login message to be analyzed includes:
And acquiring the login message to be analyzed, which is sent by the second target central control equipment, based on the TCP long connection.
According to the communication connection method of the central control device provided by the invention, after the establishment of the TCP long connection with the second target central control device, the method further comprises the following steps:
Constructing an ID number corresponding to the TCP long connection;
generating corresponding long connection object information based on the socket information of the TCP long connection;
taking the ID number as a key, taking the long connection object information as a value, and constructing a corresponding hash table;
the sending the communication connection information to the second target central control device according to the long connection object information corresponding to the second target central control device includes:
acquiring the long connection object information corresponding to the second target central control equipment from the hash table according to the ID number corresponding to the TCP long connection;
and sending the communication connection information to the second target central control equipment according to the address information of the second target central control equipment in the long connection object information.
According to the communication connection method of the central control device provided by the invention, the method for determining the target communication protocol format according to the login message to be analyzed comprises the following steps:
Converting the login message to be analyzed into a target hexadecimal character;
Based on the corresponding relation between the preset built communication protocol format identification information and the communication protocol format, the communication protocol format identification information in the target hexadecimal character is identified, and the target communication protocol format corresponding to the login message to be analyzed is determined according to the identification result.
According to the communication connection method of the central control equipment, provided by the invention, the mapping relation between the communication protocol format and the equipment gateway information is constructed by the following steps:
acquiring equipment gateway information according to IP address information and port information of the equipment gateway;
Establishing a mapping relation between communication protocol formats adopted by central control equipment of different hardware types and the equipment gateway information;
The obtaining, based on the mapping relationship between the communication protocol format and the device gateway information, the communication connection information of the target device gateway corresponding to the login message to be parsed according to the target communication protocol format includes:
Acquiring target IP address information and target port information of the target equipment gateway according to a mapping relation between a communication protocol format and equipment gateway information;
And generating the communication connection information according to the target IP address information and the target port information based on the target communication protocol format.
According to the method for communication connection of central control equipment provided by the invention, after judging whether the login message to be analyzed is the message sent by the first target central control equipment based on the preset communication protocol format, the method further comprises:
If the login message to be analyzed is the message sent by the first target central control equipment, analyzing the login message to be analyzed to obtain corresponding structured data;
And sending the structured data to a cloud platform system to establish connection between the cloud platform system and the second target central control device.
The invention also provides a communication connection system of the central control equipment, which comprises:
the message receiving module is used for acquiring a login message to be analyzed;
The first processing module is used for judging whether the login message to be analyzed is a message sent by first target central control equipment or not based on a preset communication protocol format, and if not, determining a target communication protocol format according to the login message to be analyzed, wherein the first target central control equipment is central control equipment for generating the login message with the preset communication protocol format;
the second processing module is used for acquiring the communication connection information of the target equipment gateway corresponding to the login message to be analyzed according to the target communication protocol format based on the mapping relation between the communication protocol format and the equipment gateway information;
The message sending module is configured to send the communication connection information to a second target central control device according to long connection object information corresponding to the second target central control device, so that the second target central control device establishes communication connection with the target device gateway according to the communication connection information, where the second target central control device is a central control device that sends the login message to be resolved.
The invention also provides an electronic device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor realizes the communication connection method of the central control device when executing the program.
The present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method of communication connection of a central control device as described in any of the above.
The invention also provides a computer program product comprising a computer program which when executed by a processor implements a method of communication connection of a central control device as described in any of the above.
According to the communication connection method and system for the central control equipment, when the acquired login message to be analyzed is not the message sent by the first target central control equipment, the communication connection information of the target equipment gateway corresponding to the login message to be analyzed is acquired according to the target communication protocol format based on the mapping relation between the communication protocol format and the equipment gateway information, and then the communication connection information is sent to the second target central control equipment according to the long connection object information of the central control equipment corresponding to the login message to be analyzed, so that the communication connection between the second target central control equipment and the target equipment gateway is established, and the communication efficiency between the central control equipment and the equipment gateway is improved.
Drawings
In order to more clearly illustrate the invention or the technical solutions of the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described, and it is obvious that the drawings in the description below are some embodiments of the invention, and other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a prior art communication between a central control device and a device gateway;
fig. 2 is a schematic flow chart of a communication connection method of a central control device provided by the invention;
FIG. 3 is a schematic overall flow chart of a communication connection method of a central control device provided by the invention;
fig. 4 is a schematic structural diagram of a communication connection system of a central control device provided by the invention;
fig. 5 is a schematic structural diagram of an electronic device provided by the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Fig. 2 is a schematic flow chart of a communication connection method of a central control device provided by the present invention, and as shown in fig. 2, the present invention provides a communication connection method of a central control device, including:
Step 201, obtaining a login message to be parsed.
In the invention, the central control equipment of the shared electric bicycle generally interacts with the mobile equipment of the user so as to realize the operations of logging in, unlocking, ending use and the like of the user. In this process, the central control device will send some login messages to be parsed to verify the user's identity and authorize it to use the shared electric bicycle. These login messages to be parsed typically contain the user's mobile phone number or other identity identifier, information about the central equipment provider of the shared electric bicycle, other authentication information, and the like.
The communication protocol formats used by the central control devices produced by different suppliers are different, so that a plurality of device gateways developed in different communication protocol formats exist at a platform end.
Step 202, based on a preset communication protocol format, judging whether the login message to be analyzed is a message sent by a first target central control device, if not, determining a target communication protocol format according to the login message to be analyzed, wherein the first target central control device is a central control device for generating the login message of the preset communication protocol format.
In the invention, a preset communication protocol format is a communication protocol format which can be analyzed by a device gateway (namely, a device gateway A) which currently receives a login message to be analyzed, wherein the login message in the preset communication protocol format is generated by first target central control equipment (marked as central control A), namely, the device gateway A can directly analyze the login message when determining that the login message is sent by the central control A; for the login message sent by the non-central control A, at this time, the device gateway A judges that the login message cannot be resolved, that is, the login message to be resolved does not conform to the communication protocol format preset in the device gateway A, and the target communication protocol format needs to be further determined according to the content of the login message. In the present invention, the communication protocol format used by the central control device corresponding to the message, i.e. the target communication protocol format, can be deduced according to the information contained in the message, such as the device ID, the vendor information, the IP address, the MAC address, etc.
Step 203, based on the mapping relationship between the communication protocol format and the device gateway information, obtaining the communication connection information of the target device gateway corresponding to the login message to be resolved according to the target communication protocol format.
In the invention, the mapping relation between the communication protocol format and the equipment gateway information is established in the early stage. For each communication protocol format, there is corresponding device gateway information, including the IP address and port number of the device gateway, and so on. Further, after the target communication protocol format is determined, the communication connection information of the target device gateway corresponding to the login message can be obtained according to the mapping relation, where the communication connection information includes an IP address and a port number of the target device gateway, and the like, and the communication connection information can be used for establishing a subsequent communication connection between the second target central control device and the target device gateway.
Step 204, according to the long connection object information corresponding to the second target central control device, the communication connection information is sent to the second target central control device, so that the second target central control device establishes communication connection with the target device gateway according to the communication connection information, wherein the second target central control device is the central control device which sends the login message to be resolved.
In the invention, the login message to be analyzed can be analyzed and judged through a pre-constructed script (such as lua script), so that the communication connection information of the target equipment gateway corresponding to the login message can be obtained. Then, the communication connection information needs to be sent to the second target central control device, after the second target central control device receives the information, communication connection can be established with the target device gateway according to the communication connection information, so that the second target central control device can establish a long connection session with the target device gateway according to the information and is used for receiving and sending data in real time, at the moment, the second target central control device sends the login message to be analyzed to the target device gateway again, so that the login message to be analyzed can be analyzed by the target device gateway, and the analysis result is pushed to the cloud platform.
According to the communication connection method of the central control equipment, when the acquired login message to be analyzed is not the message sent by the first target central control equipment, the communication connection information of the target equipment gateway corresponding to the login message to be analyzed is acquired according to the target communication protocol format based on the mapping relation between the communication protocol format and the equipment gateway information, and further the communication connection information is sent to the second target central control equipment according to the long connection object information of the central control equipment corresponding to the login message to be analyzed, so that the communication connection between the second target central control equipment and the target equipment gateway is established, and the communication efficiency between the central control equipment and the equipment gateway is improved.
On the basis of the foregoing embodiment, before the obtaining the login packet to be parsed, the method further includes:
Establishing TCP long connection with the second target central control equipment according to the TCP long connection request sent by the second target central control equipment;
The obtaining the login message to be analyzed includes:
And acquiring the login message to be analyzed, which is sent by the second target central control equipment, based on the TCP long connection.
In the invention, the central control B sends a TCP long connection request to the equipment gateway based on the IP address information and the port information exposed by the equipment gateway. If the TCP long connection request is not received by the device gateway B corresponding to the central control B, but is received by the device gateway A, at the moment, the TCP long connection between the second target central control device and the device gateway A is established. After the TCP long connection is established, the device gateway a can receive the message from the second target central control device, including the login message to be resolved, and further analyze the login message to be resolved through a subsequent step, so as to obtain the relevant information of the device gateway that can resolve the login message to be resolved.
On the basis of the above embodiment, after the setting up of the TCP long connection with the second target central control apparatus, the method further includes:
Constructing an ID number corresponding to the TCP long connection;
generating corresponding long connection object information based on the socket information of the TCP long connection;
taking the ID number as a key, taking the long connection object information as a value, and constructing a corresponding hash table;
the sending the communication connection information to the second target central control device according to the long connection object information corresponding to the second target central control device includes:
acquiring the long connection object information corresponding to the second target central control equipment from the hash table according to the ID number corresponding to the TCP long connection;
and sending the communication connection information to the second target central control equipment according to the address information of the second target central control equipment in the long connection object information.
In the present invention, for each TCP long connection established by the device gateway, a unique ID number needs to be built for the TCP long connection to identify the connection. Next, it is necessary to generate corresponding long connection object information including state and attribute information related to the TCP long connection, such as connection state and address information of the central control device, based on Socket information of the TCP long connection. And finally, taking the ID number as a key, taking the long connection object information as a value, and constructing a corresponding hash table, wherein the state and attribute information of the TCP long connection can be quickly searched and managed through the hash table, so that the subsequent data transmission and management can be realized.
Further, after the communication connection information of the second target central control device is determined, long connection object information corresponding to the second target central control device needs to be obtained from the hash table according to the ID number corresponding to the TCP long connection. This procedure can obtain corresponding long connection object information by looking up an item whose key value is an ID number in the hash table. If the lookup fails, it indicates that the connection is not present or has failed, requiring corresponding processing.
Next, it is necessary to acquire address information of the second target central control device, including an IP address, a port number, and the like, from the long connection object information, the address information being used to transmit communication connection information of the target device gateway to the second target central control device.
And finally, sending a message with a specific format to the second target central control equipment through the TCP long connection, so as to send the communication connection information of the target equipment gateway to the second target central control equipment. After receiving the message, the second target central control equipment can establish communication connection with the target equipment gateway according to the information in the message.
On the basis of the above embodiment, the determining a target communication protocol format according to the login packet to be parsed includes:
Converting the login message to be analyzed into a target hexadecimal character;
Based on the corresponding relation between the preset built communication protocol format identification information and the communication protocol format, the communication protocol format identification information in the target hexadecimal character is identified, and the target communication protocol format corresponding to the login message to be analyzed is determined according to the identification result.
In the invention, the login message to be analyzed can be converted into the target hexadecimal character representation form through a pre-constructed lua script. Next, the communication protocol format identification information in the target hexadecimal character needs to be identified based on the corresponding relation between the preset constructed communication protocol format identification information and the communication protocol format, and the communication protocol format identification information is a part of the communication protocol format adopted by the message and is usually contained in a specific position or prefix of the message. By identifying this information, the target communication protocol format corresponding to the login message to be parsed can be determined.
In the invention, the specific method for identifying the communication protocol format identification information can be matched and compared according to the preset corresponding relation, for example, a mapping table or a configuration file can be defined, and the communication protocol format identification information is associated with the corresponding communication protocol format. And extracting the communication protocol format identification information from the target hexadecimal characters by traversing, and comparing the communication protocol format identification information with a preset mapping table to find out the corresponding communication protocol format.
And finally, determining a target communication protocol format corresponding to the login message to be analyzed according to the identification result, and further assembling the IP (or domain name) and the port of the corresponding equipment gateway according to the protocol format thereof so as to ensure that subsequent analysis and processing can be sent to the correct equipment gateway through the central control equipment and analysis is carried out according to the correct communication protocol format.
On the basis of the above embodiment, the mapping relationship between the communication protocol format and the device gateway information is constructed by the following steps:
acquiring equipment gateway information according to IP address information and port information of the equipment gateway;
Establishing a mapping relation between communication protocol formats adopted by central control equipment of different hardware types and the equipment gateway information;
The obtaining, based on the mapping relationship between the communication protocol format and the device gateway information, the communication connection information of the target device gateway corresponding to the login message to be parsed according to the target communication protocol format includes:
Acquiring target IP address information and target port information of the target equipment gateway according to a mapping relation between a communication protocol format and equipment gateway information;
And generating the communication connection information according to the target IP address information and the target port information based on the target communication protocol format.
In the invention, corresponding equipment gateway information is acquired through the IP address information and the port information of the equipment gateway, wherein the equipment gateway information possibly comprises the type of a provider, the supported communication protocol and the like.
Further, a mapping relationship between the communication protocol format adopted by the central control device of different hardware types (such as vendor types) and the device gateway information needs to be established. The process may be managed by a configuration file, a database or other storage mechanism, in which the hardware type of the central control device may be associated with a corresponding communication protocol format, for example, for a specific hardware type a of the central control device (the vendor type is vendor a), it may be determined that the communication protocol format adopted by the central control device is X, and it needs to be parsed by the device gateway a, so that a mapping relationship is established between the communication protocol format and the device gateway a and stored, so that the corresponding communication protocol format is searched for according to the hardware type of the central control device, and accurate device gateway information and communication protocol format are obtained.
On the basis of the foregoing embodiment, after determining, based on the preset communication protocol format, whether the login packet to be parsed is a packet sent by the first target central control device, the method further includes:
If the login message to be analyzed is the message sent by the first target central control equipment, analyzing the login message to be analyzed to obtain corresponding structured data;
And sending the structured data to a cloud platform system to establish connection between the cloud platform system and the second target central control device.
In the invention, aiming at the login message to be analyzed, the login message is required to be analyzed according to a preset communication protocol format, including extracting each field and data from the message, and decoding and analyzing according to the format specified by the communication protocol. The meaning and the value of each part in the message can be obtained through analysis processing.
Further, the structural data obtained through analysis is sent to a cloud platform system, and in the sending process, the address and port information of the cloud platform system of the target need to be specified. After receiving the structured data, the cloud platform system may perform corresponding processing according to the content thereof, for example, establish a connection with the second target central control device.
And finally, carrying out the steps of handshake, identity verification and the like according to the requirements of the cloud platform system and a communication protocol between the cloud platform system and the second target central control equipment, and establishing connection between the cloud platform system and the second target central control equipment.
In the invention, for a login message to be analyzed from a first target central control device, namely, a communication protocol format of the login message received by a device gateway can be analyzed, firstly, the device gateway analyzes the login message to obtain structured data; then the structured data is sent to a cloud platform system; and finally, the cloud platform system sends the response login message to the central control equipment through the equipment gateway.
Fig. 3 is an overall flow chart of the communication connection method of the central control device provided by the invention, which can refer to fig. 3, and specific steps are as follows:
Step S1, a central control A and a central control B1 initiate a TCP long connection request to a device gateway A according to an IP (or domain name) and a port exposed by the device gateway A;
Step S2, after receiving TCP long connection requests sent by two central control devices, the device gateway A takes the ID of the TCP long connection as a key and takes the object of the TCP long connection as a value, and the objects are respectively stored in a hash table;
Step S3, the central control A and the central control B report a login message to the equipment gateway A through a TCP long connection;
step S4, the equipment gateway A judges whether the login message is reported by the corresponding central control equipment according to the communication protocol format provided by the central control provider A;
Step S5.1, if the login message is reported by the central control A, analyzing the login message according to a communication protocol format provided by the central control provider A to obtain structured data and pushing the structured data to the cloud platform;
s5.2, obtaining a response login message of the cloud platform and sending the response login message to the central control A;
S6, if the login message is reported by the central control B, downloading the lua script from a OSS (Object Storage Service) server;
And S7, after the device gateway A acquires the lua script, converting the login message into hexadecimal characters, and then executing the lua script as a parameter to obtain a message for setting the central control connection address, thereby obtaining the communication connection information. In this embodiment, by executing the lua script, the login message reported by the central control is converted into hexadecimal characters as a function of the parameter transmitted into the lua script, and the lua function judges which provider's communication protocol format the login message conforms to according to the hexadecimal characters, and further assembles the IP (or domain name) and the port of the corresponding device gateway according to the protocol format obtained by judgment, so as to obtain the message for setting the central control connection address.
Step S8, the device gateway A acquires the TCP long connection object from the hash table according to the ID number of the TCP long connection, and then sends the message for setting the central control connection address to the central control device (central control B) according to the related information in the TCP long connection object, so that the central control device is automatically connected to the designated device gateway.
The invention utilizes the characteristics of lua script language (light weight, high efficiency, expandability and no need of compiling), develops the equipment gateway aiming at the communication protocol format provided by the central control provider, adds the judgment of the communication protocol format of the provider by using the lua function, generates the message for setting the central control connection address, and uploads the message to the OSS server, so that the existing equipment gateway can execute the latest lua script without restarting.
The following describes the communication connection system of the central control device provided by the invention, and the communication connection system of the central control device and the communication connection method of the central control device described below can be referred to correspondingly.
Fig. 4 is a schematic structural diagram of a communication connection system of a central control device provided by the present invention, and as shown in fig. 4, the present invention provides a communication connection system of a central control device, including a message receiving module 401, a first processing module 402, a second processing module 403, and a message sending module 404, where the message receiving module 401 is configured to obtain a login message to be parsed; the first processing module 402 is configured to determine, based on a preset communication protocol format, whether the login packet to be parsed is a packet sent by a first target central control device, and if not, determine a target communication protocol format according to the login packet to be parsed, where the first target central control device is a central control device that generates the login packet in the preset communication protocol format; the second processing module 403 is configured to obtain, according to the target communication protocol format, communication connection information of a target device gateway corresponding to the login message to be parsed based on a mapping relationship between the communication protocol format and the device gateway information; the message sending module 404 is configured to send the communication connection information to a second target central control device according to long connection object information corresponding to the second target central control device, so that the second target central control device establishes communication connection with the target device gateway according to the communication connection information, where the second target central control device is a central control device that sends the login message to be resolved.
According to the communication connection system of the central control equipment, when the acquired login message to be analyzed is not the message sent by the first target central control equipment, the communication connection information of the target equipment gateway corresponding to the login message to be analyzed is acquired according to the target communication protocol format based on the mapping relation between the communication protocol format and the equipment gateway information, and further the communication connection information is sent to the second target central control equipment according to the long connection object information of the central control equipment corresponding to the login message to be analyzed, so that the communication connection between the second target central control equipment and the target equipment gateway is established, and the communication efficiency between the central control equipment and the equipment gateway is improved.
The system provided by the invention is used for executing the method embodiments, and specific flow and details refer to the embodiments and are not repeated herein.
Fig. 5 is a schematic structural diagram of an electronic device according to the present invention, as shown in fig. 5, the electronic device may include: processor (Processor) 501, communication interface (Communications Interface) 502, memory (Memory) 503, and communication bus 504, wherein Processor 501, communication interface 502, memory 503 complete communication with each other through communication bus 504. The processor 501 may invoke logic instructions in the memory 503 to perform a method of communication connection of a central control device, the method comprising: acquiring a login message to be analyzed; judging whether the login message to be analyzed is a message sent by first target central control equipment or not based on a preset communication protocol format, if not, determining a target communication protocol format according to the login message to be analyzed, wherein the first target central control equipment is central control equipment for generating the login message with the preset communication protocol format; based on the mapping relation between the communication protocol format and the equipment gateway information, acquiring the communication connection information of the target equipment gateway corresponding to the login message to be analyzed according to the target communication protocol format; and sending the communication connection information to the second target central control equipment according to the long connection object information corresponding to the second target central control equipment, so that the second target central control equipment can establish communication connection with the target equipment gateway according to the communication connection information, wherein the second target central control equipment is central control equipment for sending the login message to be analyzed.
Further, the logic instructions in the memory 503 described above may be implemented in the form of software functional units and may be stored in a computer readable storage medium when sold or used as a stand alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform a method of communication connection of a central control device provided by the above methods, the method comprising: acquiring a login message to be analyzed; judging whether the login message to be analyzed is a message sent by first target central control equipment or not based on a preset communication protocol format, if not, determining a target communication protocol format according to the login message to be analyzed, wherein the first target central control equipment is central control equipment for generating the login message with the preset communication protocol format; based on the mapping relation between the communication protocol format and the equipment gateway information, acquiring the communication connection information of the target equipment gateway corresponding to the login message to be analyzed according to the target communication protocol format; and sending the communication connection information to the second target central control equipment according to the long connection object information corresponding to the second target central control equipment, so that the second target central control equipment can establish communication connection with the target equipment gateway according to the communication connection information, wherein the second target central control equipment is central control equipment for sending the login message to be analyzed.
In still another aspect, the present invention further provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, is implemented to perform the method for communication connection of a central control device provided in the above embodiments, the method including: acquiring a login message to be analyzed; judging whether the login message to be analyzed is a message sent by first target central control equipment or not based on a preset communication protocol format, if not, determining a target communication protocol format according to the login message to be analyzed, wherein the first target central control equipment is central control equipment for generating the login message with the preset communication protocol format; based on the mapping relation between the communication protocol format and the equipment gateway information, acquiring the communication connection information of the target equipment gateway corresponding to the login message to be analyzed according to the target communication protocol format; and sending the communication connection information to the second target central control equipment according to the long connection object information corresponding to the second target central control equipment, so that the second target central control equipment can establish communication connection with the target equipment gateway according to the communication connection information, wherein the second target central control equipment is central control equipment for sending the login message to be analyzed.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. A method for communication connection of a central control device, comprising:
acquiring a login message to be analyzed;
Judging whether the login message to be analyzed is a message sent by first target central control equipment or not based on a preset communication protocol format, if not, determining a target communication protocol format according to the login message to be analyzed, wherein the first target central control equipment is central control equipment for generating the login message with the preset communication protocol format;
based on the mapping relation between the communication protocol format and the equipment gateway information, acquiring the communication connection information of the target equipment gateway corresponding to the login message to be analyzed according to the target communication protocol format;
and sending the communication connection information to the second target central control equipment according to the long connection object information corresponding to the second target central control equipment, so that the second target central control equipment can establish communication connection with the target equipment gateway according to the communication connection information, wherein the second target central control equipment is central control equipment for sending the login message to be analyzed.
2. The method for communication connection between central control devices according to claim 1, wherein before the obtaining the login message to be parsed, the method further comprises:
Establishing TCP long connection with the second target central control equipment according to the TCP long connection request sent by the second target central control equipment;
The obtaining the login message to be analyzed includes:
And acquiring the login message to be analyzed, which is sent by the second target central control equipment, based on the TCP long connection.
3. The method of communication connection of a central control device according to claim 2, wherein after said establishing a TCP long connection with said second target central control device, the method further comprises:
Constructing an ID number corresponding to the TCP long connection;
generating corresponding long connection object information based on the socket information of the TCP long connection;
taking the ID number as a key, taking the long connection object information as a value, and constructing a corresponding hash table;
the sending the communication connection information to the second target central control device according to the long connection object information corresponding to the second target central control device includes:
acquiring the long connection object information corresponding to the second target central control equipment from the hash table according to the ID number corresponding to the TCP long connection;
and sending the communication connection information to the second target central control equipment according to the address information of the second target central control equipment in the long connection object information.
4. The method for communication connection between central control devices according to claim 2, wherein determining a target communication protocol format according to the login message to be parsed includes:
Converting the login message to be analyzed into a target hexadecimal character;
Based on the corresponding relation between the preset built communication protocol format identification information and the communication protocol format, the communication protocol format identification information in the target hexadecimal character is identified, and the target communication protocol format corresponding to the login message to be analyzed is determined according to the identification result.
5. The communication connection method of the central control device according to claim 4, wherein the mapping relationship between the communication protocol format and the device gateway information is constructed by:
acquiring equipment gateway information according to IP address information and port information of the equipment gateway;
Establishing a mapping relation between communication protocol formats adopted by central control equipment of different hardware types and the equipment gateway information;
The obtaining, based on the mapping relationship between the communication protocol format and the device gateway information, the communication connection information of the target device gateway corresponding to the login message to be parsed according to the target communication protocol format includes:
Acquiring target IP address information and target port information of the target equipment gateway according to a mapping relation between a communication protocol format and equipment gateway information;
And generating the communication connection information according to the target IP address information and the target port information based on the target communication protocol format.
6. The method for communication connection between central control devices according to claim 1, wherein after the determining, based on a preset communication protocol format, whether the login message to be parsed is a message sent by the first target central control device, the method further comprises:
If the login message to be analyzed is the message sent by the first target central control equipment, analyzing the login message to be analyzed to obtain corresponding structured data;
And sending the structured data to a cloud platform system to establish connection between the cloud platform system and the second target central control device.
7. A center control device communication connection system, comprising:
the message receiving module is used for acquiring a login message to be analyzed;
The first processing module is used for judging whether the login message to be analyzed is a message sent by first target central control equipment or not based on a preset communication protocol format, and if not, determining a target communication protocol format according to the login message to be analyzed, wherein the first target central control equipment is central control equipment for generating the login message with the preset communication protocol format;
the second processing module is used for acquiring the communication connection information of the target equipment gateway corresponding to the login message to be analyzed according to the target communication protocol format based on the mapping relation between the communication protocol format and the equipment gateway information;
The message sending module is configured to send the communication connection information to a second target central control device according to long connection object information corresponding to the second target central control device, so that the second target central control device establishes communication connection with the target device gateway according to the communication connection information, where the second target central control device is a central control device that sends the login message to be resolved.
8. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method for communication connection of a central control device according to any one of claims 1 to 6 when executing the computer program.
9. A non-transitory computer readable storage medium having stored thereon a computer program, wherein the computer program when executed by a processor implements the method of communication connection of a central control device according to any of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that the computer program, when executed by a processor, implements the method of communication connection of a central control device according to any one of claims 1 to 6.
CN202311831608.4A 2023-12-28 2023-12-28 Communication connection method and system for central control equipment Pending CN117938932A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311831608.4A CN117938932A (en) 2023-12-28 2023-12-28 Communication connection method and system for central control equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311831608.4A CN117938932A (en) 2023-12-28 2023-12-28 Communication connection method and system for central control equipment

Publications (1)

Publication Number Publication Date
CN117938932A true CN117938932A (en) 2024-04-26

Family

ID=90756629

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311831608.4A Pending CN117938932A (en) 2023-12-28 2023-12-28 Communication connection method and system for central control equipment

Country Status (1)

Country Link
CN (1) CN117938932A (en)

Similar Documents

Publication Publication Date Title
CN108306877B (en) NODE JS-based user identity information verification method and device and storage medium
EP2725873A1 (en) Information sending method and gateway
JP2018536935A (en) Access request conversion method and apparatus
EP3907973A1 (en) Method for establishing communication connection and proxy server
CN108809890B (en) Vulnerability detection method, test server and client
US20130268632A1 (en) Server assisted authenticated device
CN110365741B (en) Connection establishing method and transfer server
CN112221121A (en) Application software networking acceleration method and device and storage medium
CN110061993B (en) Log generation method and device containing public network exit address and access equipment
CN113015165A (en) Internet of things platform device access method, device and system
TW201706901A (en) Authentication method, apparatus, and system
CN110505188B (en) Terminal authentication method, related equipment and authentication system
EP3119055A1 (en) Generic bootstrapping architecture protocol
CN111565181A (en) Single equipment login method, server and client
CN112087412A (en) Service access processing method and device based on unique token
CN107517248B (en) Network connection method and device based on SDK
CN111147285B (en) Cloud security product unified management method
CN112436950A (en) Method for discovering equipment in local area network based on UDP broadcast
CN117938932A (en) Communication connection method and system for central control equipment
CN109286665B (en) Real-time mobile game long link processing method and device
CN111240904A (en) Database backup method and device, electronic equipment and storage medium
CN112870692B (en) Game acceleration method, acceleration system, acceleration device and storage medium
CN108737350B (en) Information processing method and client
CN114244648A (en) Method, device, equipment and medium for actively registering Internet of things platform by equipment
CN115086276A (en) Address management method, device, equipment and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination