CN109889775B - Data timeout processing method and device - Google Patents

Data timeout processing method and device Download PDF

Info

Publication number
CN109889775B
CN109889775B CN201811605065.3A CN201811605065A CN109889775B CN 109889775 B CN109889775 B CN 109889775B CN 201811605065 A CN201811605065 A CN 201811605065A CN 109889775 B CN109889775 B CN 109889775B
Authority
CN
China
Prior art keywords
video
video network
data packet
network
client
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
CN201811605065.3A
Other languages
Chinese (zh)
Other versions
CN109889775A (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.)
Hainan Qiantang Shilian Information Technology Co.,Ltd.
Original Assignee
Visionvera Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Visionvera Information Technology Co Ltd filed Critical Visionvera Information Technology Co Ltd
Priority to CN201811605065.3A priority Critical patent/CN109889775B/en
Publication of CN109889775A publication Critical patent/CN109889775A/en
Application granted granted Critical
Publication of CN109889775B publication Critical patent/CN109889775B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the application provides a method and a device for data timeout processing, wherein the method and the device are applied to a video network, the video network comprises a video network server and a plurality of video network clients connected with the video network server based on a video network protocol; the embodiment of the application aims at the same video networking client, after the Nth data packet sent by the video networking client is received, the first timestamp of the Nth data packet is received as a starting point, the first time threshold is used as a period, whether the (N + 1) th data packet carrying the same identification mark is received or not is periodically detected, the overtime record judgment is firstly carried out, and then the disconnection judgment is carried out, so that the connection with the video networking client can be timely disconnected when the video networking client loses contact, the system pressure of a video networking server is released, the video networking client can be prevented from being misjudged, and the data transmission efficiency is influenced by repeated connection with the video networking client.

Description

Data timeout processing method and device
Technical Field
The present application relates to the field of video networking technologies, and in particular, to a data timeout processing method and a data timeout processing apparatus.
Background
The video networking is an important milestone for network development, is a higher-level form of the Internet, is a real-time network, can realize the real-time transmission of full-network high-definition videos which cannot be realized by the existing Internet, and pushes a plurality of Internet applications to high-definition video, and high definition faces each other. Finally, world no-distance is realized, and the distance between people in the world is only the distance of one screen.
With the widespread use of video networking nationwide, the usage demand of video networking servers is continuously expanding. The distributed database framework based on the video network has the main functions of forwarding data transmitted between a video network client and a MySQL database of a relational database management system, the video network client is connected with the MySQL database through the distributed database framework based on the video network, and forwards the data to the database through a data receiving and sending module for data operation, response messages of the database are forwarded to the video network client, and when a network of the video network client and the distributed database framework based on the video network fails, the distributed database framework based on the video network also has a connection thread of the video network client, so that the video network server is easily over-stressed, and the system resource occupation is over-high.
Disclosure of Invention
In view of the above problems, embodiments of the present application are proposed to provide a method for data timeout processing and a corresponding apparatus for data timeout processing, which overcome or at least partially solve the above problems.
In order to solve the above problem, an embodiment of the present application discloses a method for data timeout processing, where the method is applied in a video network, where the video network includes a video network server and a plurality of video network clients connected to the video network server based on a video network protocol, and the method includes:
the video network server sequentially receives N data packets sent by the video network client; wherein, N is a positive integer, and the data packet carries the identification mark of the video network client;
when the video network server receives an Nth data packet, recording a first time stamp of the Nth data packet;
the video network server judges the time difference value between the current timestamp and the first timestamp;
if the time difference is greater than a preset first time threshold, the video network server periodically detects whether an (N + 1) th data packet carrying the same identification mark is received or not by taking the first time threshold as a period;
the video network server carries out one-time overtime recording on the video network client corresponding to the identification mark when the (N + 1) th data packet is not received for each detection;
and when the overtime recording times aiming at the video network client side are larger than a preset time threshold or the time difference value is larger than a preset second time threshold, the video network server is disconnected with the video network client side.
Optionally, the video network further includes a first database connected to a video network client in a network area where the first database is located, and the method further includes:
the N data packets are generated by the first database when a triggering operation of data updating is received; the first database is used for sending the N data packets to the video networking client.
Optionally, before the video networking client is configured to send the data packet to the video networking server, the method further includes:
the video networking client is used for receiving an Internet data packet sent by the first database based on an Internet protocol;
the video networking client is used for converting the Internet data packet into a video networking data packet based on a video networking protocol.
Optionally, the video network further includes a second database connected to the video network server, and the method further includes:
and when receiving the Nth data packet, the video networking server sends the Nth data packet to the second database for storage.
Optionally, the data packet is a standard video networking data packet, and the standard video networking data packet is 1024 bytes.
Optionally, the first time threshold is 1.5-3 seconds.
Optionally, the preset time threshold is 16 times, and the second time threshold is 30 seconds to 60 seconds.
In order to solve the above problem, an embodiment of the present application further discloses a device for data timeout processing, where the device is applied to a video network, the video network includes a video network server and a plurality of video network clients connected to the video network server based on a video network protocol, and the video network server includes the following modules:
the data packet receiving module is used for sequentially receiving N data packets sent by the video network client; wherein, N is a positive integer, and the data packet carries the identification mark of the video network client;
the first timestamp recording module is used for recording a first timestamp of an Nth data packet when the Nth data packet is received;
the time difference value judging module is used for judging the time difference value between the current timestamp and the first timestamp;
the periodic detection module is used for periodically detecting whether an N +1 th data packet carrying the same identification mark is received or not by taking the first time threshold as a period when the time difference value is greater than a preset first time threshold;
the overtime recording module is used for carrying out overtime recording on the video network client corresponding to the identification mark once when the (N + 1) th data packet is not received for each detection;
and the video network client management module is used for disconnecting the video network client when the overtime recording times aiming at the video network client are greater than a preset time threshold or the time difference value is greater than a preset second time threshold.
An embodiment of the present application further provides a device for data timeout processing, including:
one or more processors; and
one or more machine-readable media having instructions stored thereon, which when executed by the one or more processors, cause the apparatus to perform methods as described in embodiments of the present application.
Embodiments of the present application also provide a machine-readable medium having stored thereon instructions, which when executed by one or more processors, cause the processors to perform the method of embodiments of the present application.
The embodiment of the application has the following advantages:
the method and the device apply the characteristics of the video network, after receiving the Nth data packet, the same video network client periodically detects whether the (N + 1) th data packet carrying the same identification mark is received or not by taking the first timestamp of the received Nth data packet as a starting point and the first time threshold as a period, and disconnection judgment is carried out only after the judgment of the overtime record is carried out, so that the connection with the video network client can be timely disconnected when the video network client loses contact, the pressure of a server system is released, and the problem that the video network client is wrongly judged to cause repeated connection with the video network client to influence the data transmission efficiency can be avoided; according to the embodiment of the application, the characteristic of the video network is applied, when a data packet is received, the data packet is forwarded to the second database for storage and backup, and the data packets are forwarded and backed up one by one, so that the problem that the data packet is accumulated in a video network server to occupy the memory of the video network server can be avoided, and the timeliness and the integrity of data backup can be ensured.
Drawings
FIG. 1 is a networking schematic of a video network of the present application;
FIG. 2 is a schematic diagram of a hardware architecture of a node server according to the present application;
fig. 3 is a schematic diagram of a hardware architecture of an access switch of the present application;
fig. 4 is a schematic diagram of a hardware structure of an ethernet protocol conversion gateway according to the present application;
FIG. 5 is a schematic networking diagram of a system for data timeout processing according to an embodiment of the present application;
FIG. 6 is a flowchart illustrating steps of a method for data timeout processing according to an embodiment of the present application;
fig. 7 is a block diagram illustrating a structure of an apparatus for data timeout processing according to an embodiment of the present application.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, the present application is described in further detail with reference to the accompanying drawings and the detailed description.
The video networking is an important milestone for network development, is a real-time network, can realize high-definition video real-time transmission, and pushes a plurality of internet applications to high-definition video, and high-definition faces each other.
The video networking adopts a real-time high-definition video exchange technology, can integrate required services such as dozens of services of video, voice, pictures, characters, communication, data and the like on a system platform on a network platform, such as high-definition video conference, video monitoring, intelligent monitoring analysis, emergency command, digital broadcast television, delayed television, network teaching, live broadcast, VOD on demand, television mail, Personal Video Recorder (PVR), intranet (self-office) channels, intelligent video broadcast control, information distribution and the like, and realizes high-definition quality video broadcast through a television or a computer.
To better understand the embodiments of the present application, the following description refers to the internet of view:
some of the technologies applied in the video networking are as follows:
network Technology (Network Technology)
Network technology innovation in video networking has improved over traditional Ethernet (Ethernet) to face the potentially enormous video traffic on the network. Unlike pure network Packet Switching (Packet Switching) or network circuit Switching (circuit Switching), the Packet Switching is adopted by the technology of the video networking to meet the Streaming requirement. The video networking technology has the advantages of flexibility, simplicity and low price of packet switching, and simultaneously has the quality and safety guarantee of circuit switching, thereby realizing the seamless connection of the whole network switching type virtual circuit and the data format.
Switching Technology (Switching Technology)
The video network adopts two advantages of asynchronism and packet switching of the Ethernet, eliminates the defects of the Ethernet on the premise of full compatibility, has end-to-end seamless connection of the whole network, is directly communicated with a user terminal, and directly bears an IP data packet. The user data does not require any format conversion across the entire network. The video networking is a higher-level form of the Ethernet, is a real-time exchange platform, can realize the real-time transmission of the whole-network large-scale high-definition video which cannot be realized by the existing Internet, and pushes a plurality of network video applications to high-definition and unification.
Server Technology (Server Technology)
The server technology on the video networking and unified video platform is different from the traditional server, the streaming media transmission of the video networking and unified video platform is established on the basis of connection orientation, the data processing capacity of the video networking and unified video platform is independent of flow and communication time, and a single network layer can contain signaling and data transmission. For voice and video services, the complexity of video networking and unified video platform streaming media processing is much simpler than that of data processing, and the efficiency is greatly improved by more than one hundred times compared with that of a traditional server.
Storage Technology (Storage Technology)
The super-high speed storage technology of the unified video platform adopts the most advanced real-time operating system in order to adapt to the media content with super-large capacity and super-large flow, the program information in the server instruction is mapped to the specific hard disk space, the media content is not passed through the server any more, and is directly sent to the user terminal instantly, and the general waiting time of the user is less than 0.2 second. The optimized sector distribution greatly reduces the mechanical motion of the magnetic head track seeking of the hard disk, the resource consumption only accounts for 20% of that of the IP internet of the same grade, but concurrent flow which is 3 times larger than that of the traditional hard disk array is generated, and the comprehensive efficiency is improved by more than 10 times.
Network Security Technology (Network Security Technology)
The structural design of the video network completely eliminates the network security problem troubling the internet structurally by the modes of independent service permission control each time, complete isolation of equipment and user data and the like, generally does not need antivirus programs and firewalls, avoids the attack of hackers and viruses, and provides a structural carefree security network for users.
Service Innovation Technology (Service Innovation Technology)
The unified video platform integrates services and transmission, and is not only automatically connected once whether a single user, a private network user or a network aggregate. The user terminal, the set-top box or the PC are directly connected to the unified video platform to obtain various multimedia video services in various forms. The unified video platform adopts a menu type configuration table mode to replace the traditional complex application programming, can realize complex application by using very few codes, and realizes infinite new service innovation.
Networking of the video network is as follows:
the video network is a centralized control network structure, and the network can be a tree network, a star network, a ring network and the like, but on the basis of the centralized control node, the whole network is controlled by the centralized control node in the network.
As shown in fig. 1, the video network is divided into an access network and a metropolitan network.
The devices of the access network part can be mainly classified into 3 types: node server, access switch, terminal (including various set-top boxes, coding boards, memories, etc.). The node server is connected to an access switch, which may be connected to a plurality of terminals and may be connected to an ethernet network.
The node server is a node which plays a centralized control function in the access network and can control the access switch and the terminal. The node server can be directly connected with the access switch or directly connected with the terminal.
Similarly, devices of the metropolitan network portion may also be classified into 3 types: a metropolitan area server, a node switch and a node server. The metro server is connected to a node switch, which may be connected to a plurality of node servers.
The node server is a node server of the access network part, namely the node server belongs to both the access network part and the metropolitan area network part.
The metropolitan area server is a node which plays a centralized control function in the metropolitan area network and can control a node switch and a node server. The metropolitan area server can be directly connected with the node switch or directly connected with the node server.
Therefore, the whole video network is a network structure with layered centralized control, and the network controlled by the node server and the metropolitan area server can be in various structures such as tree, star and ring.
The access network part can form a unified video platform (the part in the dotted circle), and a plurality of unified video platforms can form a video network; each unified video platform may be interconnected via metropolitan area and wide area video networking.
Video networking device classification
1.1 devices in the video network of the embodiment of the present application can be mainly classified into 3 types: servers, switches (including ethernet gateways), terminals (including various set-top boxes, code boards, memories, etc.). The video network as a whole can be divided into a metropolitan area network (or national network, global network, etc.) and an access network.
1.2 wherein the devices of the access network part can be mainly classified into 3 types: node servers, access switches (including ethernet gateways), terminals (including various set-top boxes, code boards, memories, etc.).
The specific hardware structure of each access network device is as follows:
a node server:
as shown in fig. 2, the system mainly includes a network interface module 201, a switching engine module 202, a CPU module 203, and a disk array module 204;
the network interface module 201, the CPU module 203, and the disk array module 204 all enter the switching engine module 202; the switching engine module 202 performs an operation of looking up the address table 205 on the incoming packet, thereby obtaining the direction information of the packet; and stores the packet in a queue of the corresponding packet buffer 206 based on the packet's steering information; if the queue of the packet buffer 206 is nearly full, it is discarded; the switching engine module 202 polls all packet buffer queues for forwarding if the following conditions are met: 1) the port send buffer is not full; 2) the queue packet counter is greater than zero. The disk array module 204 mainly implements control over the hard disk, including initialization, read-write, and other operations on the hard disk; the CPU module 203 is mainly responsible for protocol processing with an access switch and a terminal (not shown in the figure), configuring an address table 205 (including a downlink protocol packet address table, an uplink protocol packet address table, and a data packet address table), and configuring the disk array module 204.
The access switch:
as shown in fig. 3, the network interface module mainly includes a network interface module (a downlink network interface module 301 and an uplink network interface module 302), a switching engine module 303 and a CPU module 304;
wherein, the packet (uplink data) coming from the downlink network interface module 301 enters the packet detection module 305; the packet detection module 305 detects whether the Destination Address (DA), the Source Address (SA), the packet type, and the packet length of the packet meet the requirements, and if so, allocates a corresponding stream identifier (stream-id) and enters the switching engine module 303, otherwise, discards the stream identifier; the packet (downstream data) coming from the upstream network interface module 302 enters the switching engine module 303; the data packet coming from the CPU module 204 enters the switching engine module 303; the switching engine module 303 performs an operation of looking up the address table 306 on the incoming packet, thereby obtaining the direction information of the packet; if the packet entering the switching engine module 303 is from the downstream network interface to the upstream network interface, the packet is stored in the queue of the corresponding packet buffer 307 in association with the stream-id; if the queue of the packet buffer 307 is nearly full, it is discarded; if the packet entering the switching engine module 303 is not from the downlink network interface to the uplink network interface, the data packet is stored in the queue of the corresponding packet buffer 307 according to the guiding information of the packet; if the queue of the packet buffer 307 is nearly full, it is discarded.
The switching engine module 303 polls all packet buffer queues, which in this embodiment is divided into two cases:
if the queue is from the downlink network interface to the uplink network interface, the following conditions are met for forwarding: 1) the port send buffer is not full; 2) the queued packet counter is greater than zero; 3) obtaining a token generated by a code rate control module;
if the queue is not from the downlink network interface to the uplink network interface, the following conditions are met for forwarding: 1) the port send buffer is not full; 2) the queue packet counter is greater than zero.
The rate control module 208 is configured by the CPU module 204, and generates tokens for packet buffer queues from all downstream network interfaces to upstream network interfaces at programmable intervals to control the rate of upstream forwarding.
The CPU module 304 is mainly responsible for protocol processing with the node server, configuration of the address table 306, and configuration of the code rate control module 308.
Ethernet protocol conversion gateway
As shown in fig. 4, the apparatus mainly includes a network interface module (a downlink network interface module 401 and an uplink network interface module 402), a switching engine module 403, a CPU module 404, a packet detection module 405, a rate control module 408, an address table 406, a packet buffer 407, a MAC adding module 409, and a MAC deleting module 410.
Wherein, the data packet coming from the downlink network interface module 401 enters the packet detection module 405; the packet detection module 405 detects whether the ethernet MAC DA, the ethernet MAC SA, the ethernet length or frame type, the video network destination address DA, the video network source address SA, the video network packet type, and the packet length of the packet meet the requirements, and if so, allocates a corresponding stream identifier (stream-id); then, the MAC deletion module 410 subtracts MAC DA, MAC SA, length or frame type (2 byte) and enters the corresponding receiving buffer, otherwise, discards it;
the downlink network interface module 401 detects the sending buffer of the port, and if there is a packet, obtains the ethernet MAC DA of the corresponding terminal according to the destination address DA of the packet, adds the ethernet MAC DA of the terminal, the MAC SA of the ethernet protocol gateway, and the ethernet length or frame type, and sends the packet.
The other modules in the ethernet protocol gateway function similarly to the access switch.
A terminal:
the system mainly comprises a network interface module, a service processing module and a CPU module; for example, the set-top box mainly comprises a network interface module, a video and audio coding and decoding engine module and a CPU module; the coding board mainly comprises a network interface module, a video and audio coding engine module and a CPU module; the memory mainly comprises a network interface module, a CPU module and a disk array module.
1.3 devices of the metropolitan area network part can be mainly classified into 2 types: node server, node exchanger, metropolitan area server. The node switch mainly comprises a network interface module, a switching engine module and a CPU module; the metropolitan area server mainly comprises a network interface module, a switching engine module and a CPU module.
2. Video networking packet definition
2.1 Access network packet definition
The data packet of the access network mainly comprises the following parts: destination Address (DA), Source Address (SA), reserved byte, Payload (PDU), CRC.
As shown in the following table, the data packet of the access network mainly includes the following parts:
DA SA Reserved Payload CRC
wherein:
the Destination Address (DA) is composed of 8 bytes (byte), the first byte represents the type of the data packet (such as various protocol packets, multicast data packets, unicast data packets, etc.), there are 256 possibilities at most, the second byte to the sixth byte are metropolitan area network addresses, and the seventh byte and the eighth byte are access network addresses;
the Source Address (SA) is also composed of 8 bytes (byte), defined as the same as the Destination Address (DA);
the reserved byte consists of 2 bytes;
the payload part has different lengths according to the types of different datagrams, and is 64 bytes if the datagram is various protocols, and is 32 + 1024 = 1056 bytes if the datagram is a unicast datagram, and is of course not limited to the above 2 types;
the CRC consists of 4 bytes and is calculated in accordance with the standard ethernet CRC algorithm.
2.2 metropolitan area network packet definition
The topology of a metropolitan area network is a graph and there may be 2, or even more than 2, connections between two devices, i.e., there may be more than 2 connections between a node switch and a node server, a node switch and a node switch, and a node switch and a node server. However, the metro network address of the metro network device is unique, and in order to accurately describe the connection relationship between the metro network devices, parameters are introduced in the embodiment of the present application: a label to uniquely describe a metropolitan area network device.
In this specification, the definition of the Label is similar to that of the Label of MPLS (Multi-Protocol Label Switch), and assuming that there are two connections between the device a and the device B, there are 2 labels for the packet from the device a to the device B, and 2 labels for the packet from the device B to the device a. The label is classified into an incoming label and an outgoing label, and assuming that the label (incoming label) of the packet entering the device a is 0x0000, the label (outgoing label) of the packet leaving the device a may become 0x 0001. The network access process of the metro network is a network access process under centralized control, that is, address allocation and label allocation of the metro network are both dominated by the metro server, and the node switch and the node server are both passively executed, which is different from label allocation of MPLS, and label allocation of MPLS is a result of mutual negotiation between the switch and the server.
As shown in the following table, the data packet of the metro network mainly includes the following parts:
DA SA Reserved label (R) Payload CRC
Namely Destination Address (DA), Source Address (SA), Reserved byte (Reserved), tag, Payload (PDU), CRC. The format of the tag may be defined by reference to the following: the tag is 32 bits with the upper 16 bits reserved and only the lower 16 bits used, and its position is between the reserved bytes and payload of the packet.
Based on the characteristics of the video network, one of the core concepts of the embodiment of the application is provided, the protocol of the video network is followed, after the nth data packet is received, the first time threshold value is taken as a period, whether the (N + 1) th data packet carrying the same identification mark is received or not is periodically detected, the overtime record judgment is firstly carried out, and then the disconnection judgment is carried out, so that the connection with the video network client can be timely disconnected when the video network client loses contact, the pressure of a server system is released, and the condition that the video network client is wrongly judged to cause repeated connection with the video network client to influence the data transmission efficiency can be avoided.
Example 1:
as shown in fig. 5, a networking schematic diagram of a system for data timeout processing according to an embodiment of the present application is shown, where the system may be applied to a video network, where the video network includes a video network server 01, and a plurality of video network clients 02 connected to the video network server 01 based on a video network protocol.
The video network server 01 mentioned in the embodiment of the present application can also be regarded as a video network-based distributed database framework, which is distributed in various areas of the whole video network, and 255 video network servers 01 can be accessed in the whole video network at most. Each video network server 01 manages a plurality of video network clients 02 in the video network area, for example, a network entry table of the managed video network clients 02 can be maintained in the video network server 01, the network entry table records the number, name, addressing address and the like of the video network clients 02, and the video network server 01 only controls and schedules the video network clients 02 configured for network entry.
The video networking client 02 can be regarded as a video networking host, which can be a software and hardware device integrating the functions of video networking audio, video stream decoding and the like; or a software and hardware device supporting data communication of dual networks (video networking, internet). The video network terminal can access the video network (the video network server 01 in the affiliated video network) through the video network number, and communicate with other video network hosts and the like.
Example 2:
as shown in fig. 6, a flowchart of steps of a method for data timeout processing according to an embodiment of the present application is shown, where the method may be applied to a video network, and in particular, may be applied to the video network server 01 shown in fig. 5, and the method may specifically include the following steps:
step S601: the video network server sequentially receives N data packets sent by the video network client; wherein, N is a positive integer, and the data packet carries the identification mark of the video network client;
the data mentioned in the embodiment of the present application may be generated by the internet-of-things client 02 according to the received trigger operation, or may be data of other sources forwarded.
For example, in an optional embodiment of the present application, a data source method is provided, where the video network further includes a first database 03 connected to a video network client 02 in a network area where the first database is located, and the method may further include the following steps:
the N data packets are generated by the first database 03 when a trigger operation for data update is received; the first database 03 is configured to send the N data packets to the video networking client 02. The first database 03 may be a MySQL database connected to the video network client 02.
Since the first database 03 is located in the internet, before the video network client 02 is configured to send the data packet to the video network server 01, the method specifically includes the following steps:
the video networking client 02 is configured to receive an internet data packet sent by the first database 03 based on an internet protocol;
the video networking client 02 is configured to convert the internet data packet into a video networking data packet based on a video networking protocol.
The process of converting the internet data packet into the video networking data packet specifically comprises the following steps: firstly, disassembling a packet header and content of a data packet, removing an internet protocol in the packet header, then adding a video networking protocol into the packet header, and re-encapsulating the data packet to form a video networking data packet.
According to the current level of the video network, about 60000 video network clients 02 can be accessed to one video network server 01, so when the video network clients 02 send data packets to the video network server 01, each data packet carries an identification identifier of the video network client 02, so that the video network server 01 identifies the received data packet and records a data source. The identification mark may be a MAC address of the video network client 02 or an account of a registered video network user.
In addition, since the data transmission is performed in the form of a data stream after being decomposed into a plurality of data packets, the data packets in the embodiment of the present application may preferably be standard video networking data packets, and the standard video networking data packets are 1024 bytes, so as to better adapt to the transmission parsing speed of the video networking.
Step S602: when the video network server receives an Nth data packet, recording a first time stamp of the Nth data packet;
since the video network client 02 transmits the data packets to the video network server 01 in the form of a data stream one by one, and the video network server 01 receives the data packets one by one, the receiving time stamp of each data packet is recorded when the data packet is received.
Step S603: the video network server judges the time difference value between the current timestamp and the first timestamp;
step S604: if the time difference is greater than a preset first time threshold, the video network server periodically detects whether an (N + 1) th data packet carrying the same identification mark is received or not by taking the first time threshold as a period;
step S605: the video network server carries out one-time overtime recording on the video network client corresponding to the identification mark when the (N + 1) th data packet is not received for each detection;
step S606: and when the overtime recording times aiming at the video network client side are larger than a preset time threshold or the time difference value is larger than a preset second time threshold, the video network server is disconnected with the video network client side.
An overtime judging module is arranged in the video network server 01, a timer is arranged in the overtime judging module, and the timer/timer runs like a normal clock and displays the current timestamp at every moment.
Since the video network server 01 may receive the data packets sent by the multiple video network clients 02 at the same time, the data source of the data packets can be determined by identifying the identifier. For the same video network client 02, after receiving the nth (N may be 1, 2, 3 … N) data packet sent by the video network client, the video network server 01 records the receiving timestamp (first timestamp) of the data packet, calculates the time difference between the current timestamp and the first timestamp (it may be understood that, starting from the first timestamp, the timer starts from 0, the longer the time, the larger the value counted on the timer, and the larger the time difference), determines whether the time difference is greater than a preset first time threshold (it may be determined whether the time difference is greater than the preset first time threshold once the timer records once, or increases a value), if the difference exceeds a preset timeout interval (first time threshold), the N +1 th data packet sent by the video network client is not received at this time, the timeout event is considered to occur, the video network client 02 corresponding to the identification mark is subjected to one timeout record, and the video network client 02 is preliminarily judged to be in an unstable data transmission state.
Next, the timer still keeps timing (i.e. starts timing from the first timestamp), and then periodically detects whether the N +1 th data packet carrying the same identifier is received with the first time threshold as a period. For example, after a first period, if the (N + 1) th data packet is not received, performing a first timeout record on the video network client 02; after a second period, if the (N + 1) th packet has not been received, a second timeout … … is recorded for the video network client 02
If the timeout record for the video network client 02 is greater than the preset time threshold or the time difference value is greater than the preset second time threshold (the second time threshold is greater than the first time threshold), it can be determined that the video network client 02 has a fault or the network connected with the video network client 02 has a fault, at this time, the video network server 01 actively disconnects the video network client 02, stops forwarding data to the video network client 02, and releases the resources occupied by the connection, so that the problems of excessive pressure of the video network server 01 and excessive system resource occupation can be solved.
For steps S603 to S606 in the embodiment of the present application, a specific example is further described:
the first time threshold value is 2 seconds, the second time threshold value is 30 seconds, and the preset time threshold value is 16 times;
the time stamp of the 1 st data packet received by the video network server 01 is 9:00, at this time, the timer starts to time from 0, the timer is set to take seconds as a display unit, take milliseconds as a timing unit, when the timer displays 1.000 seconds, the time difference value between the time and the first time stamp is 1 second, the 2 nd data packet is not received, the time difference value is also smaller than the first time threshold value, and no processing is performed; when the timer shows 2.000 seconds, the time difference value between the timer and the first timestamp is 2 seconds, the 2 nd data packet is not received, the time difference value is equal to the first time threshold value, and no processing is performed; however, when the time of the timer is 2.001 seconds, the time difference value between the time of the timer and the first timestamp is 2.001 seconds, the 2 nd data packet is not received, the time difference value is greater than the first time threshold, and the video networking client 02 corresponding to the identification mark is subjected to one-time timeout recording. Next, every two seconds, the internet of view server 01 detects whether the 2 nd packet is received. When the number of detection cycles is 15, that is, the number of timeout records for the video network client 01 is 15, the time difference is already 30 seconds, so at 30.001 seconds, when the 2 nd packet is not received, the video network server 01 will actively disconnect from the video network client 02.
In an optional embodiment of the present application, the first time threshold is set to be 1.5 to 3 seconds. Therefore, the problem that the timeout record misjudgment is caused to the video network client 02 due to the fact that the timeout interval time is set to be too short can be avoided; and the failure of the stability detection of the network connected with the video network client 02 due to the overlong interval time can be avoided.
Meanwhile, in another optional embodiment of the present application, the preset time threshold is set to 16 times, and the second time threshold is set to 30 seconds to 60 seconds. Setting the threshold value to be higher than 30 seconds can better judge whether the network connected with the video network client-side 02 is normal or not, and avoid the blind disconnection of the network connected with the video network client-side 02; the threshold is set to be lower than 60 seconds, so that the phenomenon that the video network server 01 is occupied by the connection with the video network client 02 for too long time is avoided, namely, the phenomenon that the system resources and the running memory of the video network server 01 are occupied for too long time is avoided.
The video network further comprises a second database 04 connected with the video network server 01, and if the communication between the video network server 01 and the video network client 02 is normal, the video network server 01 forwards the data packet to the second database 04 for storage after receiving the data packet, and in a preferred embodiment, the specific forwarding manner may be:
step S607: when receiving the nth data packet, the video networking server 01 sends the nth data packet to the second database 04 for storage.
The above preferred embodiment shows a forwarding manner of the data packet, and when receiving a data packet, the video network server 01 forwards the data packet to the second database 04 for storage and backup, so that the problem that the data packet is accumulated in the video network server 01 and occupies the memory of the video network server 01 can be avoided, and the integrity of the data backup can be ensured. The second database 03 is also a MySQL database connected to the video network client 02.
In the embodiment of the present application, through steps S601 to S606, a possible way of data timeout processing is described from the perspective of the video network server 01: for the same video network client 02, after receiving the nth data packet, with the first time threshold as a period, periodically detecting whether the (N + 1) th data packet carrying the same identification mark is received, firstly performing timeout recording judgment, and then performing disconnection judgment, so that the video network client 02 can be disconnected in time when losing contact, the pressure of a server system is released, and the problem that the video network client 02 is mistakenly judged to cause repeated connection with the video network client 02 to influence data transmission efficiency can be avoided.
The data timeout processing mechanism of the embodiment of the application is different from the traditional heartbeat monitoring mechanism, a heartbeat monitoring thread does not need to be established independently, a heartbeat packet or a heartbeat frame is sent or received to carry out heartbeat monitoring on the video networking client 02, occupation of the heartbeat packet data on the memory space of the video networking server 01 can be reduced, and the operating pressure of the video networking server 01 is reduced.
Meanwhile, compared with the traditional data transmission mechanism UDT, the data timeout processing mechanism of the embodiment of the application utilizes the principle of the UDT, not only overcomes the problem that the UDT protocol cannot be used for transmitting data in the video network at present, but also utilizes the data transmission security of the video network to make up the problem that the data transmission security of the UDT protocol is poor and is easy to steal by others.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the embodiments are not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the embodiments. Further, those skilled in the art will also appreciate that the embodiments described in the specification are presently preferred and that no particular act is required of the embodiments of the application.
Example 3:
as shown in fig. 7, corresponding to the method described in embodiment 2, a block diagram of a device for data timeout processing according to an embodiment of the present application is shown, where the device may be applied to a video network, and in particular, may be applied to the video network server 01 shown in fig. 5, and the video network server 01 may specifically include the following modules:
a data packet receiving module 701, configured to sequentially receive N data packets sent by a video networking client; wherein, N is a positive integer, and the data packet carries the identification mark of the video network client;
a first timestamp recording module 702, configured to record a first timestamp of an nth data packet when the nth data packet is received;
a time difference value determining module 703, configured to determine a time difference value between the current timestamp and the first timestamp;
a periodic detection module 704, configured to, when the time difference is greater than a preset first time threshold, periodically detect whether an (N + 1) th data packet carrying the same identifier is received with the first time threshold as a period;
the timeout recording module 705 is configured to perform, for each detection, once timeout recording on the video network client corresponding to the identification identifier when the (N + 1) th data packet is not received;
the video network client management module 706 is configured to disconnect the video network client when the timeout recording time for the video network client is greater than a preset time threshold or the time difference value is greater than a preset second time threshold.
In accordance with a preferred embodiment of the present application, the video network further includes a second database 04 connected to the video network server 01, and the video network server 01 may further include the following modules:
and the packet forwarding module 707 is configured to, when receiving the nth packet, send the nth packet to the second database 04 for storage.
An embodiment of the present application further provides an apparatus, including:
one or more processors; and
one or more machine-readable media having instructions stored thereon, which when executed by the one or more processors, cause the apparatus to perform one or more of the methods of embodiments of the present application.
Embodiments of the present application also provide one or more machine-readable media having instructions stored thereon, which when executed by one or more processors, cause the processors to perform one or more of the methods described in embodiments of the present application.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one of skill in the art, embodiments of the present application may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present application have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including the preferred embodiment and all such alterations and modifications as fall within the true scope of the embodiments of the application.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The above detailed description is provided for a data timeout processing method and a data timeout processing apparatus, and a specific example is applied in this document to explain the principle and implementation of the present application, and the description of the above embodiment is only used to help understand the method and core ideas of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, 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 application.

Claims (10)

1. A method for data timeout processing, wherein the method is applied to an Internet of vision network, the Internet of vision network comprises an Internet of vision network server, and a plurality of Internet of vision network clients connected with the Internet of vision network server based on an Internet of vision network protocol, the method comprises the following steps:
the video network server sequentially receives N data packets sent by the video network client; wherein, N is a positive integer, and the data packet carries the identification mark of the video network client;
when the video network server receives an Nth data packet, recording a first time stamp of the Nth data packet;
the video network server judges the time difference value between the current timestamp and the first timestamp;
if the time difference is greater than a preset first time threshold, the video network server periodically detects whether an (N + 1) th data packet carrying the same identification mark is received or not by taking the first time threshold as a period;
the video network server carries out one-time overtime recording on the video network client corresponding to the identification mark when the (N + 1) th data packet is not received for each detection;
and when the overtime recording times aiming at the video network client side are larger than a preset time threshold or the time difference value is larger than a preset second time threshold, the video network server is disconnected with the video network client side.
2. The method of claim 1, wherein the video network further comprises a first database connected to video network clients in the network area where the first database is located, and wherein the method further comprises:
the N data packets are generated by the first database when a triggering operation of data updating is received; the first database is used for sending the N data packets to the video networking client.
3. The method of claim 2, wherein before the video networking client sends the data packet to a video networking server, the method further comprises:
the video networking client is used for receiving an Internet data packet sent by the first database based on an Internet protocol;
the video networking client is used for converting the Internet data packet into a video networking data packet based on a video networking protocol.
4. The method of claim 1, wherein the video network further comprises a second database connected to the video network server, the method further comprising:
and when receiving the Nth data packet, the video networking server sends the Nth data packet to the second database for storage.
5. The method of claim 1, wherein the data packet is a standard video networking data packet, and wherein the standard video networking data packet is 1024 bytes.
6. The method of claim 1, wherein the first time threshold is 1.5-3 seconds.
7. The method according to claim 1, wherein the preset number threshold is 16, and the second time threshold is 30-60 seconds.
8. An apparatus for data timeout processing, wherein the apparatus is applied to a video network, the video network includes a video network server, a plurality of video network clients connected to the video network server based on a video network protocol, and the video network server includes the following modules:
the data packet receiving module is used for sequentially receiving N data packets sent by the video network client; wherein, N is a positive integer, and the data packet carries the identification mark of the video network client;
the first timestamp recording module is used for recording a first timestamp of an Nth data packet when the Nth data packet is received;
the time difference value judging module is used for judging the time difference value between the current timestamp and the first timestamp;
the periodic detection module is used for periodically detecting whether an N +1 th data packet carrying the same identification mark is received or not by taking the first time threshold as a period when the time difference value is greater than a preset first time threshold;
the overtime recording module is used for carrying out overtime recording on the video network client corresponding to the identification mark once when the (N + 1) th data packet is not received for each detection;
and the video network client management module is used for disconnecting the video network client when the overtime recording times aiming at the video network client are greater than a preset time threshold or the time difference value is greater than a preset second time threshold.
9. An apparatus for data timeout processing, comprising:
one or more processors; and
one or more machine-readable media having instructions stored thereon that, when executed by the one or more processors, cause the apparatus to perform the method of any of claims 1-7.
10. A machine-readable medium having stored thereon instructions, which when executed by one or more processors, cause the processors to perform the method of any one of claims 1-7.
CN201811605065.3A 2018-12-26 2018-12-26 Data timeout processing method and device Active CN109889775B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811605065.3A CN109889775B (en) 2018-12-26 2018-12-26 Data timeout processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811605065.3A CN109889775B (en) 2018-12-26 2018-12-26 Data timeout processing method and device

Publications (2)

Publication Number Publication Date
CN109889775A CN109889775A (en) 2019-06-14
CN109889775B true CN109889775B (en) 2020-09-18

Family

ID=66925272

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811605065.3A Active CN109889775B (en) 2018-12-26 2018-12-26 Data timeout processing method and device

Country Status (1)

Country Link
CN (1) CN109889775B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111371639B (en) * 2020-02-21 2021-12-14 腾讯科技(深圳)有限公司 Network delay analysis method and device, storage medium and computer equipment
CN112711483A (en) * 2020-12-10 2021-04-27 广州广电运通金融电子股份有限公司 High-concurrency method, system and equipment for processing big data annotation service
CN115599330B (en) * 2022-09-28 2023-08-01 北京亚控科技发展有限公司 Fault diagnosis method and related device of data acquisition system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103795554A (en) * 2012-10-29 2014-05-14 华为技术有限公司 Terminal state managing method, device and system
CN105635248A (en) * 2015-12-18 2016-06-01 Tcl集团股份有限公司 Method and system for releasing TCP (Transmission Control Protocol) connection resources
EP3070922A1 (en) * 2005-12-08 2016-09-21 Vidyo, Inc. Systems and methods for error resilience and random access in video communication systems

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102284451B1 (en) * 2014-11-17 2021-08-02 삼성전자 주식회사 Method and apparatus for controlling operation of a access point in a wireless communication system
CN106533845A (en) * 2016-12-27 2017-03-22 海尔优家智能科技(北京)有限公司 Long-connection state monitoring method and device
CN108712462A (en) * 2018-04-09 2018-10-26 阿里巴巴集团控股有限公司 A kind of connection method for building up, device and equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3070922A1 (en) * 2005-12-08 2016-09-21 Vidyo, Inc. Systems and methods for error resilience and random access in video communication systems
CN103795554A (en) * 2012-10-29 2014-05-14 华为技术有限公司 Terminal state managing method, device and system
CN105635248A (en) * 2015-12-18 2016-06-01 Tcl集团股份有限公司 Method and system for releasing TCP (Transmission Control Protocol) connection resources

Also Published As

Publication number Publication date
CN109889775A (en) 2019-06-14

Similar Documents

Publication Publication Date Title
CN109617956B (en) Data processing method and device
CN109257253B (en) APP operation monitoring method and device
CN109587002B (en) State detection method and system for video network monitoring equipment
CN109379254B (en) Network connection detection method and system based on video conference
CN109561072B (en) Link detection method and system
CN108965220B (en) Method and system for synchronizing conference control right
CN109729388B (en) Method and device for switching video networking servers
CN109819062B (en) Method and device for accessing network by using virtual MAC address
CN109889775B (en) Data timeout processing method and device
CN110224988B (en) Image data processing method, system and device and storage medium
CN109714568B (en) Video monitoring data synchronization method and device
CN109743284B (en) Video processing method and system based on video network
CN109698953B (en) State detection method and system for video network monitoring equipment
CN110401876B (en) Audio and video asynchronous warning method and device, electronic equipment and readable storage medium
CN109861929B (en) Data caching processing method and device
CN111510341A (en) Network testing method and device for video network
CN110691213B (en) Alarm method and device
CN111447407A (en) Monitoring resource transmission method and device
CN110677315A (en) Method and system for monitoring state
CN110213533B (en) Method and device for acquiring video stream monitored by video network
CN110166363B (en) Multicast link monitoring method and device
CN110784683B (en) Management method, device and storage medium for monitoring resources
CN109688073B (en) Data processing method and system based on video network
CN110365930B (en) Data processing method and device
CN110691214B (en) Data processing method and device for business object

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

Effective date of registration: 20201230

Address after: 570105 room 1201, Central International Plaza, 77 Binhai street, Longhua District, Haikou City, Hainan Province

Patentee after: Hainan Qiantang Shilian Information Technology Co.,Ltd.

Address before: 100000 Beijing Dongcheng District Qinglong Hutong 1 Song Hua Building A1103-1113

Patentee before: VISIONVERA INFORMATION TECHNOLOGY Co.,Ltd.