CN113612972B - Communication method and device of terminal monitoring equipment, electronic equipment and storage medium - Google Patents

Communication method and device of terminal monitoring equipment, electronic equipment and storage medium Download PDF

Info

Publication number
CN113612972B
CN113612972B CN202110909954.4A CN202110909954A CN113612972B CN 113612972 B CN113612972 B CN 113612972B CN 202110909954 A CN202110909954 A CN 202110909954A CN 113612972 B CN113612972 B CN 113612972B
Authority
CN
China
Prior art keywords
port
terminal
client
server
communication
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.)
Active
Application number
CN202110909954.4A
Other languages
Chinese (zh)
Other versions
CN113612972A (en
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.)
Shenzhen Ape Man Innovation Technology Co ltd
Original Assignee
Shenzhen Ape Man Innovation 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 Shenzhen Ape Man Innovation Technology Co ltd filed Critical Shenzhen Ape Man Innovation Technology Co ltd
Priority to CN202110909954.4A priority Critical patent/CN113612972B/en
Publication of CN113612972A publication Critical patent/CN113612972A/en
Application granted granted Critical
Publication of CN113612972B publication Critical patent/CN113612972B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/18Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0631Management of faults, events, alarms or notifications using root cause analysis; using analysis of correlation between notifications, alarms or events based on decision criteria, e.g. hierarchy, tree or time analysis
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Multimedia (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application relates to the field of equipment communication, and discloses a terminal monitoring equipment communication method, which comprises the following steps: receiving a data packet transmitted by a client, and analyzing the data packet to obtain a communication request; transmitting a communication request to a terminal monitoring device and receiving a terminal IP port returned by the terminal monitoring device, wherein the terminal IP port comprises a terminal local IP port and a terminal external network IP port; and acquiring a service end IP port of the service end, and transmitting the terminal local IP port, the terminal external network IP port and the service end IP port to the client so that the client can communicate with the monitoring equipment terminal by using the terminal local IP port, the terminal external network IP port and the service end IP port in a concurrent connection mode. In addition, the application also provides a communication device of the terminal monitoring equipment, the electronic equipment and a computer readable storage medium. The application can improve the communication efficiency of the terminal monitoring equipment.

Description

Communication method and device of terminal monitoring equipment, electronic equipment and storage medium
Technical Field
The present application relates to the field of device communication, and in particular, to a method and apparatus for terminal monitoring device communication, an electronic device, and a computer readable storage medium.
Background
Terminal monitoring devices, such as cameras, are usually disposed in convenient places where communication facilities and remote computers can be used for online work, and are used in the field of security monitoring, such as road monitoring, station monitoring, and daily life scene monitoring.
At present, the monitoring device is usually connected with the client in response to connection requests sent by app programs running on different clients, but when the client is connected with the monitoring device by analyzing identity address information replied by the monitoring device, if only one port of the monitoring device is connected with the monitoring device in error, the connection between the client and the terminal monitoring device is unsuccessful, so that the client is required to resend the connection requests, the fault tolerance rate is low when the client communicates with the terminal monitoring device, and the communication efficiency of the client and the terminal monitoring device is affected.
Disclosure of Invention
In order to solve the technical problems or at least partially solve the technical problems, the application provides a communication method, a device, an electronic device and a computer readable storage medium of a terminal monitoring device, which can improve the communication fault tolerance of a client and the terminal monitoring device so as to improve the communication efficiency of the client and the terminal monitoring device.
In a first aspect, the present application provides a communication method of a terminal monitoring device, including:
receiving a data packet transmitted by a client, and analyzing the data packet to obtain a communication request;
transmitting the communication request to a terminal monitoring device and receiving a terminal IP port returned by the terminal monitoring device, wherein the terminal IP port comprises a terminal local IP port and a terminal external network IP port;
and inquiring a service end IP port of the service end, and transmitting the terminal local IP port, the terminal external network IP port and the service end IP port to the client so that the client can communicate with the monitoring equipment terminal by using the terminal local IP port, the terminal external network IP port and the service end IP port in a concurrent connection mode.
It can be seen that, according to the embodiment of the application, the IP port and the communication object of the client can be identified by analyzing the communication request of the data packet transmitted by the client, so that a foundation is provided for guaranteeing the subsequent establishment of communication with the terminal monitoring equipment; secondly, according to the embodiment of the application, the communication request is transmitted to the terminal monitoring equipment, and the terminal local IP port and the terminal external network IP port returned after the terminal monitoring equipment analyzes the communication request are received, so that the monitoring equipment information communicated with the client can be identified, and the premise of the communication between the subsequent client and the terminal monitoring equipment is ensured; further, the application can determine server information of the client and the terminal monitoring device by inquiring the server IP port of the server, so as to realize connection of the client and the IP port of the terminal monitoring device, transmit the terminal local IP port, the terminal external network IP port and the server IP port to the client, receive the communication failure phenomenon of the client and the terminal monitoring device caused by the occurrence of a corresponding port connection error of the client and the terminal monitoring device, and further realize the successful connection of any one of the terminal local IP port, the terminal external network IP port and the server IP port by adopting a concurrent connection mode with the terminal monitoring device.
In a possible implementation manner of the first aspect, the parsing the data packet to obtain a communication request includes:
identifying the data type of each data in the data packet, and calculating the storage byte of each data in the data packet according to the data type;
identifying a character string of each data in the data packet according to the storage byte;
and inquiring a communication object and a client port in the data packet according to the character string, and generating a communication request of the data packet according to the communication object and the client port.
In a possible implementation manner of the first aspect, the transmitting the communication request to a terminal monitoring device includes:
constructing a transmission protocol with the terminal monitoring equipment according to the communication request;
identifying the transmission mode of the communication request and the terminal monitoring equipment according to the transmission protocol;
and transmitting the communication request to a terminal monitoring device by adopting a data transmission tool according to the transmission mode.
In a possible implementation manner of the first aspect, the querying a service IP port of the service includes:
identifying a server address of the server and querying a server port number of the server;
and generating a server IP port of the server according to the server address and the server port number.
In a possible implementation manner of the first aspect, before the receiving a data packet transmitted by a client, the method further includes:
when a data transmission request of the client is received, respectively creating sockets on the client and the server to obtain a client socket and a server socket;
and constructing a data transmission channel between the client and the server according to the client socket and the server socket, wherein the data transmission channel is used for transmitting the data packet transmitted by the client.
In one possible implementation manner of the first aspect, the constructing, according to the client socket and the service socket, a data transmission channel between the client and the service, for transmitting a data packet transmitted by the client, includes:
according to the client socket, a connection request is sent to the server, and the server is used for monitoring whether the connection request sent by the client contains the server socket or not;
if the server socket is not contained, returning a connection error prompt to the client;
and if the socket of the server is included, opening up a communication thread between the client and the server by using the server to obtain a data transmission channel between the client and the server.
In a possible implementation manner of the first aspect, before the transmitting the communication request to the terminal monitoring device, the method further includes: and monitoring the running state of the terminal monitoring equipment in real time by adopting a heartbeat mechanism, so that when the running state is in an abnormal running state, an early warning notification is sent to a user.
In a second aspect, the present application provides a terminal monitoring device communication apparatus, the apparatus comprising:
the data packet analysis module is used for receiving the data packet transmitted by the client and analyzing the data packet to obtain a communication request;
the terminal data acquisition module is used for transmitting the communication request to the terminal monitoring equipment and receiving a terminal IP port returned by the terminal monitoring equipment, wherein the terminal IP port comprises a terminal local IP port and a terminal external network IP port;
and the equipment communication module is used for inquiring the service end IP port of the service end and transmitting the terminal local IP port, the terminal external network IP port and the service end IP port to the client so that the client can communicate with the monitoring equipment terminal in a concurrent connection mode by utilizing the terminal local IP port, the terminal external network IP port and the service end IP port.
In a third aspect, the present application provides an electronic device comprising:
at least one processor; and a memory communicatively coupled to the at least one processor;
wherein the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the terminal monitoring device communication method as described in any one of the first aspects above.
In a fourth aspect, the present application provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the terminal monitoring device communication method according to any one of the first aspects above.
It will be appreciated that the advantages of the second to fourth aspects may be found in the relevant description of the first aspect and are not repeated here.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the application or the technical solutions of the prior art, the drawings which are used in the description of the embodiments or the prior art will be briefly described, and it will be obvious to a person skilled in the art that other drawings can be obtained from these drawings without inventive effort.
Fig. 1 is a flow chart of a communication method of a terminal monitoring device according to an embodiment of the present application;
fig. 2 is a flowchart illustrating one step of a communication method of the terminal monitoring device provided in fig. 1 according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating another step of a communication method of the terminal monitoring device shown in FIG. 1 according to an embodiment of the present application;
fig. 4 is a data interaction of a communication method of a terminal monitoring device according to an embodiment of the present application;
fig. 5 is a schematic block diagram of a communication device of a terminal monitoring apparatus according to an embodiment of the present application;
fig. 6 is a schematic diagram of an internal structure of an electronic device for implementing a communication method of a terminal monitoring device according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
Referring to fig. 1, a flow chart of a communication method of a terminal monitoring device according to an embodiment of the application is shown. The communication method of the terminal monitoring device described in fig. 1 is applied to a server, and includes:
s1, receiving a data packet transmitted by a client, and analyzing the data packet to obtain a communication request.
In the embodiment of the present application, the client refers to a program corresponding to a server, such as an APP program, for providing local services to a client, and the data packet refers to a program file that can be understood as being configured in the client, where the program file includes a port, a route, an IP, a service to be accessed, and the like.
The embodiment of the application further comprises, before the receiving the data packet transmitted by the client, the following steps: and constructing a data transmission channel between the client and the server for transmitting the data packet transmitted by the client so as to realize communication connection between the client and the server. In an optional embodiment, the constructing a data transmission channel between the client and the server for transmitting a data packet transmitted by the client includes: when a data transmission request of the client is received, respectively creating sockets on the client and the server to obtain a client socket and a server socket; and constructing a data transmission channel between the client and the server according to the client socket and the server socket, wherein the data transmission channel is used for transmitting the data packet transmitted by the client.
Where a socket refers to an endpoint that communicates bi-directionally (i.e., client-server) between application processes on different hosts in a network, it is generally understood that a socket is the end of a process communication on the network. Further, in another optional embodiment of the present application, the constructing a data transmission channel between the client and the server according to the client socket and the server socket includes: according to the client socket, a connection request is sent to the server, and the server is used for monitoring whether the connection request sent by the client contains the server socket or not; if the server socket is not contained, returning a connection error prompt to the client; and if the socket of the server is included, opening up a communication thread between the client and the server by using the server to obtain a data transmission channel between the client and the server.
Further, the application can receive the data packet transmitted by the client based on the constructed data transmission channel so as to realize the analysis of the communication request of the subsequent data packet and ensure the premise that the client communicates with the terminal monitoring equipment.
As an embodiment of the present application, referring to fig. 2, the parsing the data packet to obtain a communication request includes:
s301, identifying the data type of each data in the data packet, and calculating the storage byte of each data in the data packet according to the data type;
s302, identifying the character string of each data in the data packet according to the storage bytes;
s303, inquiring a communication object and a client port in the data packet according to the character string, and generating a communication request of the data packet according to the communication object and the client port.
Wherein the data type refers to a storage format of each data in an operating system when the data packet is packaged, such as int (integer type), char (character type), long (integer type) and the like, the storage byte refers to a space occupied by each data in the data packet in the operating system, which is calculated based on operating systems with different bits and different data types, for example, for a 32-bit system, the char type data occupies one storage byte, and the int type data occupies four storage bytes; the string may be understood as a storage form of each data in the data packet, for example, the data s= "abcdefghij", s [1] = "b", s [9] = "j". The communication object refers to an object that the client needs to communicate with, and the client port refers to the IP and the port number of the client.
It should be noted that, the client port is configured to characterize identity uniqueness of the client through a client ip+ port number (e.g. "192.166.1.1:55902"), and includes a client local IP port and a client external network IP port, where the client local IP port refers to port information for implementing client connection through a client local intranet, and the client external network IP port refers to port information for implementing client connection through a client routing external network.
In an alternative embodiment, the data type may be identified by querying each data format in the data packet, the character string may be identified by an ASCII code table, the communication object and the client port may be queried by a pre-compiled code program, and the code program may be compiled in Java language.
Based on the analysis of the communication request, the object and the port which need to be communicated by the client can be identified, so that a foundation is provided for guaranteeing the subsequent establishment of communication with the terminal monitoring equipment.
S2, transmitting the communication request to a terminal monitoring device, and receiving a terminal IP port returned by the terminal monitoring device, wherein the terminal IP port comprises a terminal local IP port and a terminal external network IP port.
In the embodiment of the present application, the terminal monitoring device is used for loading a terminal program, such as a monitoring terminal (camera end), of an object to be accessed by the client for communication.
It should be appreciated that, during the operation of the terminal monitoring device, heartbeat information needs to be sent to the server periodically to characterize the operation state of the terminal monitoring device, so that before the client port is transmitted to the terminal monitoring device of the communication object, the embodiment of the present application further includes: and monitoring the operation state of the terminal monitoring equipment in real time by adopting a heartbeat mechanism, so that when the operation state is in an abnormal operation state, an early warning notification is sent to a user, wherein the heartbeat packet can be the operation data of the terminal monitoring equipment.
Further, as an embodiment of the present application, referring to fig. 3, the transmitting the communication request to the terminal monitoring device includes:
s401, constructing a transmission protocol with the terminal monitoring equipment according to the communication request;
s402, identifying a transmission mode with the terminal monitoring equipment according to the transmission protocol;
s403, transmitting the communication request to a terminal monitoring device by adopting a data transmission tool according to the transmission mode.
The transmission protocol refers to a rule to be followed by the communication request to perform data interaction with the terminal monitoring device, and the rule is constructed based on different service scenarios, and includes: the transmission mode refers to a method for transmitting data to the terminal monitoring device by the communication request, and the method comprises get and post. The data transmission means may be a network headend, such as a TCP network headend.
Further, the embodiment of the application determines the connection information of the terminal monitoring equipment of the client by receiving the terminal IP port returned by the terminal monitoring equipment and receiving the terminal IP port returned after the communication analysis of the communication request by the terminal monitoring equipment. It should be noted that, the terminal monitoring device performs communication analysis on the communication request to identify a client port of the communication request in the terminal monitoring device, so as to ensure that a connection request sent by a subsequent client can be responded.
The terminal IP port is constructed through a terminal IP+ port number (such as '125.0.0.1:55901') and is used for representing identity uniqueness of terminal monitoring equipment, and the terminal IP port comprises a terminal local IP port and a terminal external network IP port, wherein the terminal local IP port is port information for realizing terminal connection through a terminal local internal network, and the terminal external network IP port is port information for realizing terminal connection through a terminal routing external network.
S3, inquiring a service end IP port of the service end, and transmitting the terminal local IP port, the terminal external network IP port and the service end IP port to the client so that the client can communicate with the monitoring equipment terminal in a concurrent connection mode by utilizing the terminal local IP port, the terminal external network IP port and the service end IP port.
The embodiment of the application determines the server information of the client and the terminal monitoring equipment by inquiring the service end IP port of the service end, and transmits the terminal local IP port, the terminal external network IP port and the service end IP port to the client so as to realize the connection of the client and the IP port of the terminal monitoring equipment.
As an embodiment of the present application, the obtaining a service IP port of the service includes: identifying a server address of the server, and querying a server port number of the server; and generating a server IP port of the server according to the server address and the server port number.
In an alternative embodiment, the server address may be identified by querying a URL of the server, and the server port number may be identified by querying an interface parameter of the server.
In an alternative embodiment, the transmission of the terminal local IP port, the terminal external network IP port, and the service IP port may be implemented through the created data transmission channels of the client and the service.
Further, in the embodiment of the present application, the terminal local IP port, the terminal external network IP port, and the service end IP port are transmitted to the client, so that the client uses the terminal local IP port, the terminal external network IP port, and the service end IP port to communicate with the monitoring device terminal in a concurrent connection manner, so that when any one of the terminal local IP port, the terminal external network IP port, and the service end IP port is successfully connected, communication between the client and the terminal monitoring device is established, efficient connection between the client and the terminal monitoring device is improved, and a phenomenon that communication between the client and the terminal monitoring device fails due to a connection error between the client and the terminal monitoring device occurs at a corresponding port is avoided, thereby improving a communication fault tolerance of the client and the terminal monitoring device.
The concurrent connection mode may be understood as parallel connection of the terminal local IP port, the terminal external network IP port, and the service end IP port, that is, the client sends a terminal local IP port, a terminal external network IP port connection request, and a connection request of the service end IP port to the service end at the same time, and it needs to be noted that any one of the terminal local IP port, the terminal external network IP port, and the service end IP port is successfully connected, which indicates that the communication connection between the client and the terminal monitoring device is successful.
It can be seen that, according to the embodiment of the application, the IP port and the communication object of the client can be identified by analyzing the communication request of the data packet transmitted by the client, so that a foundation is provided for guaranteeing the subsequent establishment of communication with the terminal monitoring equipment; secondly, according to the embodiment of the application, the communication request is transmitted to the terminal monitoring equipment, and the terminal local IP port and the terminal external network IP port returned after the terminal monitoring equipment analyzes the communication request are received, so that the monitoring equipment information communicated with the client can be identified, and the premise of the communication between the subsequent client and the terminal monitoring equipment is ensured; further, the application can determine server information of the client and the terminal monitoring device by inquiring the server IP port of the server, so as to realize connection of the client and the IP port of the terminal monitoring device, transmit the terminal local IP port, the terminal external network IP port and the server IP port to the client, receive the communication failure phenomenon of the client and the terminal monitoring device caused by the occurrence of a corresponding port connection error of the client and the terminal monitoring device, and further realize the successful connection of any one of the terminal local IP port, the terminal external network IP port and the server IP port by adopting a concurrent connection mode with the terminal monitoring device.
Referring to fig. 4, a data interaction diagram of a client, a server, and a terminal monitoring device in a communication method of a terminal monitoring device according to an embodiment of the present application is shown, and in detail, fig. 4 includes: APP (client), P2P server (server) and Device (terminal monitoring Device), comprising the following steps:
step I: the client sends a data packet requested by the connection equipment to the server;
step II: the server side analyzes the communication request of the data packet and then sends the data packet to the terminal monitoring equipment;
step III: after analyzing the client port of the communication request, the terminal monitoring equipment sends a terminal IP port to the server;
step IV: the server sends the IP port of the server and the IP port of the terminal to the client;
step V: and the client sends a communication connection request of the terminal monitoring equipment to the server according to the server IP port and the terminal IP port, and sends a communication connection result to the server.
The client is a program corresponding to a server, such as a camera access APP program, for providing local service for a client, where the server is a service program for providing resources for the client, and storing client data, and in this embodiment of the present application, the server may be understood as a service program for connecting a terminal monitoring device to the client, where the terminal monitoring device is a terminal program for providing communication connection to the client, such as a terminal monitoring device (camera end). Further, the communication request includes connection information of the APP end, which includes a local IP port and an external network IP port of the APP end, and the terminal IP port refers to connection information of the terminal monitoring device, including a local IP port and an external network IP port of the terminal monitoring device.
In the process of data communication between the server and the terminal monitoring equipment, the terminal monitoring equipment sends a heartbeat packet to the server so as to represent that the terminal monitoring equipment is in a normal running state.
Fig. 5 is a schematic block diagram of a communication device of a terminal monitoring apparatus according to an embodiment of the present application.
The terminal monitoring device communication apparatus 500 of the present application may be installed in an electronic device. The terminal monitoring device communication means may include a data packet parsing module 501, a terminal data acquisition module 502, and a device communication module 503 according to the implemented functions. The module of the present application may also be referred to as a unit, meaning a series of computer program segments capable of being executed by the processor of the electronic device and of performing fixed functions, stored in the memory of the electronic device.
In the present embodiment, the functions concerning the respective modules/units are as follows:
the data packet parsing module 501 is configured to receive a data packet transmitted by a client, and parse the data packet to obtain a communication request;
the terminal data obtaining module 502 is configured to transmit the communication request to a terminal monitoring device, and receive a terminal IP port returned by the terminal monitoring device, where the terminal IP port includes a terminal local IP port and a terminal external network IP port;
the device communication module 503 is configured to query a service end IP port of the service end, and transmit the terminal local IP port, the terminal external network IP port, and the service end IP port to the client, so that the client uses the terminal local IP port, the terminal external network IP port, and the service end IP port to communicate with the monitoring device terminal in a concurrent connection manner.
In detail, the modules in the terminal monitoring device communication apparatus 500 in the embodiment of the present application use the same technical means as the terminal monitoring device communication method described in fig. 1 to 3, and can produce the same technical effects, which are not described herein.
Fig. 6 is a schematic diagram of an internal structure of an electronic device for implementing a communication method of a terminal monitoring device according to an embodiment of the present application.
The electronic device may include a processor 60, a memory 61, a communication bus 62 and a communication interface 63, and may also include a computer program, such as a terminal monitoring device communication program, stored in the memory 61 and executable on the processor 60.
The processor 60 may be formed by an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be formed by a plurality of integrated circuits packaged with the same function or different functions, including one or more central processing units (Central Processing unit, CPU), a microprocessor, a digital processing chip, a graphics processor, a combination of various control chips, and the like. The processor 60 is a Control Unit (Control Unit) of the electronic device, connects various components of the entire electronic device using various interfaces and lines, and executes various functions of the electronic device and processes data by running or executing programs or modules stored in the memory 61 (for example, executing a terminal monitoring device communication program, etc.), and calling data stored in the memory 61.
The memory 61 includes at least one type of readable storage media including flash memory, a removable hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. The memory 61 may in some embodiments be an internal storage unit of the electronic device, such as a mobile hard disk of the electronic device. The memory 61 may also be an external storage device of the electronic device in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like. Further, the memory 61 may also include both an internal storage unit and an external storage device of the electronic device. The memory 61 may be used not only for storing application software installed in the electronic device and various types of data, such as codes of communication programs of the terminal monitoring device, etc., but also for temporarily storing data that has been output or is to be output.
The communication bus 62 may be a peripheral component interconnect standard (peripheral component interconnect, PCI) bus, or an extended industry standard architecture (extended industry standard architecture, EISA) bus, among others. The bus may be classified as an address bus, a data bus, a control bus, etc. The bus is arranged to enable a connection communication between the memory 61 and at least one processor 60 etc.
The communication interface 63 is used for communication between the electronic device and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and/or a wireless interface (e.g., WI-FI interface, bluetooth interface, etc.), typically used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a Display (Display), an input unit such as a Keyboard (Keyboard), or alternatively a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch, or the like. The display may also be referred to as a display screen or display unit, as appropriate, for displaying information processed in the electronic device and for displaying a visual user interface.
Fig. 6 shows only an electronic device with components, and it will be understood by those skilled in the art that the structure shown in fig. 6 is not limiting of the electronic device and may include fewer or more components than shown, or may combine certain components, or a different arrangement of components.
For example, although not shown, the electronic device may further include a power source (such as a battery) for supplying power to the respective components, and the power source may be logically connected to the at least one processor 60 through a power management device, so that functions of charge management, discharge management, and power consumption management are implemented through the power management device. The power supply may also include one or more of any of a direct current or alternating current power supply, recharging device, power failure detection circuit, power converter or inverter, power status indicator, etc. The electronic device may further include various sensors, bluetooth modules, wi-Fi modules, etc., which are not described herein.
It should be understood that the embodiments described are for illustrative purposes only and are not limited to this configuration in the scope of the patent application.
The terminal monitoring device communication program stored in the memory 61 of the electronic device 6 is a combination of a plurality of computer programs, which when run in the processor 60, can realize:
receiving a data packet transmitted by a client, and analyzing the data packet to obtain a communication request;
transmitting the communication request to a terminal monitoring device and receiving a terminal IP port returned by the terminal monitoring device, wherein the terminal IP port comprises a terminal local IP port and a terminal external network IP port;
and inquiring a service end IP port of the service end, and transmitting the terminal local IP port, the terminal external network IP port and the service end IP port to the client so that the client can communicate with the monitoring equipment terminal by using the terminal local IP port, the terminal external network IP port and the service end IP port in a concurrent connection mode.
In particular, the specific implementation method of the processor 60 on the computer program may refer to the description of the relevant steps in the corresponding embodiment of fig. 1, which is not repeated herein.
Further, the integrated modules/units of the electronic device 6 may be stored in a non-volatile computer readable storage medium if implemented in the form of software functional units and sold or used as a stand alone product. The computer readable storage medium may be volatile or nonvolatile. For example, the computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM).
The present application also provides a computer readable storage medium storing a computer program which, when executed by a processor of an electronic device, can implement:
receiving a data packet transmitted by a client, and analyzing the data packet to obtain a communication request;
transmitting the communication request to a terminal monitoring device and receiving a terminal IP port returned by the terminal monitoring device, wherein the terminal IP port comprises a terminal local IP port and a terminal external network IP port;
and inquiring a service end IP port of the service end, and transmitting the terminal local IP port, the terminal external network IP port and the service end IP port to the client so that the client can communicate with the monitoring equipment terminal by using the terminal local IP port, the terminal external network IP port and the service end IP port in a concurrent connection mode.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus, device and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be other manners of division when actually implemented.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units can be realized in a form of hardware or a form of hardware and a form of software functional modules.
It will be evident to those skilled in the art that the application is not limited to the details of the foregoing illustrative embodiments, and that the present application may be embodied in other specific forms without departing from the spirit or essential characteristics thereof.
The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the application being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
It should be noted that in this document, relational terms such as "first" and "second" and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing is only a specific embodiment of the application to enable those skilled in the art to understand or practice the application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (8)

1. The communication method of the terminal monitoring equipment is characterized by being applied to a server and comprising the following steps:
receiving a data packet transmitted by a client, identifying the data type of each data in the data packet, and calculating the storage byte of each data in the data packet according to the data type;
identifying a character string of each data in the data packet according to the storage byte;
inquiring a communication object and a client port in the data packet according to the character string, and generating a communication request of the data packet according to the communication object and the client port;
constructing a transmission protocol with the terminal monitoring equipment according to the communication request, wherein the transmission protocol comprises any one of a TCP protocol, a UDP protocol and an HTTP protocol;
identifying a transmission mode with the terminal monitoring equipment according to the transmission protocol;
according to the transmission mode, a data transmission tool is adopted to transmit the communication request to a terminal monitoring device and receive a terminal IP port returned by the terminal monitoring device, wherein the terminal IP port comprises a terminal local IP port and a terminal external network IP port;
inquiring a service end IP port of the service end, transmitting the terminal local IP port, the terminal external network IP port and the service end IP port to the client so that the client can communicate with the monitoring equipment terminal by using the terminal local IP port, the terminal external network IP port and the service end IP port in a concurrent connection mode;
the concurrent connection mode is parallel connection of the terminal local IP port, the terminal external network IP port and the server IP port, namely, the client side simultaneously sends the terminal local IP port, the terminal external network IP port connection request and the server side connection request to the terminal monitoring equipment, and when any one of the terminal local IP port, the terminal external network IP port and the server side IP port is successfully connected, the client side and the terminal monitoring equipment are successfully connected in a communication mode.
2. The method for communication between terminal monitoring devices according to claim 1, wherein said querying a service IP port of said service comprises:
identifying a server address of a server, and inquiring a server port number of the server;
and generating a server IP port of the server according to the server address and the server port number.
3. The method for communication between terminal monitoring devices according to claim 1, wherein before said receiving the data packet transmitted by the client, the method further comprises:
when a data transmission request of the client is received, respectively creating sockets on the client and the server to obtain a client socket and a server socket;
and constructing a data transmission channel between the client and the server according to the client socket and the server socket, wherein the data transmission channel is used for transmitting the data packet transmitted by the client.
4. The communication method of the terminal monitoring device according to claim 3, wherein the constructing a data transmission channel between the client and the server according to the client socket and the server socket for transmitting the data packet transmitted by the client includes:
according to the client socket, a connection request is sent to the server, and the server is used for monitoring whether the connection request sent by the client contains the server socket or not;
if the server socket is not contained, returning a connection error prompt to the client;
and if the socket of the server is included, opening up a communication thread between the client and the server by using the server to obtain a data transmission channel between the client and the server.
5. The terminal monitoring device communication method according to any one of claims 1 to 4, characterized by further comprising, before transmitting the communication request to the terminal monitoring device:
and monitoring the running state of the terminal monitoring equipment in real time by adopting a heartbeat mechanism, so that when the running state is in an abnormal running state, an early warning notification is sent to a user.
6. A terminal monitoring device communication apparatus, wherein the apparatus is applied to a server, and comprises:
the data packet analysis module is used for receiving a data packet transmitted by a client, identifying the data type of each data in the data packet, and calculating the storage byte of each data in the data packet according to the data type;
identifying a character string of each data in the data packet according to the storage byte;
inquiring a communication object and a client port in the data packet according to the character string, and generating a communication request of the data packet according to the communication object and the client port;
the terminal data acquisition module is used for constructing a transmission protocol with the terminal monitoring equipment according to the communication request, wherein the transmission protocol comprises any one of a TCP protocol, a UDP protocol and an HTTP protocol; identifying a transmission mode with the terminal monitoring equipment according to the transmission protocol; according to the transmission mode, a data transmission tool is adopted to transmit the communication request to a terminal monitoring device and receive a terminal IP port returned by the terminal monitoring device, wherein the terminal IP port comprises a terminal local IP port and a terminal external network IP port;
the device communication module is used for inquiring a service end IP port of the service end, transmitting the terminal local IP port, the terminal external network IP port and the service end IP port to the client so that the client can communicate with the monitoring device terminal in a concurrent connection mode by utilizing the terminal local IP port, the terminal external network IP port and the service end IP port;
the concurrent connection mode is parallel connection of the terminal local IP port, the terminal external network IP port and the server IP port, namely, the client side simultaneously sends the terminal local IP port, the terminal external network IP port connection request and the server side connection request to the terminal monitoring equipment, and when any one of the terminal local IP port, the terminal external network IP port and the server side IP port is successfully connected, the client side and the terminal monitoring equipment are successfully connected in a communication mode.
7. An electronic device, the electronic device comprising:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the terminal monitoring device communication method according to any one of claims 1 to 5.
8. A computer readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the terminal monitoring device communication method according to any one of claims 1 to 5.
CN202110909954.4A 2021-08-09 2021-08-09 Communication method and device of terminal monitoring equipment, electronic equipment and storage medium Active CN113612972B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110909954.4A CN113612972B (en) 2021-08-09 2021-08-09 Communication method and device of terminal monitoring equipment, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110909954.4A CN113612972B (en) 2021-08-09 2021-08-09 Communication method and device of terminal monitoring equipment, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113612972A CN113612972A (en) 2021-11-05
CN113612972B true CN113612972B (en) 2023-12-05

Family

ID=78307732

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110909954.4A Active CN113612972B (en) 2021-08-09 2021-08-09 Communication method and device of terminal monitoring equipment, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113612972B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20070013487A (en) * 2005-07-26 2007-01-31 주식회사 일레자인 Gateway apparatus for forming of comunication channel between telecomunication terminals
CN101262487A (en) * 2008-04-25 2008-09-10 北京中企开源信息技术有限公司 Data transmission processing method and device for point-to-point client
CN101699801A (en) * 2009-10-30 2010-04-28 孙喜明 Data transmission method and virtual peer-to-peer network for data transmission
CN102224714A (en) * 2008-11-20 2011-10-19 日本电气株式会社 Client - server communications in mobile radio communications device
CN102984696A (en) * 2012-12-04 2013-03-20 中国联合网络通信集团有限公司 IP communication method, equipment and system based on mobile terminals
CN105871863A (en) * 2016-04-18 2016-08-17 袁斌 Method for terminal interaction based on network security and relevant device thereof
CN106656622A (en) * 2016-12-29 2017-05-10 深圳Tcl新技术有限公司 Method and device for configuring interface call tasks
CN108845869A (en) * 2018-05-31 2018-11-20 中国平安人寿保险股份有限公司 Concurrent request control method, device, computer equipment and storage medium
CN109088799A (en) * 2018-09-28 2018-12-25 腾讯科技(深圳)有限公司 A kind of user end inserting method, device, terminal and storage medium
CN109343497A (en) * 2018-11-21 2019-02-15 杭州佳鹏电脑科技股份有限公司 Data monitoring method and production management system
CN112492004A (en) * 2020-11-17 2021-03-12 深圳市晨北科技有限公司 Method, device, system and storage medium for establishing local communication link

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101353933B1 (en) * 2007-07-04 2014-01-22 삼성전자주식회사 Image forming device having multi-port, host device for providing communication port and methods thereof
US10721310B2 (en) * 2016-07-27 2020-07-21 Amzetta Technologies, Llc Device redirection support at thin client

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20070013487A (en) * 2005-07-26 2007-01-31 주식회사 일레자인 Gateway apparatus for forming of comunication channel between telecomunication terminals
CN101262487A (en) * 2008-04-25 2008-09-10 北京中企开源信息技术有限公司 Data transmission processing method and device for point-to-point client
CN102224714A (en) * 2008-11-20 2011-10-19 日本电气株式会社 Client - server communications in mobile radio communications device
CN101699801A (en) * 2009-10-30 2010-04-28 孙喜明 Data transmission method and virtual peer-to-peer network for data transmission
CN102984696A (en) * 2012-12-04 2013-03-20 中国联合网络通信集团有限公司 IP communication method, equipment and system based on mobile terminals
CN105871863A (en) * 2016-04-18 2016-08-17 袁斌 Method for terminal interaction based on network security and relevant device thereof
CN106656622A (en) * 2016-12-29 2017-05-10 深圳Tcl新技术有限公司 Method and device for configuring interface call tasks
CN108845869A (en) * 2018-05-31 2018-11-20 中国平安人寿保险股份有限公司 Concurrent request control method, device, computer equipment and storage medium
CN109088799A (en) * 2018-09-28 2018-12-25 腾讯科技(深圳)有限公司 A kind of user end inserting method, device, terminal and storage medium
CN109343497A (en) * 2018-11-21 2019-02-15 杭州佳鹏电脑科技股份有限公司 Data monitoring method and production management system
CN112492004A (en) * 2020-11-17 2021-03-12 深圳市晨北科技有限公司 Method, device, system and storage medium for establishing local communication link

Also Published As

Publication number Publication date
CN113612972A (en) 2021-11-05

Similar Documents

Publication Publication Date Title
CN111796858B (en) Method, system and related equipment for detecting access of application programs in Kubernetes cluster
CN110446273B (en) Networking method and device based on electronic price tags
CN106330483B (en) Information acquisition method, client device and server device
CN110109766B (en) Data interaction method and device based on cross-department and cross-platform data sharing exchange
WO2014183444A1 (en) Method, terminal, server, and system for data processing
CN114827161B (en) Service call request sending method and device, electronic equipment and readable storage medium
CN103581040A (en) Server distributing device and server distributing method
CN108965403B (en) Operation and maintenance monitoring connection establishing method and terminal equipment
CN110851334A (en) Flow statistical method, electronic device, system and medium
CN117176802B (en) Full-link monitoring method and device for service request, electronic equipment and medium
CN113965904A (en) Device registration method, device and storage medium
CN113612972B (en) Communication method and device of terminal monitoring equipment, electronic equipment and storage medium
CN115022397B (en) Interface parameter simplifying method and device, electronic equipment and storage medium
CN114125024B (en) Audio transmission method, electronic device and readable storage medium
CN114513792B (en) Remote network control method and device based on eSIM card
US20140344476A1 (en) Method, terminal, server, and system for data processing
CN111970358B (en) Decentralized cloud computing platform, service deployment method and service access method and service deployment and service access assembly
CN111371601A (en) Server configuration method, device, equipment and computer readable storage medium
CN108769293B (en) IP address resolution method and related device
CN110324426A (en) A kind of data capture method, device and system
CN112162868B (en) Data communication method, device and storage medium applied to cluster processing
CN110086893A (en) Domain name analytic method, device and computer readable storage medium
CN108737196B (en) Method for managing PON equipment
CN107391342B (en) Database all-in-one machine and monitoring method thereof
US11606274B1 (en) Method for operations of virtual machines in monitoring cloud activities, system, and device applying the method

Legal Events

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