CN111343218A - Data sending and receiving method based on heartbeat message, storage medium and processor - Google Patents

Data sending and receiving method based on heartbeat message, storage medium and processor Download PDF

Info

Publication number
CN111343218A
CN111343218A CN201811551376.6A CN201811551376A CN111343218A CN 111343218 A CN111343218 A CN 111343218A CN 201811551376 A CN201811551376 A CN 201811551376A CN 111343218 A CN111343218 A CN 111343218A
Authority
CN
China
Prior art keywords
terminal
message
heartbeat
server
configuration
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
CN201811551376.6A
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.)
Kuang Chi Institute of Advanced Technology
Original Assignee
Hangzhou Guangqi Artificial Intelligence Research Institute
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 Hangzhou Guangqi Artificial Intelligence Research Institute filed Critical Hangzhou Guangqi Artificial Intelligence Research Institute
Priority to CN201811551376.6A priority Critical patent/CN111343218A/en
Priority to PCT/CN2019/111046 priority patent/WO2020125168A1/en
Publication of CN111343218A publication Critical patent/CN111343218A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/40Support for services or applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/143Termination or inactivation of sessions, e.g. event-controlled end of session
    • H04L67/145Termination or inactivation of sessions, e.g. event-controlled end of session avoiding end of session, e.g. keep-alive, heartbeats, resumption message or wake-up for inactive or interrupted session
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • H04L69/162Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Multimedia (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention provides a heartbeat-based message data sending and receiving method, a storage medium and a processor. The sending method comprises the following steps: the terminal sends a joining request message carrying basic information of the terminal to the server; the terminal receives a join request response message from the server and establishes connection with the server; the terminal sends a first heartbeat message carrying a terminal configuration identifier to the server; the terminal receives a heartbeat response message from the server; the terminal sends a configuration state message to the server; the terminal sends a heartbeat message carrying terminal information to the server side. The terminal effective data is packaged in the heartbeat message and sent to the server, so that the quality of the data message is greatly optimized, the number of effective data message interactions is reduced, unnecessary data interaction and processing are reduced, the CPU performance, the memory occupancy rate, the network resource bandwidth occupation and the like of the equipment are optimized, and the service life of the equipment is prolonged.

Description

Data sending and receiving method based on heartbeat message, storage medium and processor
[ technical field ] A method for producing a semiconductor device
The invention relates to the technical field of data transmission, in particular to a heartbeat-based message data sending and receiving method, a storage medium and a processor.
[ background of the invention ]
CAPWAP-Control And Provisioning of Wireless Access Points protocol specification. It consists of two parts: CAPWAP protocol and wireless bonding protocol.
The former is a general tunnel protocol, which completes the basic protocol functions of AP discovery AC and the like, and is irrelevant to the specific wireless access technology. The latter is to provide configuration management functions specifically related to a certain radio access technology. The CAPWAP protocol is published in RFC5415[1] of 3 months in 2009, the wireless BINGDING protocol only releases RFC with access of 802.11 in 2009, and also releases RFC with number of 5416 in 3 months in 2009.
At present, a wireless management protocol mainly uses a CAPWAP protocol, and for the existing diversified equipment, the protocol flow is too complex, the interaction mode is relatively redundant, and the interaction between a heartbeat packet and a data message is too frequent, so that the simple management of common equipment is inconvenient, and the universality is not realized.
The wireless technology is developed to present, besides traditional coverage equipment, many wireless related products are derived, such as wireless positioning, wireless probes, wireless monitoring, wireless security and the like, and once the products are implemented, the number of the products is huge, if a single product is adopted for deployment, manpower is wasted, and the operation cost is increased for later maintenance. Such management generally complies with the CAPWAP protocol, or a custom proprietary protocol. Both the phenomenon of coexistence of heartbeat messages and data interaction messages exists in the CAPWAP protocol or the private protocol, so that the interaction quantity of the data messages is greatly increased, the effectiveness of the messages is reduced, and the overhead of processing the data messages by a server is increased. The more frequent the real-time data interacts with the server, the less the heartbeat message will be.
[ summary of the invention ]
The technical problem to be solved by the invention is to provide a heartbeat message data transmitting and receiving method, a storage medium and a processor, wherein effective data of a terminal is packaged in heartbeat messages and transmitted to a server side, so that the quality of the data messages is greatly optimized for frequent data interaction occasions of the terminal and the server, and the number of effective data message interactions is reduced, thereby reducing unnecessary data interaction and processing, playing an optimized role in the CPU performance, memory occupancy rate, network resource bandwidth occupation and the like of equipment, and prolonging the service life of the equipment.
In order to solve the above technical problem, in one aspect, the present invention provides a heartbeat-based message data transmission method, including:
s11, the terminal sends an adding request message carrying the basic information of the terminal to the server;
s12, the terminal receives the join request response message from the server and establishes connection with the server;
s13, the terminal sends a first heartbeat message carrying the terminal configuration identifier to the server;
s14, the terminal receives the heartbeat response message from the server;
s15, the terminal sends a configuration state message to the server;
s16, the terminal sends the heartbeat message carrying the terminal information to the server side.
Preferably, the terminal basic information includes a terminal model, an equipment serial number, a software version number, a hardware version number, and vendor information.
Preferably, the join request message includes a total message length, a sub-message type, a sub-message length, and a sub-message content.
Preferably, the heartbeat response message includes: and encapsulating the terminal configuration data message matched with the terminal configuration identifier.
Preferably, the join request response message includes a join successful status value or a join failed error code.
Preferably, the sending, by the terminal, the configuration status message to the server includes: and after the terminal analyzes the heartbeat response message, the terminal is configured according to the heartbeat response message, and a configuration result is sent to the server.
Preferably, the terminal configuration identifier includes: the message number is configured.
Preferably, the heartbeat message carrying the terminal information carries terminal data encapsulation.
Preferably, in step S12, the terminal receives the join request response packet from the server, after establishing connection with the server, starts a timer of the heartbeat packet, and if the timer of the heartbeat packet expires, executes step S13, in which the terminal sends the first heartbeat packet carrying the terminal configuration identifier to the server.
In another aspect, the present invention provides a storage medium, where the storage medium includes a stored program, where the program executes the above heartbeat-based message data transmission method when running.
In another aspect, the present invention provides a processor, where the processor is configured to execute a program, where the program executes the heartbeat-based message data transmission method when running.
On the other hand, the invention provides a heartbeat-based message data receiving method, which comprises the following steps:
s21, the server receives the join request message carrying the basic information of the terminal from the terminal;
s22, the server sends a join request response message to the terminal, and establishes connection with the terminal;
s23, the server receives the first heartbeat message from the terminal carrying the terminal configuration identification;
s24, the server sends heartbeat response message to the terminal;
s25, the server receives the configuration state message from the terminal;
and S26, the server receives the heartbeat message carrying the terminal information from the terminal.
Preferably, the terminal basic information includes a terminal model, an equipment serial number, a software version number, a hardware version number, and vendor information.
Preferably, the join request message includes a total message length, a sub-message type, a sub-message length, and a sub-message content.
Preferably, the heartbeat response message includes: and encapsulating the terminal configuration data message matched with the terminal configuration identifier.
Preferably, the join request response message includes a join successful status value or a join failed error code.
Preferably, after receiving the first heartbeat message from the terminal carrying the terminal configuration identifier, the server side selects the configuration data matched with the terminal configuration identifier to perform encapsulation according to the terminal configuration identifier, so as to form a heartbeat response message.
Preferably, the configuration data includes a wireless parameter configuration, a function configuration, and a heartbeat cycle configuration.
Preferably, the terminal configuration identifier includes: the message number is configured.
In another aspect, the present invention provides a storage medium, where the storage medium includes a stored program, and the program executes the above method for receiving heartbeat-based message data when running.
In another aspect, the present invention provides a processor, where the processor is configured to execute a program, where the program executes the above heartbeat-based message data receiving method when running.
In another aspect, the present invention provides a method for sending and receiving data based on heartbeat messages, including:
s31, the terminal sends an adding request message carrying the basic information of the terminal to the server;
s32, the server sends a join request response message to the terminal, and establishes connection with the terminal;
s33, the terminal sends a first heartbeat message carrying the terminal configuration identifier to the server;
s34, the server sends heartbeat response message to the terminal;
s35, the server receives the configuration state message from the terminal;
s36, the terminal sends the heartbeat message carrying the terminal information to the server side.
Compared with the prior art, the technical scheme has the following advantages: the method is improved after heartbeat packets do not have significance when the terminal and the server frequently interact data, greatly optimizes the number of data messages, reduces unnecessary data interaction and processing, and plays an optimization role in the CPU performance, the memory occupancy rate and the occupation of network resource bandwidth of the terminal.
[ description of the drawings ]
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive labor.
Fig. 1 is a flow chart of a heartbeat-based message data transmission method according to the present invention.
Fig. 2 is a format diagram of a terminal join request message.
Fig. 3 is a flow chart of heartbeat timer transmission.
Fig. 4 is a flow chart of processing for creating and sending heartbeat messages by a terminal.
Fig. 5 shows a process flow for receiving heartbeat messages by a terminal.
Fig. 6 is a flow chart of a heartbeat-based message data receiving method of the present invention.
FIG. 7 is a diagram of a standard capwap control header format.
Fig. 8 is a diagram of a terminal hash table on a server.
Fig. 9 is a flowchart of server processing configuration heartbeat messages.
Fig. 10 is a flow chart of server processing data heartbeat messages.
Fig. 11 is a schematic structural diagram of a terminal and server system based on heartbeat message data transmission and reception.
[ detailed description ] embodiments
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The heartbeat messages are used to monitor the operating state of the machine network memory. The heartbeat message once sends character string information to indicate the running state of the network memory, and the character string information is sent in a UDP broadcast or unicast mode. The sending mode and sending interval of the heartbeat message can be set by a user on a control interface of the network memory.
The heartbeat messages are used to monitor the operating state of the machine network memory. The heartbeat message once sends character string information to indicate the running state of the network memory, and the character string information is sent in a UDP broadcast or unicast mode. The sending mode and sending interval of the heartbeat message can be set by a user on a control interface of the network memory.
Example one
Fig. 1 is a flow chart of a heartbeat-based message data transmission method according to the present invention. As shown in fig. 1, a heartbeat-based message data transmission method includes:
s11, the terminal sends an adding request message carrying the basic information of the terminal to the server;
s12, the terminal receives the join request response message from the server and establishes connection with the server;
s13, the terminal sends a first heartbeat message carrying the terminal configuration identifier to the server;
s14, the terminal receives the heartbeat response message from the server;
s15, the terminal sends a configuration state message to the server;
s16, the terminal sends the heartbeat message carrying the terminal information to the server side.
Through steps S11 to S12, the terminal establishes a connection with the server. The terminal just starts to go online with zero configuration. After the connection is established, the terminal takes the basic configuration from the server, the terminal configures the terminal after the terminal normally takes the configuration, then the terminal starts to report various data of the terminal, such as statistical data or alarm data, and the effective data are packaged in the heartbeat message and sent to the server together with the heartbeat message.
In specific implementation, the basic information of the terminal includes a terminal model, an equipment serial number, a software version number, a hardware version number, and manufacturer information. The join request message includes, but is not limited to, besides the basic terminal information: total message length, sub-message type, sub-message length, sub-message content.
Fig. 2 is a format diagram of a terminal join request message. As shown in fig. 2: the ID is 38, which indicates that the terminal model in the basic information of the terminal is carried; len represents the total length of the message, and the vendor Identifier represents vendor information; sub type indicates a sub message type, sub len indicates a sub message length, and value indicates a sub message content.
In specific implementation, the heartbeat response message includes: and encapsulating the terminal configuration data message matched with the terminal configuration identifier. The terminal configuration identifier comprises: the message number is configured. The terminal sends a terminal configuration identifier with a configuration message number to the server, and the server encapsulates the function configuration data by searching the function configuration data matched with the terminal configuration message number to form a heartbeat response message.
In specific implementation, the join request response message includes a join successful status value or a join failed error code.
In specific implementation, the sending, by the terminal, the configuration state message to the server includes: and after the terminal analyzes the heartbeat response message, the terminal is configured according to the heartbeat response message, and a configuration result is sent to the server.
And carrying terminal data package by the heartbeat message carrying terminal information.
In step S12, the terminal receives the join request response packet from the server, establishes a connection with the server, starts a timer of the heartbeat packet, and if the timer of the heartbeat packet expires, executes step S13, in which the terminal sends the first heartbeat packet carrying the terminal configuration identifier to the server.
In order to make the objects, technical solutions and advantages of the present embodiments more apparent, the steps related to the present invention are further described in detail below with reference to the accompanying drawings.
The method comprises the following steps: the terminal initializes, creates socket communication socket and binds communication port. And using a UDP protocol to carry basic information of the terminal, wherein the basic information comprises information such as a product model, a hardware model, a terminal serial number, a software version number, a hardware version number, an MAC address and the like, packaging the basic information into a join request message, and sending the join request message to the server. Message field definition referring to fig. 7, fig. 7 is a diagram of a standard capwap control message header format.
Step two: the method comprises the steps that a terminal monitors a communication port socket, whether a join response message is received or not is judged, if the join response message is not received and is not received after the join response message is continuously received and exceeds 3 times, the terminal or the network is restarted, after the join response message is received, the message content is judged, whether a server allows the terminal to be accessed or not is judged, if the process is not allowed to be exited, an eloop timer is started, an eloop _ register _ sock is registered, a register timeout mechanism eloop _ register _ timeout is sent, and a first heartbeat message is sent to the server, wherein the heartbeat message comprises a message number message id and can carry a plurality of message id messages. Referring to fig. 4, fig. 4 is a flowchart of processing for creating and sending heartbeat messages by a terminal.
Step three: the terminal receives a response echo response message of the server, judges whether the message is a data heartbeat message or not according to the content length of the message, if the content length is less than 4 bytes, the message is a heartbeat response message, the terminal does not perform any processing, if the content length is more than 4 bytes, the heartbeat response message is represented to carry a data field, the data content is analyzed, configuration updating is performed according to corresponding data, and configuration updating success is returned. Referring to fig. 5, fig. 5 is a flowchart illustrating a process for receiving a heartbeat message by a terminal.
Step four: and after waiting for the heartbeat timer to arrive, the terminal judges whether data needs to be reported to the server, and if so, encapsulates the data message into the heartbeat message and sends the heartbeat message. If no null packet is encapsulated and sent. Referring to fig. 3, fig. 3 is a flow chart of heartbeat timer transmission.
Example two
The embodiment of the invention also provides a storage medium, which comprises a stored program, wherein the program executes the heartbeat-based message data transmission method flow when running.
Optionally, in this embodiment, the storage medium may be configured to store program codes for executing the following procedure of sending a heartbeat-based message data:
s11, the terminal sends an adding request message carrying the basic information of the terminal to the server;
s12, the terminal receives the join request response message from the server and establishes connection with the server;
s13, the terminal sends a first heartbeat message carrying the terminal configuration identifier to the server;
s14, the terminal receives the heartbeat response message from the server;
s15, the terminal sends a configuration state message to the server;
s16, the terminal sends the heartbeat message carrying the terminal information to the server side.
Optionally, in this embodiment, the storage medium may include, but is not limited to: various media capable of storing program codes, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Therefore, by adopting the storage medium of the invention, the storage capacity is reduced, and the built-in program based on the heartbeat message data sending process has higher running speed, thereby quickly and efficiently finishing the interaction between the terminal and the server.
EXAMPLE III
The embodiment of the present invention further provides a processor, where the processor is configured to execute a program, where the program executes the steps in the heartbeat-based message data transmission method when running.
Optionally, in this embodiment, the program is configured to perform the following steps:
s11, the terminal sends an adding request message carrying the basic information of the terminal to the server;
s12, the terminal receives the join request response message from the server and establishes connection with the server;
s13, the terminal sends a first heartbeat message carrying the terminal configuration identifier to the server;
s14, the terminal receives the heartbeat response message from the server;
s15, the terminal sends a configuration state message to the server;
s16, the terminal sends the heartbeat message carrying the terminal information to the server side.
Optionally, for a specific example in this embodiment, reference may be made to the above-described embodiment and examples described in the specific implementation, and details of this embodiment are not described herein again.
Therefore, by adopting the processor, the data volume to be processed is reduced, and the built-in program based on the heartbeat message data sending method flow has higher running speed, so that the interaction between the terminal and the server side is completed quickly and efficiently.
Example four
Fig. 3 is a flow chart of a heartbeat-based message data receiving method of the present invention. As shown in fig. 3, a heartbeat-based message data receiving method includes:
s21, the server receives the join request message carrying the basic information of the terminal from the terminal;
s22, the server sends a join request response message to the terminal, and establishes connection with the terminal;
s23, the server receives the first heartbeat message from the terminal carrying the terminal configuration identification;
s24, the server sends heartbeat response message to the terminal;
s25, the server receives the configuration state message from the terminal;
and S26, the server receives the heartbeat message carrying the terminal information from the terminal.
In specific implementation, the basic information of the terminal includes a terminal model, an equipment serial number, a software version number, a hardware version number, and manufacturer information. The join request message includes the total message length, sub-message type, sub-message length, sub-message content, and other contents, in addition to the above basic terminal information.
The heartbeat response message includes: and encapsulating the terminal configuration data message matched with the terminal configuration identifier.
The join request response message includes a join successful status value or a join failed error code.
And after receiving the first heartbeat message from the terminal carrying the terminal configuration identifier, the server end selects configuration data matched with the terminal configuration identifier to carry out encapsulation according to the terminal configuration identifier to form a heartbeat response message.
The configuration data comprises wireless parameter configuration, function configuration and heartbeat cycle configuration.
The terminal configuration identifier comprises: the message number is configured.
As shown in fig. 9, the process of configuring information when the server receives the heartbeat message, where fig. 9 is a flowchart of configuring the heartbeat message by the server.
The method comprises the following steps: the server side creates a socket communication socket, binds a communication port, monitors socket port information, creates a thread pool and waits for the heartbeat message to be reported.
Step two: after receiving the heartbeat message, searching the current state information of the terminal in the hash table, if the terminal is in an off-line state, updating the current state value of the hash table at the terminal, and if the heartbeat message is not received in 15 periods, setting the state value in the hash table to be off-line.
Step three: and judging whether the heartbeat message has content or not, and if not, directly replying a heartbeat response message.
Step four: and reading the database when the received heartbeat message is the configuration attribute, searching the default configuration according to the MAC address index, packaging the default configuration into a heartbeat response message, and sending the heartbeat response message to the terminal.
Step five: waiting for receiving the next heartbeat message.
Another embodiment of processing data information when a server receives a heartbeat message, as shown in fig. 10, fig. 10 is a flowchart of processing a data heartbeat message by a server.
The method comprises the following steps: the server side creates a socket communication socket, binds a communication port, monitors socket port information, creates a thread pool and waits for the heartbeat message to be reported.
Step two: after receiving the heartbeat message, searching the current state information of the terminal in the hash table, if the terminal is in an off-line state, updating the current state value of the hash table at the terminal, and if the heartbeat message is not received in 15 periods, setting the state value in the hash table to be off-line.
Step three: and judging whether the heartbeat message has content or not, and if not, directly replying a heartbeat response message.
Step four: and the received heartbeat message is a data attribute, the thread analyzes the content of the data packet, and the data content is cached to a memory space in a linked list mode and is stored in a database.
Step five: waiting for receiving the next heartbeat message.
Example four
The embodiment of the invention also provides a storage medium, which comprises a stored program, wherein the program executes the heartbeat-based message data receiving method flow when running.
Optionally, in this embodiment, the storage medium may be configured to store a program code for executing the following procedure of receiving a heartbeat-based message data:
s21, the server receives the join request message carrying the basic information of the terminal from the terminal;
s22, the server sends a join request response message to the terminal, and establishes connection with the terminal;
s23, the server receives the first heartbeat message from the terminal carrying the terminal configuration identification;
s24, the server sends heartbeat response message to the terminal;
s25, the server receives the configuration state message from the terminal;
and S26, the server receives the heartbeat message carrying the terminal information from the terminal.
Optionally, in this embodiment, the storage medium may include, but is not limited to: various media capable of storing program codes, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Therefore, by adopting the storage medium of the invention, the storage capacity is reduced, and the built-in program based on the heartbeat message data receiving flow has higher running speed, thereby quickly and efficiently finishing the interaction between the terminal and the server.
EXAMPLE five
The embodiment of the present invention further provides a processor, where the processor is configured to execute a program, where the program executes the steps in the heartbeat-based message data receiving method when running.
Optionally, in this embodiment, the program is configured to perform the following steps:
s21, the server receives the join request message carrying the basic information of the terminal from the terminal;
s22, the server sends a join request response message to the terminal, and establishes connection with the terminal;
s23, the server receives the first heartbeat message from the terminal carrying the terminal configuration identification;
s24, the server sends heartbeat response message to the terminal;
s25, the server receives the configuration state message from the terminal;
and S26, the server receives the heartbeat message carrying the terminal information from the terminal.
Optionally, for a specific example in this embodiment, reference may be made to the above-described embodiment and examples described in the specific implementation, and details of this embodiment are not described herein again.
Therefore, by adopting the processor, the data volume to be processed is reduced, and the running speed of the built-in program based on the heartbeat message data sending and receiving process is higher, so that the interaction between the terminal and the server side is completed quickly and efficiently.
EXAMPLE six
And replacing data with heartbeat messages at the terminal for sending, and packaging effective data of the terminal in the heartbeat messages for sending together. Fig. 11 is a schematic structural diagram of a terminal and server system based on heartbeat message data transmission and reception. As shown in fig. 11, in a terminal and server system based on heartbeat packet data transmission and reception, an interaction process between a terminal and a server is as follows:
the method comprises the following steps: the terminal sends an adding request and sends an adding request message carrying basic information of the terminal.
Step two: the server responds to the joining response, establishes a connection channel with the terminal and sends a joining response message.
Step three: the terminal sends a first heartbeat message, the heartbeat message carries a desired configuration message number, and a heartbeat response message is sent.
Step four: if the server receives the heartbeat message sent by the terminal and carries the configuration message number, the server encapsulates the configuration parameters to be issued into the heartbeat response message and sends the heartbeat response request message.
Step five: and the terminal responds to the success of configuration updating and sends the configuration message.
Step six: the terminal sends a heartbeat message carrying data or empty data and sends a response request message.
Step seven: the server responds to the heartbeat response of the terminal and sends a response request message.
FIG. 7 is a diagram of a standard capwap control header format. As shown in fig. 7, the message field describes: message Type represents a capwap control header Message; and a seq NumSequence Number, wherein for the CAPWAP control message (except the Echo message) needing to be retransmitted, the sequence Number is sequentially increased when a new message is sent. The Seq Num of the Response message is the same as the sequence number of the corresponding Request message; msg Element Length: the length of the message after flag (see RFC 54154.5.1.3 section); the Msg Element represents a message Element, and for a standard message Element which is not in the list in each control message, neglect processing is performed, and the specification only checks the message Element which needs to be carried.
Fig. 8 is a diagram of a terminal hash table stored on the server. As shown in fig. 8: the MAC ID represents the ID number of the terminal and takes the MAC address as an index; a device status value, representing the status value of the storage terminal on the server: as online, offline, in configuration; next, a linked list pointer is represented.
The technical scheme adopted by the embodiment of the invention also comprises the following steps: in the first step, the terminal sends a join request (join request) message, where the join request (join request) message includes a message terminal model, a device serial number, a software version number, a hardware version number, vendor information, a device number of the terminal, a total length of a message element, a sub-message type, a sub-message length, a sub-message content, and the like. And the server checks according to the manufacturer information reported by the terminal, if the check is successful, the terminal is allowed to join, otherwise, a joining error code is fed back to the terminal.
The technical scheme adopted by the embodiment of the invention also comprises the following steps: in the third step, after receiving the join request message responded by the server, the terminal starts a timer of the heartbeat message and sends a first heartbeat message, wherein the first heartbeat message needs to carry a required configuration message number (message id). The server packages the corresponding configuration data message according to the configuration message number (messageid) carried in the heartbeat message, and then transmits the heartbeat response message to the terminal, such as wireless parameter configuration, function configuration, heartbeat cycle configuration and the like. And after waiting for the next heartbeat period, the terminal timer retransmits the heartbeat message, if a data message needs to be reported to the server, the data message is encapsulated again to the heartbeat message and transmitted, and if no data message is reported, the terminal timer transmits the heartbeat message without any content.
The technical scheme adopted by the embodiment of the invention also comprises the following steps: and in the fourth step, the terminal receives the server response message, judges and processes the data content according to the content length of the response message.
EXAMPLE seven
Correspondingly, the invention also provides a method for sending and receiving data based on heartbeat messages, which comprises the following steps:
s31, the terminal sends an adding request message carrying the basic information of the terminal to the server;
s32, the server sends a join request response message to the terminal, and establishes connection with the terminal;
s33, the terminal sends a first heartbeat message carrying the terminal configuration identifier to the server;
s34, the server sends heartbeat response message to the terminal;
s35, the server receives the configuration state message from the terminal;
s36, the terminal sends the heartbeat message carrying the terminal information to the server side.
After the terminal sends the join request message carrying the basic information of the terminal to the server, the server receives the join request message and analyzes the join request message. And after the analysis is completed, the server side sends a join request response message to the terminal to establish connection with the terminal. After the terminal is successfully connected with the server, the terminal sends a first heartbeat message carrying the terminal configuration identifier to the server. The server receives the heartbeat message and analyzes the heartbeat message. And after the analysis is successful, the server side sends a heartbeat response message to the terminal. The terminal forms a configuration state message according to the configuration requirement of the terminal and sends the configuration state message to the server side. The server receives and analyzes the configuration state message, and then sends the configuration data required by the terminal to the terminal in a packaging mode to complete the function configuration of the terminal. And then the terminal and the server carry out normal communication, and the terminal encapsulates the effective information data of the terminal into the heartbeat message and sends the heartbeat message to the server. For specific examples in this embodiment, reference may be made to the above embodiments and examples described in the specific implementation, and details of this embodiment are not described herein again.
As can be seen from the above description, the heartbeat-based message data transmitting and receiving method, the storage medium, and the processor according to the present invention can be applied to an embedded communication terminal, and can also be applied to a protocol module for communication between a server and a terminal. When the method is applied to the embedded terminal, message interaction can be reduced, CPU loss and memory overhead are reduced, and product performance is improved. When the method is applied to the server, the number of management terminals can be increased on the existing basis, and the product capacity is enlarged. At present, the method is used on WIFI probe equipment, data are interacted once every 2 seconds, a heartbeat cycle is carried out once every 15 seconds, and data overhead can be reduced by 14%.
The above embodiments of the present invention are described in detail, and the principle and the implementation of the present invention are explained by applying specific embodiments, and the above description of the embodiments is only used to help understanding the method of the present invention and the core idea thereof; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (22)

1. A method for sending message data based on heartbeat is characterized by comprising the following steps:
s11, the terminal sends an adding request message carrying the basic information of the terminal to the server;
s12, the terminal receives the join request response message from the server and establishes connection with the server;
s13, the terminal sends a first heartbeat message carrying the terminal configuration identifier to the server;
s14, the terminal receives the heartbeat response message from the server;
s15, the terminal sends a configuration state message to the server;
s16, the terminal sends the heartbeat message carrying the terminal information to the server side.
2. The heartbeat-based message data transmission method according to claim 1, wherein the terminal basic information includes a terminal model, a device serial number, a software version number, a hardware version number, and manufacturer information.
3. The heartbeat-based message data transmitting method of claim 1, wherein the join request message includes a total message length, a sub-message type, a sub-message length, and a sub-message content.
4. The heartbeat-based message data transmitting method of claim 1, wherein the heartbeat response message comprises: and encapsulating the terminal configuration data message matched with the terminal configuration identifier.
5. The heartbeat-based message data transmitting method of claim 1, wherein the join request response message includes a join successful status value or a join failed error code.
6. The heartbeat-based message data transmission method according to claim 1, wherein the sending, by the terminal, the configuration status message to the server side includes: and after the terminal analyzes the heartbeat response message, the terminal is configured according to the heartbeat response message, and a configuration result is sent to the server.
7. The heartbeat-based message data transmission method according to claim 1, wherein the terminal configuration identifier includes: the message number is configured.
8. The heartbeat-based message data sending method according to claim 1, wherein the heartbeat message carrying terminal information carries terminal data encapsulation.
9. The heartbeat-based message data transmission method according to claim 1, wherein in step S12, the terminal receives the join request response message from the server, after establishing connection with the server, starts a timer of the heartbeat message, and when the timer of the heartbeat message expires, executes step S13, the terminal transmits the first heartbeat message carrying the terminal configuration identifier to the server.
10. A storage medium, characterized in that the storage medium comprises a stored program, wherein the program executes the heartbeat-based message data transmission method of any one of claims 1 to 9 when running.
11. A processor, configured to execute a program, wherein the program executes to perform the heartbeat-based messaging data transmission method according to any one of claims 1 to 9.
12. A method for receiving message data based on heartbeat is characterized by comprising the following steps:
s21, the server receives the join request message carrying the basic information of the terminal from the terminal;
s22, the server sends a join request response message to the terminal, and establishes connection with the terminal;
s23, the server receives the first heartbeat message from the terminal carrying the terminal configuration identification;
s24, the server sends heartbeat response message to the terminal;
s25, the server receives the configuration state message from the terminal;
and S26, the server receives the heartbeat message carrying the terminal information from the terminal.
13. The heartbeat-based message data receiving method as claimed in claim 12, wherein the basic information of the terminal includes a terminal model, a device serial number, a software version number, a hardware version number, and manufacturer information.
14. The heartbeat-based message data receiving method of claim 12 wherein the join request message includes a total message length, a sub-message type, a sub-message length, and a sub-message content.
15. The heartbeat-based message data receiving method of claim 12, wherein the heartbeat response message includes: and encapsulating the terminal configuration data message matched with the terminal configuration identifier.
16. The heartbeat-based message data receiving method of claim 12 wherein the join request response message includes a join-successful status value or a join-failed error code.
17. The heartbeat-based message data receiving method according to claim 12, wherein after receiving the first heartbeat message from the terminal carrying the terminal configuration identifier, the server side selects the configuration data matched with the terminal configuration identifier for encapsulation according to the terminal configuration identifier to form a heartbeat response message.
18. The heartbeat-based message data receiving method of claim 17 wherein the configuration data includes radio parameter configuration, function configuration, heartbeat cycle configuration.
19. The heartbeat-based message data receiving method according to claim 12, wherein the terminal configuration identifier includes: the message number is configured.
20. A storage medium, characterized in that the storage medium comprises a stored program, wherein the program is executed when running to perform the heartbeat-based message data receiving method of any one of claims 12 to 19.
21. A processor, characterized in that the processor is configured to execute a program, wherein the program is configured to execute the heartbeat-based message data receiving method according to any one of claims 12 to 19 when running.
22. A method for sending and receiving data based on heartbeat messages is characterized by comprising the following steps:
s31, the terminal sends an adding request message carrying the basic information of the terminal to the server;
s32, the server sends a join request response message to the terminal, and establishes connection with the terminal;
s33, the terminal sends a first heartbeat message carrying the terminal configuration identifier to the server;
s34, the server sends heartbeat response message to the terminal;
s35, the server receives the configuration state message from the terminal;
s36, the terminal sends the heartbeat message carrying the terminal information to the server side.
CN201811551376.6A 2018-12-18 2018-12-18 Data sending and receiving method based on heartbeat message, storage medium and processor Pending CN111343218A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201811551376.6A CN111343218A (en) 2018-12-18 2018-12-18 Data sending and receiving method based on heartbeat message, storage medium and processor
PCT/CN2019/111046 WO2020125168A1 (en) 2018-12-18 2019-10-14 Heartbeat packet-based data sending and receiving method, and storage medium and processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811551376.6A CN111343218A (en) 2018-12-18 2018-12-18 Data sending and receiving method based on heartbeat message, storage medium and processor

Publications (1)

Publication Number Publication Date
CN111343218A true CN111343218A (en) 2020-06-26

Family

ID=71101040

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811551376.6A Pending CN111343218A (en) 2018-12-18 2018-12-18 Data sending and receiving method based on heartbeat message, storage medium and processor

Country Status (2)

Country Link
CN (1) CN111343218A (en)
WO (1) WO2020125168A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112187876A (en) * 2020-09-10 2021-01-05 交控科技股份有限公司 Communication list establishing method, communication method and cloud platform
CN112468454A (en) * 2020-11-11 2021-03-09 许继集团有限公司 Remote file management system and remote file management method thereof
CN114337719A (en) * 2021-12-30 2022-04-12 杭州和利时自动化有限公司 Digital antenna, wireless communication device, polling communication method, and notification communication method
CN117118876A (en) * 2023-10-20 2023-11-24 美云智数科技有限公司 Heartbeat connection detection method and device, electronic equipment and storage medium

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112910740A (en) * 2021-02-09 2021-06-04 珠海格力电器股份有限公司 State reporting method, device, equipment and computer readable storage medium
CN114629518B (en) * 2022-03-31 2024-03-01 厦门骐俊物联科技股份有限公司 Dynamic ad hoc network method of digital interphone
CN114640705B (en) * 2022-04-22 2022-08-09 山东恒远智能科技有限公司 Large-scale Internet of things terminal heartbeat monitoring method
CN115102952B (en) * 2022-06-22 2023-04-07 睿云联(厦门)网络通讯技术有限公司 Method, device and medium for connecting terminal product with cloud platform through local server

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012167464A1 (en) * 2011-07-01 2012-12-13 华为技术有限公司 Heartbeat message transmission method and heartbeat proxy server
CN103856954A (en) * 2012-11-28 2014-06-11 中国电信股份有限公司 Method and system for detecting roam terminal heartbeat cycle, roam terminal and server
CN106790736A (en) * 2016-11-17 2017-05-31 上海斐讯数据通信技术有限公司 A kind of autosynchronous method of IP address of terminal and cloud terminal management system

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7370194B2 (en) * 2002-06-10 2008-05-06 Microsoft Corporation Security gateway for online console-based gaming
CN103490943A (en) * 2013-07-04 2014-01-01 文杰 Industrial Ethernet packet loss detection method based on heartbeat signals
CN104468380A (en) * 2014-11-14 2015-03-25 上海斐讯数据通信技术有限公司 Interface communication method of access point device and server interaction
CN104993979A (en) * 2015-07-22 2015-10-21 上海迈外迪网络科技有限公司 Network connection monitoring method, terminal equipment and communication system
CN105071956A (en) * 2015-07-23 2015-11-18 苏州汉明科技有限公司 Communication method and system for commercial WIFI

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012167464A1 (en) * 2011-07-01 2012-12-13 华为技术有限公司 Heartbeat message transmission method and heartbeat proxy server
CN103119896A (en) * 2011-07-01 2013-05-22 华为技术有限公司 Heartbeat message transmission method and heartbeat proxy server
CN103856954A (en) * 2012-11-28 2014-06-11 中国电信股份有限公司 Method and system for detecting roam terminal heartbeat cycle, roam terminal and server
CN106790736A (en) * 2016-11-17 2017-05-31 上海斐讯数据通信技术有限公司 A kind of autosynchronous method of IP address of terminal and cloud terminal management system

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112187876A (en) * 2020-09-10 2021-01-05 交控科技股份有限公司 Communication list establishing method, communication method and cloud platform
CN112468454A (en) * 2020-11-11 2021-03-09 许继集团有限公司 Remote file management system and remote file management method thereof
CN112468454B (en) * 2020-11-11 2023-06-06 许继集团有限公司 Remote file management system and remote file management method thereof
CN114337719A (en) * 2021-12-30 2022-04-12 杭州和利时自动化有限公司 Digital antenna, wireless communication device, polling communication method, and notification communication method
CN114337719B (en) * 2021-12-30 2024-04-16 杭州和利时自动化有限公司 Digital antenna, wireless communication device, polling communication method, and notification communication method
CN117118876A (en) * 2023-10-20 2023-11-24 美云智数科技有限公司 Heartbeat connection detection method and device, electronic equipment and storage medium
CN117118876B (en) * 2023-10-20 2024-03-08 美云智数科技有限公司 Heartbeat connection detection method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
WO2020125168A1 (en) 2020-06-25

Similar Documents

Publication Publication Date Title
CN111343218A (en) Data sending and receiving method based on heartbeat message, storage medium and processor
TWI420873B (en) Method of transmitting messages in communication networks
US9137623B2 (en) Method and system for realizing concurrent access of multi-kinds of bearer protocols on machine-to-machine (M2M) platform
WO2018010689A1 (en) Group management method utilized in coordinated multipoint, device, and system
JP7239090B2 (en) Methods, devices, computer readable storage media, programs and systems for measuring signal strength
WO2017054576A1 (en) Unicast tunnel building method, apparatus and system
RU2010136044A (en) WIRELESS RADIO CONTROL UNITS USING IDENTIFIERS
US10051561B2 (en) Methods and nodes for M2M communication
CN111263377B (en) Network configuration method, device, equipment and system and distribution network testing method and system
CN111510419A (en) Data compression method and base station
CN111277507A (en) Method for realizing information exchange between wireless terminals
CN104243719B (en) The heart beat cycle of long connection determines mthods, systems and devices in mobile communications network
CN111884938B (en) Router information acquisition method and device
CN115004650B (en) Node configuration method, node configuration device, distributed system and computer readable medium
EP3503484A1 (en) Message transmission method, device and network system
CN116938712A (en) Device upgrade method, device upgrade apparatus, and computer-readable storage medium
CN108900317B (en) Method for batch upgrading of multiple network devices in Ethernet broadcast mode
CN114915555B (en) Gateway drive communication method, device, equipment and storage medium
CN101741605B (en) Method, apparatus and system for processing message
CN111163463A (en) Method, device, equipment and storage medium for accessing wireless equipment to router
US11950179B2 (en) Method and apparatus for obtaining network slice identifier
CN111245867A (en) Sensor data analysis method and system
CN114390454A (en) Message transmission method, system, electronic device and storage medium
CN113784379B (en) Network management method and device
WO2024060762A1 (en) Power line communication method and apparatus

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20211110

Address after: 518057 2nd floor, software building, No. 9, Gaoxin Zhongyi Road, Nanshan District, Shenzhen, Guangdong

Applicant after: KUANG-CHI INSTITUTE OF ADVANCED TECHNOLOGY

Address before: 310000 room 1101, building 14, No. 1008, yearning street, Cangqian street, Yuhang District, Hangzhou City, Zhejiang Province

Applicant before: Hangzhou Guangqi Artificial Intelligence Research Institute

RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200626