CN109194744B - Data transmission method and device, storage medium and monitoring equipment - Google Patents

Data transmission method and device, storage medium and monitoring equipment Download PDF

Info

Publication number
CN109194744B
CN109194744B CN201811032021.6A CN201811032021A CN109194744B CN 109194744 B CN109194744 B CN 109194744B CN 201811032021 A CN201811032021 A CN 201811032021A CN 109194744 B CN109194744 B CN 109194744B
Authority
CN
China
Prior art keywords
target server
data
data transmission
monitoring
monitoring equipment
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
CN201811032021.6A
Other languages
Chinese (zh)
Other versions
CN109194744A (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.)
Shanghai Huace Navigation Technology Ltd
Original Assignee
Shanghai Huace Navigation Technology 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 Shanghai Huace Navigation Technology Ltd filed Critical Shanghai Huace Navigation Technology Ltd
Priority to CN201811032021.6A priority Critical patent/CN109194744B/en
Publication of CN109194744A publication Critical patent/CN109194744A/en
Application granted granted Critical
Publication of CN109194744B publication Critical patent/CN109194744B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • H04L67/025Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of 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/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The embodiment of the invention discloses a data transmission method, a data transmission device, a storage medium and monitoring equipment. The method comprises the following steps: when detecting that a data transmission event is triggered, disconnecting the monitoring equipment from a target server; reestablishing the connection between the monitoring equipment and the target server, and judging whether the establishment is successful; and when the establishment is successful, sending monitoring data to the target server. By the technical scheme provided by the embodiment of the invention, the monitoring equipment can be effectively ensured to transmit the monitoring data to the target server, the stability of data transmission can be improved, the maintenance cost of effective data transmission can be reduced, and the safety of maintenance personnel can be further ensured.

Description

Data transmission method and device, storage medium and monitoring equipment
Technical Field
The embodiment of the invention relates to the technical field of communication, in particular to a data transmission method, a data transmission device, a storage medium and monitoring equipment.
Background
The monitoring equipment is generally used in places with rare or difficult maintenance, such as a deep mountain or the bottom of a bridge. Currently, a monitoring device generally performs data transmission through a GPRS (General Packet Radio Service) module, and transmits monitoring data to a target server. However, often, because the connection between the monitoring device and the target server is in a virtual connection state (substantially disconnected state), successful transmission of the monitoring data to the target server cannot be effectively guaranteed.
Disclosure of Invention
Embodiments of the present invention provide a data transmission method, an apparatus, a storage medium, and a monitoring device, which can effectively ensure that the monitoring device transmits monitoring data to a target server, and can improve stability of data transmission.
In a first aspect, an embodiment of the present invention provides a data transmission method, including:
when detecting that a data transmission event is triggered, disconnecting the monitoring equipment from a target server;
reestablishing the connection between the monitoring equipment and the target server, and judging whether the establishment is successful;
and when the establishment is successful, sending monitoring data to the target server.
Further, the method further comprises:
and when the establishment fails, caching the monitoring data, and returning to execute the operation of disconnecting the connection between the monitoring equipment and the target server when detecting that the data transmission event is triggered.
Further, after sending the monitoring data to the target server, the method further includes:
judging whether a data response message sent by the target server is received within a preset time period;
if the data response message sent by the target server is not received within a preset time period, adding 1 to the initial sending times in an accumulated mode to update the initial sending times, and judging whether the updated initial sending times are larger than a preset time threshold value or not;
and if not, returning to execute the operation of sending the monitoring data to the target server.
Further, the method further comprises:
and if the updated initial sending times are larger than the preset time threshold, caching the monitoring data, and returning to execute the operation of disconnecting the monitoring equipment from the target server when the data transmission event is detected to be triggered.
Further, detecting that a data transfer event is triggered includes:
taking a set time period as a trigger condition of a data transmission event, and detecting that the data transmission event is triggered when the last trigger time passes the set time period; or
When the preset transmission time for transmitting the data is reached, the data transmission event is detected to be triggered.
In a second aspect, an embodiment of the present invention further provides a data transmission apparatus, including:
the disconnection module is used for disconnecting the monitoring equipment from the target server when detecting that the data transmission event is triggered;
the connection establishing module is used for reestablishing the connection between the monitoring equipment and the target server and judging whether the establishment is successful or not;
and the first data sending module is used for sending monitoring data to the target server when the establishment is successful.
Further, the apparatus further comprises:
and the first data caching module is used for caching the monitoring data when the establishment fails and returning to execute the operation of disconnecting the connection between the monitoring equipment and the target server when the data transmission event is detected to be triggered.
Further, the apparatus further comprises:
the response message judging module is used for judging whether a data response message sent by the target server is received within a preset time period after the monitoring data is sent to the target server;
the sending time updating module is used for accumulating and adding 1 to the initial sending time to update the initial sending time if the data response message sent by the target server is not received within a preset time period, and judging whether the updated initial sending time is greater than a preset time threshold value or not;
and the second data sending module is used for returning and executing the operation of sending the monitoring data to the target server if the updated initial sending times are less than or equal to the preset time threshold.
Further, the apparatus further comprises:
and the second data caching module is used for caching the monitoring data if the updated initial sending times are greater than the preset time threshold value, and returning to execute the operation of disconnecting the monitoring equipment from the target server when the data transmission event is detected to be triggered.
Further, detecting that a data transfer event is triggered includes:
taking a set time period as a trigger condition of a data transmission event, and detecting that the data transmission event is triggered when the last trigger time passes the set time period; or
When the preset transmission time for transmitting the data is reached, the data transmission event is detected to be triggered.
In a third aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the data transmission method according to the first aspect of the embodiment of the present invention.
In a fourth aspect, an embodiment of the present invention provides a monitoring device, including:
one or more processors;
a memory for storing one or more programs;
when the one or more programs are executed by the one or more processors, the one or more processors implement the method for data transmission according to the first aspect of the embodiment of the present invention.
According to the data transmission scheme provided by the embodiment of the invention, when the data transmission event is detected to be triggered, the connection between the monitoring equipment and the target server is disconnected, the connection between the monitoring equipment and the target server is reestablished, whether the establishment is successful or not is judged, and when the establishment is successful, the monitoring data are sent to the target server. By adopting the technical scheme, the monitoring equipment can be effectively ensured to transmit the monitoring data to the target server, the stability of data transmission can be improved, the maintenance cost of effective data transmission can be reduced, and the safety of maintenance personnel can be further ensured.
Drawings
Fig. 1 is a schematic flowchart of a data transmission method according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a data transmission method according to a second embodiment of the present invention;
fig. 3 is a schematic flowchart of a preferred data transmission method according to a second embodiment of the present invention;
fig. 4 is a schematic flowchart of a data transmission method according to a third embodiment of the present invention;
fig. 5 is a schematic flowchart of a preferred data transmission method according to a third embodiment of the present invention;
fig. 6 is a schematic structural diagram of a data transmission apparatus according to a fourth embodiment of the present invention;
fig. 7 is a schematic structural diagram of a monitoring device according to a sixth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the steps as a sequential process, many of the steps can be performed in parallel, concurrently or simultaneously. In addition, the order of the steps may be rearranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like.
At present, after monitoring data is sent to a target server by a monitoring device, from the logic of an application layer, two situations, namely server response and server non-response, are included. For the condition that the server has a response, in the prior art, the monitoring device may periodically send a heartbeat packet to the target server, and determine whether a response heartbeat packet fed back by the server for the heartbeat packet is received, and if a response heartbeat packet fed back by the server is not received, it indicates that the monitoring device and the target server are disconnected, and a connection needs to be established again with the target server. This has a disadvantage: if the sending frequency of the heartbeat packet is dense, the flow is wasted; if the sending frequency of the heartbeat packet is not dense enough, the monitoring data in the monitoring equipment cannot be guaranteed to be effectively transmitted to the target server, and the effective monitoring data is lost. For the condition that the server does not respond, the monitoring equipment only sends the monitoring data to the target server at regular time, and whether effective monitoring data are continuously sent to the target server or not can not be effectively ensured under the condition that the target server does not respond for monitoring. The disadvantages are caused, and mainly include the following aspects: first, the monitoring device establishes a communication connection with the target server only at the beginning, and at this time, data transmission is stable. However, as the transmission time increases, the operator network automatically kicks off the devices connected to its network, for example, the telecom operator periodically kicks off all the communication devices connected to its network every 3 hours and 55 minutes, so that the monitoring device is disconnected from the target server. Secondly, the monitoring equipment is usually connected with the target server in a way of establishing a socket through a protocol stack, but the target server usually limits the number of socket connections, can regularly clean the socket, and is easy to cause disconnection between the monitoring equipment and the target server. Thirdly, the connection between the monitoring equipment and the target server is also disconnected by the restarting operation of the target server. In order to ensure that monitoring data are effectively transmitted to the target server, maintenance personnel are required to go to the field for maintenance, the labor cost can be greatly increased, and the safety of the maintenance personnel cannot be effectively ensured. For the above reasons, the embodiments of the present invention provide the following data transmission methods.
Example one
Fig. 1 is a schematic flow chart of a data transmission method according to an embodiment of the present invention, where the method is applicable to a situation where monitoring equipment effectively transmits monitoring data, and the method can be executed by a data transmission device, where the device can be implemented by software and/or hardware, and can be generally integrated in monitoring equipment. As shown in fig. 1, the method includes:
s101, when the data transmission event is detected to be triggered, the connection between the monitoring equipment and the target server is disconnected.
For example, the monitoring devices in the embodiments of the present invention may include water level monitoring devices, deformation monitoring devices, meteorological monitoring devices, geological disaster monitoring devices, bridge safety monitoring devices, and other monitoring devices. The embodiment of the invention does not limit the type of the monitoring equipment. In the embodiment of the invention, the monitoring equipment can acquire sensing data through a built-in sensor according to a preset rule. The preset rule may include acquiring the sensing data once every preset time, or acquiring the sensing data once at a preset time. For example, the triggering condition of the data transmission event may be set according to an actual situation, and the embodiment of the present application is not particularly limited. For example, the data transmission event may be triggered when it is detected that a sensor built in the monitoring device has collected sensing data once. Optionally, detecting that the data transmission event is triggered includes: taking a set time period as a trigger condition of a data transmission event, and detecting that the data transmission event is triggered when the last trigger time passes the set time period; or when a preset transmission time for transmitting data is reached, detecting that a data transmission event is triggered. For example, a timer is set inside the monitoring device, and a data transmission event is triggered every preset time period, that is, every preset time period, a data transmission event is triggered, for example, every 5 minutes, a data transmission event is triggered. For another example, a data transmission time is set, and when the current time reaches the set data transmission time, that is, when a preset data transmission time is reached, a data transmission event is triggered, for example, an entire time of each day, and a data transmission event is triggered.
In the embodiment of the invention, when the data transmission event is detected to be triggered, the connection between the monitoring device and the target server is disconnected. Before the connection between the monitoring device and the target server is disconnected, the connection state between the monitoring device and the target server includes two states: one is that the monitoring device is in a real connection state with the target server; the other is that the monitoring device and the target server are in a virtual connection state, namely the monitoring device and the target server are in a disconnection state. Generally, the monitoring device cannot detect whether the connection with the target server is established, so that if the monitoring device and the target server are in a real connection state, the connection between the monitoring device and the target server is disconnected; if the monitoring device and the target server are in a disconnected state, the monitoring device and the target server are disconnected again, and the disconnection operation can be regarded as an invalid operation.
S102, reestablishing the connection between the monitoring equipment and the target server, and judging whether the establishment is successful.
In the embodiment of the invention, after the connection between the monitoring equipment and the target server is disconnected, the connection between the monitoring equipment and the target server is reestablished. Illustratively, the monitoring device sends an AT command to the target server through a built-in GPRS module to establish a connection with the target server. Or, the monitoring device establishes a socket through a protocol stack to establish connection with the target server. Judging whether the connection between the monitoring equipment and the target server is established successfully or not, wherein when the monitoring equipment receives an AT feedback instruction sent by the target server, the connection between the monitoring equipment and the target server is established successfully, otherwise, the connection between the monitoring equipment and the target server is established unsuccessfully, wherein the AT feedback instruction is feedback information of the target server aiming AT the AT instruction sent by the monitoring equipment; or, when receiving the socket feedback information sent by the target server, the monitoring device indicates that the connection establishment between the monitoring device and the target server is successful, otherwise, the connection establishment between the monitoring device and the target server is failed, wherein the socket feedback information is feedback information of a protocol stack, which is sent by the target server for the monitoring device.
S103, when the establishment is successful, sending monitoring data to the target server.
Illustratively, when the connection between the monitoring device and the target server is successfully established, the monitoring device sends monitoring data to the target server, so that the target server analyzes the monitoring data to determine whether a monitored object of the monitoring device meets requirements. The monitoring data may include that the monitoring device collects sensing data through a built-in sensor according to a preset rule.
According to the data transmission method provided by the embodiment of the invention, when the data transmission event is detected to be triggered, the connection between the monitoring equipment and the target server is disconnected, the connection between the monitoring equipment and the target server is reestablished, whether the establishment is successful or not is judged, and when the establishment is successful, the monitoring data are sent to the target server. By adopting the technical scheme, the monitoring equipment can be effectively ensured to transmit the monitoring data to the target server, the stability of data transmission can be improved, the maintenance cost of effective data transmission can be reduced, and the safety of maintenance personnel can be further ensured.
Example two
Fig. 2 is a flowchart of a data transmission method according to a second embodiment of the present invention. In this embodiment, the data transmission method further includes: and when the establishment fails, caching the monitoring data, and returning to execute the operation of disconnecting the connection between the monitoring equipment and the target server when detecting that the data transmission event is triggered. Correspondingly, the method of the embodiment specifically includes:
s201, when the data transmission event is triggered, disconnecting the monitoring device from the target server.
S202, reestablishing the connection between the monitoring equipment and the target server, and judging whether the establishment is successful, if so, executing S203, otherwise, executing S204.
S203, sending monitoring data to the target server.
S204, caching the monitoring data, and returning to execute the operation of disconnecting the monitoring equipment from the target server when detecting that the data transmission event is triggered.
In the embodiment of the invention, when the connection between the monitoring device and the target server is failed to be established, the monitoring data is cached locally, and when the data transmission event is detected to be triggered again, the operation of disconnecting the connection between the monitoring device and the target server is executed.
Fig. 3 is a schematic flowchart of a preferred data transmission method according to an embodiment of the present invention, where the method is mainly applicable to a case where a target server has no response. As shown in fig. 3, the monitoring device collects monitoring data, determines whether the current time is the data transmission time, and if not, repeats the step of determining whether the current time is the data transmission time until the current time is the data transmission time; if so, disconnecting the monitoring equipment from the target server, and reestablishing the connection between the monitoring equipment and the target server. When the connection between the monitoring equipment and the target server is successfully established, the monitoring equipment sends the monitoring data to the target server, so that the target server analyzes the monitoring data; when the connection between the monitoring equipment and the target server is failed to be established, the monitoring data is cached locally, whether the current time reaches the next data transmission time or not is judged, if yes, the current time is the data transmission time, and if not, the operation is repeatedly executed until the current time reaches the next data transmission time.
According to the data transmission method provided by the embodiment of the invention, when the connection between the monitoring equipment and the target server is failed to be established, the monitoring data is cached, and the operation of disconnecting the connection between the monitoring equipment and the target server when the data transmission event is detected to be triggered is returned to be executed, so that the monitoring equipment can be further ensured to transmit the monitoring data to the target server, and the stability of data transmission can be improved.
EXAMPLE III
Fig. 4 is a flowchart of a data transmission method according to a third embodiment of the present invention. In this embodiment, the data transmission method further includes: after sending the monitoring data to the target server, the method further comprises: judging whether a data response message sent by the target server is received within a preset time period; if the data response message sent by the target server is not received within a preset time period, adding 1 to the initial sending times in an accumulated mode to update the initial sending times, and judging whether the updated initial sending times are larger than a preset time threshold value or not; and if not, returning to execute the operation of sending the monitoring data to the target server. Optionally, the method further includes: and if the updated initial sending times are larger than the preset time threshold, caching the monitoring data, and returning to execute the operation of disconnecting the monitoring equipment from the target server when the data transmission event is detected to be triggered. Correspondingly, the method of the embodiment specifically includes:
s401, when the data transmission event is triggered, disconnecting the monitoring device from the target server.
S402, reestablishing the connection between the monitoring equipment and the target server, and judging whether the establishment is successful, if so, executing S403, otherwise, executing S406.
And S403, sending monitoring data to the target server.
And S404, judging whether a data response message sent by the target server is received in a preset time period, if so, executing S407, and otherwise, executing S405.
In the embodiment of the present invention, after the monitoring device sends the monitoring data to the target server, it is determined whether a data response message of the target server side is received within a preset time period, where the data response message is feedback information of the target server for the received monitoring data sent by the monitoring device. And after receiving the data response message sent by the target server, indicating that the monitoring equipment has successfully sent the monitoring data to the target server, and indicating that the monitoring data sending task is finished. When the data response message transmitted by the target server is not received, S405 is performed.
S405, adding 1 to the initial sending times to update the initial sending times, and judging whether the updated initial sending times are larger than a preset time threshold, if so, executing S406, otherwise, returning to executing S403.
In this embodiment of the present invention, the initial sending number may be set to 0, after the monitoring device sends the monitoring data to the target server, if a data response message sent by the target server is not received within a preset time period, it indicates that the sending of the monitoring data fails, at this time, 1 is added to the initial sending number in an accumulated manner, and it is determined whether the updated initial sending number is greater than a preset threshold, such as n, where n is an integer greater than or equal to 1. When the updated initial sending times are less than or equal to the preset threshold, the monitoring device sends the monitoring data to the target server again and executes subsequent operations, when the updated initial sending times are greater than the preset threshold, the monitoring device caches the monitoring data locally, and when the data transmission event is detected to be triggered again, the monitoring device executes the operation of disconnecting the monitoring device from the target server.
And S406, caching the monitoring data, and returning to S401.
And S406, finishing the monitoring data sending task when the data transmission event is triggered.
Fig. 5 is a schematic flowchart of a preferred data transmission method according to an embodiment of the present invention, where the method is mainly applicable to a case where a target server has a response. As shown in fig. 5, the monitoring device collects monitoring data, determines whether the current time is the data transmission time, and if not, repeats the step of determining whether the current time is the data transmission time until the current time is the data transmission time; if so, disconnecting the monitoring equipment from the target server, and reestablishing the connection between the monitoring equipment and the target server. When the connection between the monitoring equipment and the target server is successfully established, the monitoring equipment sends the monitoring data to the target server, so that the target server analyzes the monitoring data; when the connection between the monitoring equipment and the target server is failed to be established, the monitoring data is cached locally, whether the current time reaches the next data transmission time or not is judged, if yes, the current time is the data transmission time, and if not, the operation is repeatedly executed until the current time reaches the next data transmission time. And after the monitoring equipment sends the monitoring data to the target server, judging whether a data response message of the target server side is received or not within a preset time period, if so, indicating that the sending task of the monitoring data within the set time period is finished, otherwise, adding 1 to the initial sending frequency, judging whether the updated initial sending frequency is greater than a preset frequency threshold value n or not, if so, returning to execute the operation of caching the monitoring data in the local, otherwise, returning to execute the operation of sending the monitoring data to the target server.
According to the data transmission method provided by the embodiment of the invention, after the monitoring data is sent to the target server, whether a data response message sent by the target server is received or not is judged within a preset time period; if the data response message sent by the target server is not received within the preset time period, accumulating the initial sending times by adding 1 to update the initial sending times, and judging whether the updated initial sending times are greater than a preset time threshold value or not; and if not, returning to execute the operation of sending the monitoring data to the target server. And if the updated initial sending times are larger than a preset time threshold, caching the monitoring data, and returning to execute the operation of disconnecting the monitoring equipment from the target server when the data transmission event is detected to be triggered. By the technical scheme, the problem that in the prior art, if the heartbeat packet sending frequency is dense, the flow is wasted can be effectively solved; if the heartbeat packet sending frequency is not dense enough, the monitoring data in the monitoring equipment cannot be guaranteed to be effectively transmitted to the target server, so that the technical problem of loss of the effective monitoring data is caused, the heartbeat packet sending can be effectively avoided, the flow waste is reduced, and the data transmission cost is greatly reduced.
Example four
Fig. 6 is a schematic structural diagram of a data transmission apparatus according to a fourth embodiment of the present invention. As shown in fig. 6, the apparatus includes: a disconnection module 601, a connection establishment module 602, and a first data transmission module 603, where:
a disconnection module 601, configured to disconnect the connection between the monitoring device and the target server when detecting that a data transmission event is triggered;
a connection establishing module 602, configured to reestablish a connection between the monitoring device and the target server, and determine whether the establishment is successful;
a first data sending module 603, configured to send monitoring data to the target server when the establishment is successful.
In the data transmission device provided in the embodiment of the present invention, when it is detected that a data transmission event is triggered, the connection between the monitoring device and the target server is disconnected, the connection between the monitoring device and the target server is reestablished, whether the establishment is successful or not is determined, and when the establishment is successful, the monitoring data is sent to the target server. By adopting the technical scheme, the monitoring equipment can be effectively ensured to transmit the monitoring data to the target server, the stability of data transmission can be improved, the maintenance cost of effective data transmission can be reduced, and the safety of maintenance personnel can be further ensured.
Optionally, the apparatus further comprises:
and the first data caching module is used for caching the monitoring data when the establishment fails and returning to execute the operation of disconnecting the connection between the monitoring equipment and the target server when the data transmission event is detected to be triggered.
Optionally, the apparatus further comprises:
the response message judging module is used for judging whether a data response message sent by the target server is received within a preset time period after the monitoring data is sent to the target server;
the sending time updating module is used for accumulating and adding 1 to the initial sending time to update the initial sending time if the data response message sent by the target server is not received within a preset time period, and judging whether the updated initial sending time is greater than a preset time threshold value or not;
and the second data sending module is used for returning and executing the operation of sending the monitoring data to the target server if the updated initial sending times are less than or equal to the preset time threshold.
Optionally, the apparatus further comprises:
and the second data caching module is used for caching the monitoring data if the updated initial sending times are greater than the preset time threshold value, and returning to execute the operation of disconnecting the monitoring equipment from the target server when the data transmission event is detected to be triggered.
Optionally, detecting that the data transmission event is triggered includes:
taking a set time period as a trigger condition of a data transmission event, and detecting that the data transmission event is triggered when the last trigger time passes the set time period; or
When the preset transmission time for transmitting the data is reached, the data transmission event is detected to be triggered.
EXAMPLE five
An embodiment of the present invention provides a storage medium containing computer-executable instructions, where the computer-executable instructions are used in a data transmission method when executed by a computer processor, and the method includes:
when detecting that a data transmission event is triggered, disconnecting the monitoring equipment from a target server;
reestablishing the connection between the monitoring equipment and the target server, and judging whether the establishment is successful;
and when the establishment is successful, sending monitoring data to the target server.
Storage medium-any of various types of memory devices or storage devices. The term "storage medium" is intended to include: mounting media such as CD-ROM, floppy disk, or tape devices; computer system memory or random access memory such as DRAM, DDRRAM, SRAM, EDORAM, Lanbas (Rambus) RAM, etc.; non-volatile memory such as flash memory, magnetic media (e.g., hard disk or optical storage); registers or other similar types of memory elements, etc. The storage medium may also include other types of memory or combinations thereof. In addition, the storage medium may be located in a first computer system in which the program is executed, or may be located in a different second computer system connected to the first computer system through a network (such as the internet). The second computer system may provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media that may reside in different locations, such as in different computer systems that are connected by a network. The storage medium may store program instructions (e.g., embodied as a computer program) that are executable by one or more processors.
Of course, the storage medium provided by the embodiment of the present invention contains computer-executable instructions, and the computer-executable instructions are not limited to the data transmission operations described above, and may also perform related operations in the data transmission method provided by any embodiment of the present invention.
EXAMPLE six
Fig. 7 is a schematic structural diagram of a monitoring device according to a sixth embodiment of the present invention. The monitoring device shown in fig. 7 is only an example and should not bring any limitation to the function and the range of use of the embodiment of the present invention. As shown in fig. 7, a monitoring apparatus according to a sixth embodiment of the present invention includes a processor 71, a memory 72, an input device 73, and an output device 74; the number of the processors 71 in the monitoring device may be one or more, and one processor 71 is taken as an example in fig. 7; the processor 71, the memory 72, the input device 73 and the output device 74 in the monitoring apparatus may be connected by a bus or other means, and fig. 7 illustrates the connection by a bus as an example.
The memory 72 is a computer-readable storage medium, and can be used for storing software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the bluetooth-based operation mode configuration method in the embodiment of the present invention (for example, the disconnection module 601, the connection establishment module 602, and the first data transmission module 603 in the data transmission device). The processor 71 executes various functional applications and data transmission by executing software programs, instructions and modules stored in the memory 72, for example, implementing the data transmission method applied to the monitoring device provided by the embodiment of the present invention.
The memory 72 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the monitoring device, and the like. Further, the memory 72 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, the memory 72 may further include memory located remotely from the processor 71, which may be connected to the monitoring device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 73 may be used to receive user-entered numeric or character information to generate key signal inputs relating to user settings and function controls of the monitoring device. The output device 74 may include a display device such as a display screen.
The data transmission device, the storage medium and the monitoring device provided in the above embodiments can execute the corresponding data transmission method provided in the embodiments of the present invention, and have corresponding functional modules and beneficial effects for executing the method. For details of the data transmission method provided in any of the embodiments of the present invention, reference may be made to the above-described embodiments.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A data transmission method is applied to monitoring equipment and comprises the following steps:
when detecting that a data transmission event is triggered, disconnecting the monitoring equipment from a target server;
reestablishing the connection between the monitoring equipment and the target server, and judging whether the establishment is successful;
and when the establishment is successful, sending monitoring data to the target server.
2. The method of claim 1, further comprising:
and when the establishment fails, caching the monitoring data, and returning to execute the operation of disconnecting the connection between the monitoring equipment and the target server when detecting that the data transmission event is triggered.
3. The method of claim 1, after sending the monitoring data to the target server, further comprising:
judging whether a data response message sent by the target server is received within a preset time period;
if the data response message sent by the target server is not received within a preset time period, adding 1 to the initial sending times in an accumulated mode to update the initial sending times, and judging whether the updated initial sending times are larger than a preset time threshold value or not;
and if not, returning to execute the operation of sending the monitoring data to the target server.
4. The method of claim 3, further comprising:
and if the updated initial sending times are larger than the preset time threshold, caching the monitoring data, and returning to execute the operation of disconnecting the monitoring equipment from the target server when the data transmission event is detected to be triggered.
5. The method of any of claims 1-4, wherein detecting that a data transmission event is triggered comprises:
taking a set time period as a trigger condition of a data transmission event, and detecting that the data transmission event is triggered when the last trigger time passes the set time period; or
When the preset transmission time for transmitting the data is reached, the data transmission event is detected to be triggered.
6. A data transmission device is applied to monitoring equipment and comprises:
the disconnection module is used for disconnecting the monitoring equipment from the target server when detecting that the data transmission event is triggered;
the connection establishing module is used for reestablishing the connection between the monitoring equipment and the target server and judging whether the establishment is successful or not;
and the first data sending module is used for sending monitoring data to the target server when the establishment is successful.
7. The apparatus of claim 6, further comprising:
and the first data caching module is used for caching the monitoring data when the establishment fails and returning to execute the operation of disconnecting the connection between the monitoring equipment and the target server when the data transmission event is detected to be triggered.
8. The apparatus of claim 6, further comprising:
the response message judging module is used for judging whether a data response message sent by the target server is received within a preset time period after the monitoring data is sent to the target server;
the sending time updating module is used for accumulating and adding 1 to the initial sending time to update the initial sending time if the data response message sent by the target server is not received within a preset time period, and judging whether the updated initial sending time is greater than a preset time threshold value or not;
and the second data sending module is used for returning and executing the operation of sending the monitoring data to the target server if the updated initial sending times are less than or equal to the preset time threshold.
9. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the data transmission method according to any one of claims 1 to 5.
10. A monitoring device, comprising:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement a data transmission method as claimed in any one of claims 1-5.
CN201811032021.6A 2018-09-05 2018-09-05 Data transmission method and device, storage medium and monitoring equipment Active CN109194744B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811032021.6A CN109194744B (en) 2018-09-05 2018-09-05 Data transmission method and device, storage medium and monitoring equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811032021.6A CN109194744B (en) 2018-09-05 2018-09-05 Data transmission method and device, storage medium and monitoring equipment

Publications (2)

Publication Number Publication Date
CN109194744A CN109194744A (en) 2019-01-11
CN109194744B true CN109194744B (en) 2020-11-10

Family

ID=64914652

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811032021.6A Active CN109194744B (en) 2018-09-05 2018-09-05 Data transmission method and device, storage medium and monitoring equipment

Country Status (1)

Country Link
CN (1) CN109194744B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112198818B (en) * 2019-07-08 2022-05-13 浙江宇视科技有限公司 Control method, device and equipment of stepping type driving structure and storage medium
CN110636481B (en) * 2019-08-31 2024-02-09 广州市中海达测绘仪器有限公司 Data interaction method and device applied to server and low-power-consumption equipment
CN111354154B (en) * 2020-03-11 2022-05-17 杭州涂鸦信息技术有限公司 AI detection method based on cloud algorithm
CN113965482B (en) * 2021-10-19 2023-03-24 北京天融信网络安全技术有限公司 Data transmission method and device based on gRPC and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101630993A (en) * 2008-07-18 2010-01-20 深圳市维信联合科技有限公司 Unidirectional transmission control method and unidirectional transmission system without feedback signal wire
CN101799751A (en) * 2009-12-02 2010-08-11 山东浪潮齐鲁软件产业股份有限公司 Method for building monitoring agent software of host machine
CN103036904A (en) * 2012-12-27 2013-04-10 东方通信股份有限公司 Method of data reliable transmission with user datagram protocol (UDP) in communication network
CN103338118A (en) * 2013-06-04 2013-10-02 北京搜狐新媒体信息技术有限公司 A communication network connection method and an apparatus thereof
CN103368814A (en) * 2012-03-27 2013-10-23 北京百度网讯科技有限公司 Data push method, data push system and mobile terminal

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6378057B2 (en) * 2014-11-13 2018-08-22 株式会社東芝 Connection control device, connection control method, connection control system, and computer program

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101630993A (en) * 2008-07-18 2010-01-20 深圳市维信联合科技有限公司 Unidirectional transmission control method and unidirectional transmission system without feedback signal wire
CN101799751A (en) * 2009-12-02 2010-08-11 山东浪潮齐鲁软件产业股份有限公司 Method for building monitoring agent software of host machine
CN103368814A (en) * 2012-03-27 2013-10-23 北京百度网讯科技有限公司 Data push method, data push system and mobile terminal
CN103036904A (en) * 2012-12-27 2013-04-10 东方通信股份有限公司 Method of data reliable transmission with user datagram protocol (UDP) in communication network
CN103338118A (en) * 2013-06-04 2013-10-02 北京搜狐新媒体信息技术有限公司 A communication network connection method and an apparatus thereof

Also Published As

Publication number Publication date
CN109194744A (en) 2019-01-11

Similar Documents

Publication Publication Date Title
CN109194744B (en) Data transmission method and device, storage medium and monitoring equipment
CN106330475B (en) Method and device for managing main and standby nodes in communication system and high-availability cluster
EP3439236B1 (en) Configuration information push method and device
JP2009171265A (en) Supervisory control method and supervisory control device
CN109040295B (en) Method and device for determining abnormal disconnection, terminal and storage medium
CN101826984A (en) Log information processing method and device thereof
CN109788027A (en) Method of data synchronization, device, server and computer storage medium
WO2017206943A1 (en) Optical network terminal and operating method thereof, communication system, and data storage medium
CN103139818A (en) Method, system, area of effect (AOE), always on line (AOG) and terminal of maintaining long connection in acquisition of signal (AOS)
CN112702202A (en) Ammeter communication link fault recovery method and device and computer equipment
CN102035695A (en) Bidirectional forwarding detection method and device
CN106411574B (en) Management control method and device
WO2020078355A1 (en) Device state monitoring method and apparatus
JP6007988B2 (en) Standby system apparatus, operational system apparatus, redundant configuration system, and load distribution method
WO2016065751A1 (en) Method for recovering link communication, service line card and system
CN108737460B (en) Connection processing method and client
US6792558B2 (en) Backup system for operation system in communications system
CN103001832B (en) The detection method of distributed file system interior joint and device
CN112788153B (en) Internet of things equipment upgrading management method, device, equipment and storage medium
CN111064618B (en) Method, device, equipment and storage medium for realizing high availability of server
CN114003379A (en) Method and device for improving data acquisition continuity of Internet of things
JP6196591B2 (en) Backoff control method and backoff control device
KR100712144B1 (en) Apparatus and method for connection management of security system
CN114124275A (en) Time synchronization method, device, equipment and storage medium
EP2631888A1 (en) System and method for real time anti-smash protection of a security system for protecting a property.

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