CN109889775A - A kind of method and apparatus of data timeout treatment - Google Patents

A kind of method and apparatus of data timeout treatment Download PDF

Info

Publication number
CN109889775A
CN109889775A CN201811605065.3A CN201811605065A CN109889775A CN 109889775 A CN109889775 A CN 109889775A CN 201811605065 A CN201811605065 A CN 201811605065A CN 109889775 A CN109889775 A CN 109889775A
Authority
CN
China
Prior art keywords
depending
data packet
time
view
networking
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.)
Granted
Application number
CN201811605065.3A
Other languages
Chinese (zh)
Other versions
CN109889775B (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

Abstract

The embodiment of the present application provides a kind of method and apparatus of data timeout treatment, and the method and device are applied in view networking, and the view networking includes regarding networked server, with it is described depending on networked server based on the multiple view networked clients being connect depending on networking protocol;The embodiment of the present application is directed to same view networked clients, after the n-th data packet for receiving view networked clients transmission, it is stabbed with receiving the first time of n-th data packet as starting point, using the first time threshold as the period, it periodically detects and whether receives the N+1 data packet for carrying same identification marking, first carry out time-out record judgement, connection judgment is just turned off afterwards, so both connection can be disconnected in time when this is out of touch depending on networked clients, the system pressure of release view networked server, it also can avoid that this is caused to judge by accident depending on networked clients, cause to repeat to connect with this depending on networked clients to influence data transmission efficiency.

Description

A kind of method and apparatus of data timeout treatment
Technical field
This application involves view networking technology fields, and the method and a kind of data more particularly to a kind of data timeout treatment are super When the device that handles.
Background technique
It is the important milestone of network Development depending on networking, is the more advanced form of internet, is a real-time network, it can It realizes the whole network HD video real-time Transmission that current internet cannot achieve, pushes numerous Internet applications to HD video, High definition is face-to-face.It will finally realize that the world without distance, realizes that the distance of person to person in global range is the distance of a screen.
As view networking is in nationwide extensive use, the use demand amount depending on networked server is constantly expanding. It is forwarding view networked clients and Relational DBMS based on the distributed data base frame major function depending on networking The data transmitted between MySQL database pass through in the distributed data base frame connection based on view networking depending on networked clients MySQL database, and database is forwarded the data to by data receiver sending module and carries out data manipulation, by the sound of database Message is answered to be transmitted to view networked clients, when view networked clients and the network of the distributed data base frame based on view networking are sent out When raw failure, the connection thread of the view networked clients is had, also based on the distributed data base frame depending on networking with this It is easy to cause view networked server pressure excessive, system resource occupies excessively high.
Summary of the invention
In view of the above problems, it proposes the embodiment of the present application and overcomes the above problem or at least partly in order to provide one kind A kind of method of the data timeout treatment to solve the above problems and a kind of corresponding device of data timeout treatment.
To solve the above-mentioned problems, the embodiment of the present application discloses a kind of method of data timeout treatment, and the method is answered For regarding in networking, the view networking includes view networked server, is based on connecting depending on networking protocol depending on networked server with described Multiple view networked clients, which comprises
The view networked server successively receives N number of data packet that view networked clients are sent;Wherein, N is positive integer, institute State the identification marking that data packet carries the view networked clients;
It is described depending on networked server when receiving n-th data packet, record the first time of the n-th data packet Stamp;
The view networked server judges the time difference of current time stamp and first time stamp;
If the time difference is greater than preset first time threshold, the view networked server is with the first time Threshold value is the period, periodically detects and whether receives the N+1 data packet for carrying same identification marking;
The view networked server, will be with the knowledge when not receiving the N+1 data packet for detection every time Corresponding view networked clients are not identified carries out primary time-out record;
When the time-out record number for the view networked clients is big greater than preset times threshold value or the time difference It is described to be disconnected with described depending on networked clients depending on networked server in preset second time threshold.
Optionally, described to further include and the first data of network area where itself being connect depending on networked clients depending on networking Library, the method also includes:
N number of data packet is by first database generation when receiving the trigger action of data update;Described One database is used to N number of data packet being sent to the view networked clients.
Optionally, it is described depending on networked clients be used for by the data packet be sent to view networked server before, the method Further include:
It is described to be used to receive the internet data that the first database internet protocol-based is sent depending on networked clients Packet;
It is described to be used to be based on depending on networked clients that the internet data packet to be converted to view networking data depending on networking protocol Packet.
Optionally, it is described depending on networking further include with second database being connect depending on networked server, the method is also Include:
It is described depending on networked server when receiving n-th data packet, the n-th data packet is sent to described second It is stored in database.
Optionally, the data packet is that standard regards networking data packet, and the standard regards networking data packet as 1024 bytes.
Optionally, the first time threshold is 1.5~3 seconds.
Optionally, the preset times threshold value is 16 times, and the second time threshold is 30 seconds~60 seconds.
To solve the above-mentioned problems, the embodiment of the present application also discloses a kind of device of data timeout treatment, described device Applied in view networking, the view networking includes view networked server, is based on view networking protocol with the view networked server and connects The multiple view networked clients connect, described to be comprised the following modules depending on networked server:
Packet-receiving module, the N number of data packet sent for successively receiving view networked clients;Wherein, N is positive whole Number, the data packet carry the identification marking of the view networked clients;
Stamp logging modle at the first time, for when receiving n-th data packet, recording the of the n-th data packet One timestamp;
Time difference judgment module, for judging the time difference of current time stamp and first time stamp;
Periodicity detection module, for when the time difference is greater than preset first time threshold, then with described the One time threshold is the period, periodically detects and whether receives the N+1 data packet for carrying same identification marking;
Overtime logging modle, for for every time detection, when not receiving the N+1 data packet, will with it is described The corresponding view networked clients of identification marking carry out primary time-out record;
It is default for being greater than in the time-out record number for the view networked clients depending on networked clients management module When frequency threshold value or the time difference are greater than preset second time threshold, disconnected with described depending on networked clients.
The embodiment of the present application also provides a kind of devices, comprising:
One or more processors;With
One or more machine readable medias of instruction are stored thereon with, are executed when by one or more of processors When, so that the method that described device executes one or more described in the embodiment of the present application.
The embodiment of the present application also provides one or more machine readable medias, are stored thereon with instruction, when by one or When multiple processors execute, so that the method that the processor executes one or more described in the embodiment of the present application.
The embodiment of the present application includes the following advantages:
The characteristic of the embodiment of the present application application view networking is receiving n-th data packet for same view networked clients Afterwards, it is stabbed with the first time for receiving n-th data packet as starting point, using the first time threshold as the period, is periodically detected Whether receive the N+1 data packet for carrying same identification marking, first carry out time-out record judgement, after the just company of turning off Judgement is connect, can both disconnect in time connection when this is out of touch depending on networked clients in this way, discharges server system pressure Power also can avoid causing to judge by accident depending on networked clients to this, cause to repeat to connect with this depending on networked clients to influence data transmission Efficiency;
The characteristic of the embodiment of the present application application view networking, is just forwarded to for the data packet when receiving a data packet Data packet, is forwarded the mode of backup, avoidable data packet is deposited in view networked server by the backup of two database purchases one by one The problem of interior its memory of occupancy, while can guarantee the timeliness and integrality of data backup.
Detailed description of the invention
Fig. 1 is a kind of networking schematic diagram of view networking of the application;
Fig. 2 is a kind of hardware structural diagram of node server of the application;
Fig. 3 is a kind of hardware structural diagram of access switch of the application;
Fig. 4 is that a kind of Ethernet association of the application turns the hardware structural diagram of gateway;
Fig. 5 is a kind of networking schematic diagram of the system of data timeout treatment of the embodiment of the present application;
Fig. 6 is a kind of step flow chart of the method for data timeout treatment of the embodiment of the present application;
Fig. 7 is a kind of structural block diagram of the device of data timeout treatment of the embodiment of the present application.
Specific embodiment
In order to make the above objects, features, and advantages of the present application more apparent, with reference to the accompanying drawing and it is specific real Applying mode, the present application will be further described in detail.
It is the important milestone of network Development depending on networking, is a real-time network, can be realized HD video real-time Transmission, Push numerous Internet applications to HD video, high definition is face-to-face.
Real-time high-definition video switching technology is used depending on networking, it can be such as high in a network platform by required service Clear video conference, Intellectualized monitoring analysis, emergency command, digital broadcast television, delay TV, the Web-based instruction, shows video monitoring Field live streaming, VOD program request, TV Mail, individual character records (PVR), Intranet (manages) channel by oneself, intelligent video Broadcast Control, information publication All be incorporated into a system platform etc. services such as tens of kinds of videos, voice, picture, text, communication, data, by TV or Computer realizes that high-definition quality video plays.
To make those skilled in the art more fully understand the embodiment of the present application, it is introduced below to depending on networking:
Depending on networking, applied portion of techniques is as described below:
Network technology (Network Technology)
Traditional ethernet (Ethernet) is improved depending on the network technology innovation networked, with potential huge on network Video flow.(Circuit is exchanged different from simple network packet packet switch (Packet Switching) or lattice network Switching), Streaming demand is met using Packet Switching depending on networking technology.Has grouping depending on networking technology Flexible, the simple and low price of exchange, is provided simultaneously with the quality and safety assurance of circuit switching, it is virtually electric to realize the whole network switch type The seamless connection of road and data format.
Switching technology (Switching Technology)
Two advantages of asynchronous and packet switch that Ethernet is used depending on networking eliminate Ethernet under the premise of complete compatible and lack It falls into, has the end-to-end seamless connection of the whole network, direct user terminal, directly carrying IP data packet.User data is in network-wide basis It is not required to any format conversion.It is the more advanced form of Ethernet depending on networking, is a real-time exchange platform, can be realized at present mutually The whole network large-scale high-definition realtime video transmission that networking cannot achieve pushes numerous network video applications to high Qinghua, unitizes.
Server technology (Server Technology)
It is different from traditional server, its Streaming Media depending on the server technology in networking and unified video platform Transmission be built upon it is connection-oriented on the basis of, data-handling capacity is unrelated with flow, communication time, single network layer energy Enough transmitted comprising signaling and data.For voice and video business, handled depending on networking and unified video platform Streaming Media Complexity many simpler than data processing, efficiency substantially increase hundred times or more than traditional server.
Reservoir technology (Storage Technology)
The ultrahigh speed reservoir technology of unified video platform in order to adapt to the media content of vast capacity and super-flow and Using state-of-the-art real time operating system, the programme information in server instruction is mapped to specific hard drive space, media Content is no longer pass through server, and moment is directly delivered to user terminal, and user waits typical time less than 0.2 second.It optimizes Sector distribution greatly reduces the mechanical movement of hard disc magnetic head tracking, and resource consumption only accounts for the 20% of the internet ad eundem IP, but The concurrent flow greater than 3 times of traditional disk array is generated, overall efficiency promotes 10 times or more.
Network security technology (Network Security Technology)
Depending on the structural design networked by servicing independent licence system, equipment and the modes such as user data is completely isolated every time The network security problem that puzzlement internet has thoroughly been eradicated from structure, does not need antivirus applet, firewall generally, has prevented black The attack of visitor and virus, structural carefree secure network is provided for user.
It services innovative technology (Service Innovation Technology)
Business and transmission are fused together by unified video platform, whether single user, private user or a net The sum total of network is all only primary automatic connection.User terminal, set-top box or PC are attached directly to unified video platform, obtain rich The multimedia video service of rich colorful various forms.Unified video platform is traditional to substitute with table schema using " menu type " Complicated applications programming, considerably less code, which can be used, can be realized complicated application, realize the new business innovation of " endless ".
Networking depending on networking is as described below:
It is a kind of central controlled network structure depending on networking, which can be Tree Network, Star network, ring network etc. class Type, but centralized control node is needed to control whole network in network on this basis.
As shown in Figure 1, being divided into access net and Metropolitan Area Network (MAN) two parts depending on networking.
The equipment of access mesh portions can be mainly divided into 3 classes: node server, access switch, terminal (including various machines Top box, encoding board, memory etc.).Node server is connected with access switch, and access switch can be with multiple terminal phases Even, and it can connect Ethernet.
Wherein, node server is the node that centralized control functions are played in access net, can control access switch and terminal. Node server can directly be connected with access switch, can also directly be connected with terminal.
Similar, the equipment of metropolitan area mesh portions can also be divided into 3 classes: metropolitan area server, node switch, node serve Device.Metropolitan area server is connected with node switch, and node switch can be connected with multiple node servers.
Wherein, node server is the node server for accessing mesh portions, i.e. node server had both belonged to access wet end Point, and belong to metropolitan area mesh portions.
Metropolitan area server is the node that centralized control functions are played in Metropolitan Area Network (MAN), can control node switch and node serve Device.Metropolitan area server can be directly connected to node switch, can also be directly connected to node server.
It can be seen that be entirely a kind of central controlled network structure of layering depending on networking network, and node server and metropolitan area The network controlled under server can be the various structures such as tree-shaped, star-like, cyclic annular.
Visually claim, access mesh portions can form unified video platform (part in virtual coil), and multiple unified videos are flat Platform can form view networking;Each unified video platform can be interconnected by metropolitan area and wide area depending on networking.
Classify depending on networked devices
1.1 the embodiment of the present application can be mainly divided into 3 classes: server depending on the equipment in networking, interchanger (including ether Net gateway), terminal (including various set-top boxes, encoding board, memory etc.).Depending on networking can be divided on the whole Metropolitan Area Network (MAN) (or National net, World Wide Web etc.) and access net.
1.2 equipment for wherein accessing mesh portions can be mainly divided into 3 classes: node server, access switch (including ether Net gateway), terminal (including various set-top boxes, encoding board, memory etc.).
The specific hardware structure of each access network equipment are as follows:
Node server:
As shown in Fig. 2, mainly including Network Interface Module 201, switching engine module 202, CPU module 203, disk array Module 204;
Wherein, Network Interface Module 201, the Bao Jun that CPU module 203, disk array module 204 are come in enter switching engine Module 202;Switching engine module 202 look into the operation of address table 205 to the packet come in, to obtain the navigation information of packet; And the packet is stored according to the navigation information of packet the queue of corresponding pack buffer 206;If the queue of pack buffer 206 is close It is full, then it abandons;All pack buffer queues of 202 poll of switching engine mould, are forwarded: 1) port if meeting the following conditions It is less than to send caching;2) the queue package counting facility is greater than zero.Disk array module 204 mainly realizes the control to hard disk, including The operation such as initialization, read-write to hard disk;CPU module 203 is mainly responsible between access switch, terminal (not shown) Protocol processes, to address table 205 (including descending protocol packet address table, uplink protocol package address table, data packet addressed table) Configuration, and, the configuration to disk array module 204.
Access switch:
As shown in figure 3, mainly including Network Interface Module (downstream network interface module 301, uplink network interface module 302), switching engine module 303 and CPU module 304;
Wherein, the packet (upstream data) that downstream network interface module 301 is come in enters packet detection module 305;Packet detection mould Whether mesh way address (DA), source address (SA), type of data packet and the packet length of the detection packet of block 305 meet the requirements, if met, It then distributes corresponding flow identifier (stream-id), and enters switching engine module 303, otherwise abandon;Uplink network interface mould The packet (downlink data) that block 302 is come in enters switching engine module 303;The data packet that CPU module 204 is come in enters switching engine Module 303;Switching engine module 303 look into the operation of address table 306 to the packet come in, to obtain the navigation information of packet; If the packet into switching engine module 303 is that downstream network interface is gone toward uplink network interface, in conjunction with flow identifier (stream-id) packet is stored in the queue of corresponding pack buffer 307;If the queue of the pack buffer 307 is close full, It abandons;If the packet into switching engine module 303 is not that downstream network interface is gone toward uplink network interface, according to packet Navigation information is stored in the data packet queue of corresponding pack buffer 307;If the queue of the pack buffer 307 is close full, Then abandon.
All pack buffer queues of 303 poll of switching engine module, are divided to two kinds of situations in the embodiment of the present application:
If the queue is that downstream network interface is gone toward uplink network interface, meets the following conditions and be forwarded: 1) It is less than that the port sends caching;2) the queue package counting facility is greater than zero;3) token that rate control module generates is obtained;
If the queue is not that downstream network interface is gone toward uplink network interface, meets the following conditions and is forwarded: 1) it is less than to send caching for the port;2) the queue package counting facility is greater than zero.
Rate control module 208 is configured by CPU module 204, to all downlink networks in programmable interval Interface generates token toward the pack buffer queue that uplink network interface is gone, to control the code rate of forwarded upstream.
CPU module 304 is mainly responsible for the protocol processes between node server, the configuration to address table 306, and, Configuration to rate control module 308.
Ethernet association turns gateway:
As shown in figure 4, mainly including Network Interface Module (downstream network interface module 401, uplink network interface module 402), switching engine module 403, CPU module 404, packet detection module 405, rate control module 408, address table 406, Bao Huan Storage 407 and MAC adding module 409, MAC removing module 410.
Wherein, the data packet that downstream network interface module 401 is come in enters packet detection module 405;Packet detection module 405 is examined Ethernet mac DA, ethernet mac SA, Ethernet length or frame type, the view networking mesh way address of measured data packet DA, whether meet the requirements depending on networking source address SA, depending on networking data Packet type and packet length, corresponding stream is distributed if meeting Identifier (stream-id);Then, MAC DA, MAC SA, length or frame type are subtracted by MAC removing module 410 (2byte), and enter corresponding receive and cache, otherwise abandon;
Downstream network interface module 401 detects the transmission caching of the port, according to the view of packet networking mesh if there is Bao Ze Address D A knows the ethernet mac DA of corresponding terminal, adds the ethernet mac DA of terminal, Ethernet assists the MAC for turning gateway SA, Ethernet length or frame type, and send.
The function that Ethernet association turns other modules in gateway is similar with access switch.
Terminal:
It mainly include Network Interface Module, Service Processing Module and CPU module;For example, set-top box mainly connects including network Mouth mold block, video/audio encoding and decoding engine modules, CPU module;Encoding board mainly includes Network Interface Module, video encoding engine Module, CPU module;Memory mainly includes Network Interface Module, CPU module and disk array module.
The equipment of 1.3 metropolitan area mesh portions can be mainly divided into 2 classes: node server, node switch, metropolitan area server. Wherein, node switch mainly includes Network Interface Module, switching engine module and CPU module;Metropolitan area server mainly includes Network Interface Module, switching engine module and CPU module are constituted.
2, networking data package definition is regarded
2.1 access network data package definitions
Access net data packet mainly include following sections: destination address (DA), source address (SA), reserve bytes, payload(PDU)、CRC。
As shown in the table, the data packet for accessing net mainly includes following sections:
DA SA Reserved Payload CRC
Wherein:
Destination address (DA) is made of 8 bytes (byte), and first character section indicates type (such as the various associations of data packet Discuss packet, multicast packet, unicast packet etc.), be up to 256 kinds of possibility, the second byte to the 6th byte is metropolitan area net address, Seven, the 8th bytes are access net address;
Source address (SA) is also to be made of 8 bytes (byte), is defined identical as destination address (DA);
Reserve bytes are made of 2 bytes;
The part payload has different length according to the type of different datagrams, is if it is various protocol packages 64 bytes are 32+1024=1056 bytes if it is single group unicast packets words, are not restricted to above 2 kinds certainly;
CRC is made of 4 bytes, and calculation method follows the Ethernet CRC algorithm of standard.
2.2 Metropolitan Area Network (MAN) packet definitions
The topology of Metropolitan Area Network (MAN) is pattern, may there is 2 kinds, connection even of more than two kinds, i.e. node switching between two equipment It can all can exceed that 2 kinds between machine and node server, node switch and node switch, node switch and node server Connection.But the metropolitan area net address of metropolitan area network equipment is uniquely, to close to accurately describe the connection between metropolitan area network equipment System, introduces parameter in the embodiment of the present application: label, uniquely to describe a metropolitan area network equipment.
(Multi-Protocol Label Switch, multiprotocol label are handed over by the definition of label and MPLS in this specification Change) label definition it is similar, it is assumed that between equipment A and equipment B there are two connection, then data packet from equipment A to equipment B just There are 2 labels, data packet also there are 2 labels from equipment B to equipment A.Label is divided into label, outgoing label, it is assumed that data packet enters The label (entering label) of equipment A is 0x0000, and the label (outgoing label) when this data packet leaves equipment A may reform into 0x0001.The networking process of Metropolitan Area Network (MAN) is to enter network process under centralized control, also means that address distribution, the label of Metropolitan Area Network (MAN) Distribution be all to be dominated by metropolitan area server, node switch, node server be all passively execute, this point with The label distribution of MPLS is different, and the distribution of the label of MPLS is the result that interchanger, server are negotiated mutually.
As shown in the table, the data packet of Metropolitan Area Network (MAN) mainly includes following sections:
DA SA Reserved Label Payload CRC
That is destination address (DA), source address (SA), reserve bytes (Reserved), label, payload (PDU), CRC.Its In, the format of label, which can refer to, such as gives a definition: label is 32bit, wherein high 16bit retains, only with low 16bit, its position Set is between the reserve bytes and payload of data packet.
Based on the above-mentioned characteristic of view networking, one of core idea of the embodiment of the present application is proposed, it then follows regard the association of networking View, for same view networked clients, after receiving n-th data packet, using the first time threshold as the period, periodically Ground detects whether to receive the N+1 data packet for carrying same identification marking, first carries out time-out record judgement, after just carry out Judgement is disconnected, can both disconnect in time connection when this is out of touch depending on networked clients in this way, discharges server System pressure also can avoid causing to judge by accident depending on networked clients to this, cause to repeat to connect with this depending on networked clients to influence number According to efficiency of transmission.
Embodiment 1:
As shown in figure 5, showing a kind of networking schematic diagram of the system of data timeout treatment of the embodiment of the present application, the system System can be applied in view networking, and the view networking includes view networked server 01, be based on view with the view networked server 01 Multiple view networked clients 02 of networking protocol connection.
It also can be considered the distributed data base frame based on view networking depending on networked server 01 mentioned by the embodiment of the present application Frame is distributed in each region of entire view networking, at most can access 255 view networked servers 01 in entire view networking. Each multiple view networked clients 02 that oneself place view intranet zone is managed depending on networked server 01, for example, view networking clothes Can be safeguarded in business device 01 it is managed enter netlist depending on networked clients 02, enter to have recorded in netlist and regard networked clients 02 Number, title, addressable address etc. only carry out control tune depending on networked clients 02 to configured networking depending on networked server 01 Degree.
It can be considered a kind of view networked hosts depending on networked clients 02, this can be an integrated view networking sound depending on networked hosts Frequently, the hardware and software device of the functions such as decoding video stream;It is also possible to a kind of data communication for supporting double nets (depending on networking, internet) Hardware and software device.Networking being regarded by view networking number access depending on networked terminals, (view in affiliated view networking network, which is networked, to be taken Business device 01), it is communicated with others depending on networked hosts etc..
Embodiment 2:
As shown in fig. 6, showing a kind of step flow chart of the method for data timeout treatment of the embodiment of the present application, the side Method can be applied in view networking, specifically can be applied in view networked server 01 shown in fig. 5, and the method specifically can be with The following steps are included:
Step S601: the view networked server successively receives N number of data packet that view networked clients are sent;Wherein, N is Positive integer, the data packet carry the identification marking of the view networked clients;
Data mentioned by the embodiment of the present application, which can be, gives birth to depending on networked clients 02 according to the trigger action received At, it is also possible to the data in other sources of forwarding.
Such as, in a kind of alternative embodiment of the application, provide a kind of data source mode, it is described depending on networking further include with The first database 03 that the view networked clients 02 of network area where itself connect, the method specifically can also include following Step:
N number of data packet is by the first database 03 generation when receiving the trigger action of data update;It is described First database 03 is used to N number of data packet being sent to the view networked clients 02.Above-mentioned first database 03 can be with For the MySQL database being connect with depending on networked clients 02.
It is described to be used to send out the data packet depending on networked clients 02 since above-mentioned first database 03 is located in internet Before giving view networked server 01, the method is specifically further comprising the steps of:
It is described to be used to receive the internet that 03 internet protocol-based of first database is sent depending on networked clients 02 Data packet;
It is described to be used to be based on depending on networked clients 02 that the internet data packet to be converted to view networking number depending on networking protocol According to packet.
Above-mentioned internet data packet is converted to the process of view networking data packet specifically: first disassembles packet header of data packet and interior Hold, the Internet protocol in packet header is removed, then will be added in packet header depending on networking protocol, and the data packet is sealed again Dress, so as to form view networking data packet.
According to the level of current view networking, a view networked server 01 about can access 60000 view networked clients 02, so view networked clients 02 are when sending data packet to view networked server 01, each data packet can carry described Depending on the identification marking of networked clients 02, in order to identify depending on networked server 01 to received data packet, number is recorded According to source.Above-mentioned identification marking can be the MAC Address of view networked clients 02 or the account of view networking registration user.
In addition, since the transmission of data is propagated in the form of data flow after resolving into multiple data packets, so the application Data packet in embodiment is preferably standard view networking data packet, and the standard regards networking data packet as 1024 bytes, with compared with The transmission resolution speed of good adaptation view networking.
Step S602: it is described depending on networked server when receiving n-th data packet, record the n-th data packet It stabs at the first time;
Due to being that data packet is sent to view networked server one by one in the form of data flow depending on networked clients 02 01, the view networked server 01 and one by one received data packet, so just being recorded when often receiving a data packet The receiving time of the data packet is stabbed.
Step S603: the view networked server judges the time difference of current time stamp and first time stamp;
Step S604: if the time difference is greater than preset first time threshold, the view networked server is with institute Stating first time threshold is the period, periodically detects and whether receives the N+1 data packet for carrying same identification marking;
Step S605: the view networked server is for detection every time, when not receiving the N+1 data packet, View networked clients corresponding with the identification marking are subjected to primary time-out record;
Step S606: when for it is described view networked clients time-out record number be greater than preset times threshold value or it is described when Between difference be greater than preset second time threshold, it is described to be disconnected with described depending on networked clients depending on networked server.
It is provided with overtime judgment module in depending on networked server 01, there is a timer in overtime judgment module, this is fixed When device/timer run as normal clock, show current time stamp all the time.
Due to being likely to be received the data packet that multiple view networked clients 02 are sent in synchronization depending on networked server 01, So by identification marking it may determine that the data source of the data packet.For same view networked clients 02, taken depending on networking Business device 01 just stabs the receiving time of the data packet after N (N may be 1,2,3 ... N) a data packet for receiving its transmission (stab at the first time) is recorded, at the same calculate the time difference between current time stamp and at the first time stamp (can be regarded as from Stamp starts at the first time, and timer timing since 0, the time is longer, and the numerical value of timing is bigger on timer, i.e. time difference Also bigger), judge whether the time difference is greater than preset first time threshold and (can record once, or increase for timer is every As soon as adding numerical value, time difference and preset first time threshold judge primary), if difference has been more than preset Timeout interval (first time threshold), and do not receive the N+1 data packet of view networked clients transmission also at this time, Just it is believed that time out event has occurred, corresponding with the identification marking primary time-out record will be carried out depending on networked clients 02, Tentatively it is judged as that the view networked clients 02 are in data transmission unstable state.
Next, timer still lasting timing (i.e. since first time stab timing), then with described first when Between threshold value be the period, periodically detect and whether receive the N+1 data packet for carrying same identification marking.For example it is spaced A cycle does not receive the N+1 data packet, just carries out time-out for the first time to the view networked clients 02 and records; It is spaced second period, does not receive the N+1 data packet also, second of time-out just is carried out to the view networked clients 02 Record ...
If being greater than preset times threshold value for the time-out record depending on networked clients 02 or the time difference being greater than Preset second time threshold (second time threshold is much larger than first time threshold), then can determine that the view networked clients 02 are sent out Raw failure or network failure connected to it regard networked server 01 at this time and just actively disconnect and the view networked clients 02 Connection, stop forwarding data to the view networked clients 02, and discharge the occupied resource of connection, current view can be relieved with this The pressure of networked server 01 is excessive, and system resource occupies excessively high problem.
For the step S603~step S606 of the embodiment of the present application, further illustrated using a specific example:
First time threshold is 2 seconds, and second time threshold is 30 seconds, and preset times threshold value is 16 times;
Regard networked server 01 receive the 1st data packet timestamp as 9:00, timer timing since 0 at this time, if Determine timer using the second as the unit of display, using millisecond as time of day, when timer is shown as 1.000 seconds, at this time and at the first time The time difference of stamp is 1 second, does not receive the 2nd data packet, time difference does not do any place again smaller than first time threshold Reason;When timer is shown as 2.000 seconds, it is at this time 2 seconds with the time difference of first time stamp, does not also receive the 2nd number According to packet, time difference is equal to first time threshold, without any processing;But when the timer time is 2.001 seconds, at this time with the The time difference of one timestamp is 2.001 seconds, does not also receive the 2nd data packet, and time difference is greater than first time threshold, will It is corresponding with the identification marking to carry out primary time-out record depending on networked clients 02.Next, being taken at interval of two seconds depending on networking Whether business device 01 receives the 2nd data packet under just detecting.When number of detection cycles is 15 times, i.e., join for the view When the time-out record number of net client 01 is 15 times, the time difference has been 30 seconds at this time, so at 30.001 seconds When, it does not receive the 2nd data packet also at this time, will actively disconnect and connect with the view networked clients 02 depending on networked server 01 It connects.
The embodiment of the present application is set as 1.5~3 seconds in an alternative embodiment, by first time threshold.It can avoid in this way The problem of timeout interval time sets too short, causes time-out record erroneous judgement depending on networked clients 02 to this;When also can avoid interval Between it is too long, to connect with depending on networked clients 02 network stabilization detection failure.
Meanwhile preset times threshold value is set as 16 times, the second time by the embodiment of the present application in another alternative embodiment Threshold value is set as 30 seconds~60 seconds.Threshold value setting is higher than 30 seconds, can preferably judge the net connecting with depending on networked clients 02 Whether network is normal, avoids blindly disconnecting the connection with view networked clients 02;Threshold value is set lower than 60 seconds, avoids joining with the view The connection of net client 02 occupies the overlong time of view networked server 01, that is, avoids the system money for occupying view networked server 01 The overlong time in source and running memory.
It is described depending on networking further include with second database 04 being connect depending on networked server 01, if regard the Internet services Communication between device 01 and view networked clients 02 is normal, just forwards data packet after receiving data packet depending on networked server 01 It is stored to the second database 04, in a preferred embodiment, specific pass-through mode can are as follows:
Step S607: it is described depending on networked server 01 when receiving n-th data packet, by the n-th data packet send out It send into second database 04 and stores.
Above preferred embodiment shows a kind of mode of forwarding of data packet, is receiving one depending on networked server 01 The data packet is just forwarded to the storage backup of the second database 04 when data packet, data packet can avoid with this and be deposited in view networking clothes It is engaged in the interior the problem of occupying its memory of device 01, while can guarantee the integrality of data backup.Second database 03 is also to network with view The MySQL database that client 02 connects.
The embodiment of the present application elaborates data from the angle depending on networked server 01 by step S601~step S606 A kind of possible mode of timeout treatment: being directed to same view networked clients 02, after receiving n-th data packet, with described the One time threshold is the period, periodically detects and whether receives the N+1 data packet for carrying same identification marking, advanced Row time-out record judgement, after just turn off connection judgment, so both can be timely when the view networked clients 02 are out of touch Connection is disconnected, server system pressure is discharged, also can avoid that this is caused to judge by accident depending on networked clients 02, cause to repeat Connecting with this depending on networked clients 02 influences data transmission efficiency.
The data timeout treatment mechanism of the embodiment of the present application is different from traditional heartbeat inspecting mechanism, the embodiment of the present application without Heartbeat inspecting thread need to be individually established, heartbeat packet is sent or received or heartbeat frame to carry out heartbeat prison to view networked clients 02 It surveys, heartbeat bag data can be reduced to the occupancy of the memory headroom of view networked server 01, reduce the operation of view networked server 01 Pressure.
Meanwhile compared to traditional data transmission mechanism UDT, the data timeout treatment mechanism of the embodiment of the present application utilizes UDT Principle, not only overcome at present be not available UDT agreement view networking in transmit data the problem of, while also using view connection The data transmission security that the data transmission security of net compensates for UDT agreement is poor, is easy the problem of being stolen by others.
It should be noted that for simple description, therefore, it is stated as a series of action groups for embodiment of the method It closes, but those skilled in the art should understand that, the embodiment of the present application is not limited by the described action sequence, because according to According to the embodiment of the present application, some steps may be performed in other sequences or simultaneously.Secondly, those skilled in the art also should Know, the embodiments described in the specification are all preferred embodiments, and related movement not necessarily the application is implemented Necessary to example.
Embodiment 3:
As shown in fig. 7, method described in corresponding embodiment 2, shows a kind of data timeout treatment of the embodiment of the present application The structural block diagram of device, described device can be applied in view networking, specifically can be applied to the view networking clothes shown in fig. 5 It is engaged in device 01, described to can specifically include depending on networked server 01 with lower module:
Packet-receiving module 701, the N number of data packet sent for successively receiving view networked clients;Wherein, N is positive Integer, the data packet carry the identification marking of the view networked clients;
Stamp logging modle 702 at the first time, for when receiving n-th data packet, recording the n-th data packet It stabs at the first time;
Time difference judgment module 703, for judging the time difference of current time stamp and first time stamp;
Periodicity detection module 704 is used for when the time difference is greater than preset first time threshold, then with described First time threshold is the period, periodically detects and whether receives the N+1 data packet for carrying same identification marking;
Overtime logging modle 705, will be with institute when not receiving the N+1 data packet for detecting for each It states the corresponding view networked clients of identification marking and carries out primary time-out record;
Depending on networked clients management module 706, for being greater than for the time-out record number depending on networked clients When preset times threshold value or the time difference are greater than preset second time threshold, disconnect and connecting with the view networked clients It connects.
Corresponding preferred embodiment of the present application, it is described to further include and second connect depending on networked server 01 depending on networking Database 04, described specifically to be comprised the following modules depending on networked server 01:
Data packet forward module 707, for when receiving n-th data packet, the n-th data packet to be sent to institute It states and is stored in the second database 04.
The embodiment of the present application also provides a kind of devices, comprising:
One or more processors;With
One or more machine readable medias of instruction are stored thereon with, are executed when by one or more of processors When, so that the method that described device executes one or more described in the embodiment of the present application.
The embodiment of the present application also provides one or more machine readable medias, are stored thereon with instruction, when by one or When multiple processors execute, so that the method that the processor executes one or more described in the embodiment of the present application.
For device embodiment, since it is basically similar to the method embodiment, related so being described relatively simple Place illustrates referring to the part of embodiment of the method.
All the embodiments in this specification are described in a progressive manner, the highlights of each of the examples are with The difference of other embodiments, the same or similar parts between the embodiments can be referred to each other.
It should be understood by those skilled in the art that, the embodiments of the present application may be provided as method, apparatus or calculating Machine program product.Therefore, the embodiment of the present application can be used complete hardware embodiment, complete software embodiment or combine software and The form of the embodiment of hardware aspect.Moreover, the embodiment of the present application can be used one or more wherein include computer can With in the computer-usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) of program code The form of the computer program product of implementation.
The embodiment of the present application is referring to according to the method for the embodiment of the present application, terminal device (system) and computer program The flowchart and/or the block diagram of product describes.It should be understood that flowchart and/or the block diagram can be realized by computer program instructions In each flow and/or block and flowchart and/or the block diagram in process and/or box combination.It can provide these Computer program instructions are set to general purpose computer, special purpose computer, Embedded Processor or other programmable data processing terminals Standby processor is to generate a machine, so that being held by the processor of computer or other programmable data processing terminal devices Capable instruction generates for realizing in one or more flows of the flowchart and/or one or more blocks of the block diagram The device of specified function.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing terminal devices In computer-readable memory operate in a specific manner, so that instruction stored in the computer readable memory generates packet The manufacture of command device is included, which realizes in one side of one or more flows of the flowchart and/or block diagram The function of being specified in frame or multiple boxes.
These computer program instructions can also be loaded into computer or other programmable data processing terminal devices, so that Series of operation steps are executed on computer or other programmable terminal equipments to generate computer implemented processing, thus The instruction executed on computer or other programmable terminal equipments is provided for realizing in one or more flows of the flowchart And/or in one or more blocks of the block diagram specify function the step of.
Although preferred embodiments of the embodiments of the present application have been described, once a person skilled in the art knows bases This creative concept, then additional changes and modifications can be made to these embodiments.So the following claims are intended to be interpreted as Including preferred embodiment and all change and modification within the scope of the embodiments of the present application.
Finally, it is to be noted that, herein, relational terms such as first and second and the like be used merely to by One entity or operation are distinguished with another entity or operation, without necessarily requiring or implying these entities or operation Between there are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant meaning Covering non-exclusive inclusion, so that process, method, article or terminal device including a series of elements not only wrap Those elements are included, but also including other elements that are not explicitly listed, or further includes for this process, method, article Or the element that terminal device is intrinsic.In the absence of more restrictions, being wanted by what sentence "including a ..." limited Element, it is not excluded that there is also other identical elements in process, method, article or the terminal device for including the element.
Method to a kind of data timeout treatment provided herein and a kind of device of data timeout treatment above, into It has gone and has been discussed in detail, specific examples are used herein to illustrate the principle and implementation manner of the present application, the above implementation The explanation of example is merely used to help understand the present processes and its core concept;Meanwhile for the general technology people of this field Member, according to the thought of the application, there will be changes in the specific implementation manner and application range, in conclusion this explanation Book content should not be construed as the limitation to the application.

Claims (10)

1. a kind of method of data timeout treatment, which is characterized in that the method is applied in view networking, described to include depending on networking Depending on networked server, with it is described depending on networked server based on the multiple view networked clients being connect depending on networking protocol, the method Include:
The view networked server successively receives N number of data packet that view networked clients are sent;Wherein, N is positive integer, the number The identification marking of the view networked clients is carried according to packet;
It is described depending on networked server when receiving n-th data packet, record the n-th data packet first time stamp;
The view networked server judges the time difference of current time stamp and first time stamp;
If the time difference is greater than preset first time threshold, the view networked server is with the first time threshold For the period, periodically detects and whether receive the N+1 data packet for carrying same identification marking;
The view networked server, when not receiving the N+1 data packet, will be marked for detection every time with the identification Know corresponding view networked clients and carries out primary time-out record;
It is greater than in advance when for the time-out record number for regarding networked clients greater than preset times threshold value or the time difference If second time threshold, it is described to be disconnected with described depending on networked clients depending on networked server.
2. the method according to claim 1, wherein described further include and network area where itself depending on networking Depending on networked clients connection first database, the method also includes:
N number of data packet is by first database generation when receiving the trigger action of data update;First number It is used to N number of data packet being sent to the view networked clients according to library.
3. according to the method described in claim 2, it is characterized in that, described be used to send the data packet depending on networked clients Before view networked server, the method also includes:
It is described to be used to receive the internet data packet that the first database internet protocol-based is sent depending on networked clients;
It is described to be used to be based on depending on networked clients that the internet data packet to be converted to view networking data packet depending on networking protocol.
4. the method according to claim 1, wherein described further include and view networked server company depending on networking The second database connect, the method also includes:
It is described depending on networked server when receiving n-th data packet, the n-th data packet is sent to second data It is stored in library.
5. the method according to claim 1, wherein the data packet is that standard regards networking data packet, the mark Standard regards networking data packet as 1024 bytes.
6. the method according to claim 1, wherein the first time threshold is 1.5~3 seconds.
7. the method according to claim 1, wherein the preset times threshold value be 16 times, second time Threshold value is 30 seconds~60 seconds.
8. a kind of device of data timeout treatment, which is characterized in that described device is applied in view networking, described to include depending on networking Depending on networked server, with it is described depending on networked server based on the multiple view networked clients being connect depending on networking protocol, the view connection Network server comprises the following modules:
Packet-receiving module, the N number of data packet sent for successively receiving view networked clients;Wherein, N is positive integer, institute State the identification marking that data packet carries the view networked clients;
Stamp logging modle at the first time, when for when receiving n-th data packet, recording the first of the n-th data packet Between stab;
Time difference judgment module, for judging the time difference of current time stamp and first time stamp;
Periodicity detection module, for the time difference be greater than preset first time threshold when, then with described first when Between threshold value be the period, periodically detect and whether receive the N+1 data packet for carrying same identification marking;
Overtime logging modle, will be with the identification when not receiving the N+1 data packet for detecting for each It identifies corresponding view networked clients and carries out primary time-out record;
Depending on networked clients management module, for being greater than preset times in the time-out record number for the view networked clients When threshold value or the time difference are greater than preset second time threshold, disconnected with described depending on networked clients.
9. a kind of device characterized by comprising
One or more processors;With
One or more machine readable medias of instruction are stored thereon with, when being executed by one or more of processors, are made The methods for obtaining the one or more that described device is executed as described in claim 1-7.
10. one or more machine readable medias, which is characterized in that instruction is stored thereon with, when by one or more processors When execution, so that the processor executes one or more methods as described in claim 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 true CN109889775A (en) 2019-06-14
CN109889775B 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)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111371639A (en) * 2020-02-21 2020-07-03 腾讯科技(深圳)有限公司 Network delay analysis method and device, storage medium and computer equipment
CN115599330A (en) * 2022-09-28 2023-01-13 北京亚控科技发展有限公司(Cn) Fault diagnosis method and related device of data acquisition system

Citations (6)

* 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
US20160142967A1 (en) * 2014-11-17 2016-05-19 Samsung Electronics Co., Ltd. Method for controlling access point operation in wireless communication 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
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 (6)

* 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
US20160142967A1 (en) * 2014-11-17 2016-05-19 Samsung Electronics Co., Ltd. Method for controlling access point operation in wireless communication system
CN105635248A (en) * 2015-12-18 2016-06-01 Tcl集团股份有限公司 Method and system for releasing TCP (Transmission Control Protocol) connection resources
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

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
MOAIAD ADMAD KHDER等: "Fixed End Timeout Technique (FETOT) for Planned Disconnection in Mobile Database over Fixed Network with Weighted Data Distribution", 《 2008 3RD INTERNATIONAL CONFERENCE ON INFORMATION AND COMMUNICATION TECHNOLOGIES: FROM THEORY TO APPLICATIONS》 *
钱迎进等: "大规模集群中一种自适应可扩展的RPC超时机制", 《软件学报》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111371639A (en) * 2020-02-21 2020-07-03 腾讯科技(深圳)有限公司 Network delay analysis method and device, storage medium and computer equipment
CN111371639B (en) * 2020-02-21 2021-12-14 腾讯科技(深圳)有限公司 Network delay analysis method and device, storage medium and computer equipment
CN115599330A (en) * 2022-09-28 2023-01-13 北京亚控科技发展有限公司(Cn) Fault diagnosis method and related device of data acquisition system

Also Published As

Publication number Publication date
CN109889775B (en) 2020-09-18

Similar Documents

Publication Publication Date Title
CN106301836B (en) A kind of method of redundancy backup, terminal and view networked system
CN108012106B (en) A kind of method and system regarding networking monitoring source synchronous
CN107959819A (en) A kind of method and apparatus for realizing video conferencing system Dispatching monitor and control system
CN109889780A (en) Method of data synchronization and device
CN109167960A (en) A kind of processing method and system of video stream data
CN109167962A (en) It is a kind of to turn server depending on networked resources method for releasing and monitoring association
CN109818776A (en) Micro services module exception localization method and device
CN110392126A (en) A kind of communication means and device
CN110381030A (en) A kind of processing method and processing device of synchronization request
CN109617956A (en) A kind of data processing method and device
CN109889420A (en) Method and device for business processing
CN110536099A (en) Alarm method, device and computer readable storage medium
CN109587002A (en) A kind of condition detection method and system regarding networking monitoring equipment
CN109379254A (en) A kind of detection method and system of the network connection based on video conference
CN109889779A (en) A kind for the treatment of method and apparatus of packet out-ordering
CN108881895A (en) A kind of malfunction elimination method and apparatus based on view networking
CN110225083A (en) Data push method and device based on view networking
CN109462594A (en) A kind of data processing method and system based on view networking
CN109857591A (en) A kind of method and apparatus for transmitting data validation
CN110224988A (en) A kind of processing method of image data, system and device and storage medium
CN110048903A (en) A kind of association turns gateway status monitoring method and device
CN109714568A (en) A kind of synchronous method and device of video monitoring data
CN109743284A (en) A kind of method for processing video frequency and system based on view networking
CN109889775A (en) A kind of method and apparatus of data timeout treatment
CN110505077A (en) A kind of method and apparatus of upgrading

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.