CN109889779B - Message out-of-order processing method and device - Google Patents

Message out-of-order processing method and device Download PDF

Info

Publication number
CN109889779B
CN109889779B CN201910100778.2A CN201910100778A CN109889779B CN 109889779 B CN109889779 B CN 109889779B CN 201910100778 A CN201910100778 A CN 201910100778A CN 109889779 B CN109889779 B CN 109889779B
Authority
CN
China
Prior art keywords
message
cache
cat
terminal
target
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
CN201910100778.2A
Other languages
Chinese (zh)
Other versions
CN109889779A (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.)
Visionvera 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 CN201910100778.2A priority Critical patent/CN109889779B/en
Publication of CN109889779A publication Critical patent/CN109889779A/en
Application granted granted Critical
Publication of CN109889779B publication Critical patent/CN109889779B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The embodiment of the application provides a message disorder processing method and device, wherein the method and device are applied to a video network, and the video network comprises a video modem terminal and an internet terminal connected with the video modem terminal; after the cat viewing terminal stores the first message into the first corresponding position, the cat viewing terminal can wait for the arrival of a target second message, or after the second message is stored into the second corresponding position, the cat viewing terminal can wait for the arrival of the target first message, so that data recombination is realized.

Description

Message out-of-order processing method and device
Technical Field
The present application relates to the field of video networking technologies, and in particular, to a method and an apparatus for processing packets out of order.
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 wide application of the video networking, the mutual access between the video networking and the internet is also realized, but when the current video networking and internet mutual access realized video networking terminal and video networking server side forward data, the phenomenon of message disorder often occurs, and the data packet is lost frequently.
Disclosure of Invention
In view of the above problems, embodiments of the present application are provided to provide a method and a device for processing packets out of order, which overcome or at least partially solve the above problems, and can achieve the purposes of avoiding discarding fragmented packets and reducing a packet loss rate when data forwarded by a cat viewing terminal or a cat viewing server is out of order within a small range.
In order to solve the above problem, an embodiment of the present application discloses a method for processing message out of order, where the method is applied to a video network, where the video network includes a cat terminal and an internet terminal connected to the cat terminal, and the method includes:
the method comprises the steps that the cat viewing terminal judges whether a video networking message is a fragment message or not according to the currently received video networking message;
if so, the cat viewing terminal identifies the fragment message as a first message or a second message;
when the recognition result is the first message, the method comprises the following steps:
the cat viewing terminal judges whether a target second message corresponding to the first message exists in a cache or not;
if the target second message exists in the cache, the cat viewing terminal recombines the first message and the target second message to generate an internet message, and sends the internet message to the internet terminal;
if the target second message does not exist in the cache, the cat viewing terminal stores the first message into the cache;
when the identification result is the second message, the method comprises the following steps:
the cat viewing terminal judges whether a target first message corresponding to the second message exists in a cache;
if the target first message exists in the cache, the cat viewing terminal recombines the second message and the target first message to generate an internet message, and sends the internet message to the internet terminal;
and if the cache does not contain the target first message, the cat viewing terminal stores the second message into the cache.
Optionally, the fragment packet includes a video networking packet header and a load;
the video network message header carries a fragment identifier, and the fragment identifier comprises a first fragment identifier or a second fragment identifier.
Optionally, the step of recombining, by the cat viewing terminal, the first packet and the target second packet, or recombining the second packet and the target first packet, and generating the internet packet includes:
the cat viewing terminal disassembles the first message and the target second message into a video networking message header and a load, or disassembles the second message and the target first message into a video networking message header and a load;
the cat viewing terminal splices the load of the first message and the load of the target second message, or splices the load of the second message and the load of the target first message;
and the cat terminal adds an internet message header to the spliced load to generate an internet message.
Optionally, the packet header of the video network also carries a video network serial number; the cache comprises a cache threshold length;
before the step of storing the first message or the second message into the cache by the cat viewing terminal, the method further includes:
the cat viewing terminal acquires a first video network serial number of the first message or a second video network serial number of the second message;
the cat terminal obtains a remainder of the first video network serial number to the cache threshold length, and the remainder is determined as a first corresponding position number of the first message in the cache; or taking the remainder of the second video network serial number to the cache threshold length, and determining the remainder as the serial number of the second corresponding position of the second message in the cache.
Optionally, if the target second message is not stored in the cache, the step of storing the first message in the cache by the cat viewing terminal includes:
if the cache does not contain the target second message, the cat viewing terminal judges whether a first corresponding position of the first message in the cache is occupied or not;
if the first corresponding position is not occupied, the cat viewing terminal stores the first message into the first corresponding position;
and if the first corresponding position is occupied, the cat viewing terminal clears the content of the first corresponding position and stores the first message into the first corresponding position.
Optionally, if the cache does not contain the target first message, the step of storing the second message into the cache by the cat viewing terminal includes:
if the cache does not contain the target first message, the cat viewing terminal judges whether a second corresponding position of the second message in the cache is occupied or not;
if the second corresponding position is not occupied, the cat viewing terminal stores the second message into the second corresponding position;
and if the second corresponding position is occupied, the cat viewing terminal clears the content of the second corresponding position and stores the second message into the second corresponding position.
Optionally, the cat viewing terminal includes a cat viewing client and a cat viewing server; the internet terminal comprises a user terminal based on an internet protocol and an internet website server;
when the cat viewing terminal is a cat viewing client, the internet terminal is a user terminal;
and when the cat viewing terminal is a cat viewing server, the internet terminal is an internet website server.
In order to solve the above problem, the embodiment of the present application further discloses a processing apparatus for message disorder, the apparatus is applied to a video network, the video network includes a cat viewing terminal, and an internet terminal connected to the cat viewing terminal, the cat viewing terminal includes:
the video networking message judgment module is used for judging whether the video networking message is a fragment message or not according to the currently received video networking message;
the fragment message identification module is used for identifying the fragment message as a first message or a second message when the video network message is a fragment message;
when the recognition result is the first message, the method comprises the following modules:
the first cache judging module is used for judging whether a target second message corresponding to the first message exists in the cache;
the message first recombination module is used for recombining the first message and the target second message to generate an internet message and sending the internet message to the internet terminal when the target second message exists in the cache;
the first message storing module is used for storing the first message into the cache when the target second message does not exist in the cache;
when the identification result is the second message, the method comprises the following modules:
the second cache judging module is used for judging whether a target first message corresponding to the second message exists in the cache;
the message second recombination module is used for recombining the second message and the target first message to generate an internet message and sending the internet message to the internet terminal when the target first message exists in the cache;
and the second message storing module is used for storing the second message into the cache when the target first message does not exist in the cache.
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.
The embodiment of the application has the following advantages:
by applying the characteristics of the video network, after the video modem terminal stores the first message into the first corresponding position, the video modem terminal can wait for the arrival of a target second message; or after the second message is stored in the second corresponding position, the arrival of the target first message can be waited, so that the data recombination is realized; when data forwarded by the cat viewing terminal is out of order in a small range, the embodiment of the application can avoid discarding the fragment message, and achieve the purpose of reducing the packet loss rate.
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 flowchart illustrating steps of a method for processing packets out of order according to an embodiment of the present application;
fig. 6 is a block diagram of a structure of a message out-of-order processing apparatus 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 (2byte) 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 bytes, 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 different types of datagrams, and is 64 bytes if the datagram is various types of protocol packets, and is 32+1024 or 1056 bytes if the datagram is a unicast packet, of course, the length is 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 networking, one of the core concepts of the embodiment of the application is provided, the fragment messages in the video networking are processed according to a protocol of the video networking, one fragment message is stored in a corresponding position of a cache, then, another fragment message of the same video networking message is waited for to arrive, message recombination is realized, and an internet message is generated and then sent to an internet terminal.
Example 1:
as shown in fig. 5, a flowchart illustrating steps of a method for processing a message out of order according to an embodiment of the present application is shown, where the method may be applied to a video network, where the video network includes a cat terminal and an internet terminal connected to the cat terminal, and the method specifically includes the following steps:
the cat viewing terminal comprises a cat viewing client and a cat viewing server; the internet terminal comprises a user terminal based on an internet protocol and an internet website server;
when the cat viewing terminal is a cat viewing client, the internet terminal is a user terminal;
and when the cat viewing terminal is a cat viewing server, the internet terminal is an internet website server.
According to the characteristics of the video network, data transmission is generally carried out in a standard video network data packet format in the video network at present, and the size of one standard video network data packet is default to be 1024 bytes. The video network message is generally 1514 bytes, and cannot be smoothly transmitted in the video network when the size of the video network message is too large, so that the video network message is divided into at least two pieces when being transmitted in the video network, and a fragment message is formed.
Step S501: the method comprises the steps that the cat viewing terminal judges whether a video networking message is a fragment message or not according to the currently received video networking message;
step S502: if so, the cat viewing terminal identifies the fragment message as a first message or a second message;
because the fragment message comprises a video network message header and a load;
the video network message header carries a fragment identifier, and the fragment identifier comprises a first fragment identifier or a second fragment identifier.
Therefore, in an optional embodiment of the present application, the cat viewing terminal may determine whether the current video networking message is a fragment message according to the fragment identifier, and may also determine whether the video networking message belongs to the first message or the second message according to a sequence number of the fragment identifier (where the sequence number may be understood as the first fragment identifier or the second fragment identifier).
The first fragment identifier or the second fragment identifier may be a fragment-specific identifier, for example, a network-based message is considered as a fragment message, a fragment identifier in a header of the network-based message is "01/0001 #", and the 0001# is a specific fragment identifier and indicates a first fragment message sent to the cat terminal; and 01, a first fragment identifier, which indicates that the fragment message is the first fragment to be fragmented. The method can accurately identify the specific fragment identification of the current video networking message, and is beneficial to the video networking cat terminal to make accurate judgment and execute the next step.
In addition, the cat viewing terminal identifies that the fragment message is a first message or a second message, and can also identify the fragment message according to the data size of the fragment message, and after the cat viewing message is split into the fragment messages, the first fragment message can be about the size of a standard video networking data packet, which is about 1024 bytes; the second fragment of the packet is typically the complete video network packet minus the size of the standard video network packet, which is about 490 bytes. If the data size of the current fragment message is about 1000 bytes, identifying the current fragment message as a first message; and if the data size of the current fragment message is about 500 bytes, identifying the current fragment message as a second fragment message. The method is simple in fragment identification, does not occupy bytes of the data message, and is low in identification accuracy.
In the video network, when the data interaction is started after the connection between the current modem terminal and the video network is established, the situation that the fragment messages are out of order often occurs. For example, after a certain video networking message is split into two fragment messages, the situation that the second message is sent to the cat terminal first often occurs, or the cat terminal cannot receive the second message after receiving the first message, and when the cat terminal receives any one fragment message, the message cannot be sent to the internet due to incompleteness of the message, so that the video networking message can only be discarded, and packet loss is caused.
In view of the above problems, in the embodiment of the present application, a cache mechanism is provided for the cat viewing terminal, and when any one fragmented message is received, the fragmented message may be first put into a cache to wait for another fragmented message of the same internet of view message to arrive.
When the recognition result of the cat viewing terminal on the fragment message is the first message, the cat viewing terminal may specifically execute the following steps:
step S503: the cat viewing terminal judges whether a target second message corresponding to the first message exists in a cache or not;
and if the currently received fragment message is the first message, the cat viewing terminal judges whether a target second message based on the same video networking message is stored in a cache.
Step S504: if the target second message exists in the cache, the cat viewing terminal recombines the first message and the target second message to generate an internet message and sends the internet message to an internet terminal;
in an optional embodiment of the present application, a possible implementation manner of step S504 is shown, and specifically, the following steps may be included:
the cat terminal disassembles the first message and the target second message into a video networking message header and a load;
and the cat viewing terminal splices the loads of the first message and the target second message, and adds an internet message header to the spliced loads to generate the internet message.
The steps realize the recombination of two fragmented messages, for example, the first message is 1024 bytes, the target second message is 500 bytes, after the first message and the target second message are disassembled into the head and the load of the internet of view message, the load content of the first message is 1000 bytes, the load content of the target second message is 476 bytes, and after the internet of view terminal splices the loads of the first message and the target second message, the formed spliced load is 1476 bytes. For example, the header of the added internet message is 20 bytes, the generated internet message is 1496 bytes.
Because the fragment identifier is positioned in the message header of the video network, and the message header of the video network is automatically discarded after the fragment message is disassembled and recombined, the generated internet message is a complete message and does not have the fragment identifier.
Step S505: if the target second message does not exist in the cache, the cat viewing terminal stores the first message into the cache;
in an alternative embodiment of the present application, the specific implementation sub-steps of step S505 are shown:
the first substep: if the cache does not contain the target second message, the cat viewing terminal judges whether a first corresponding position of the first message in the cache is occupied or not;
the video network message header also carries a video network serial number; the cache comprises a cache threshold length;
before querying the corresponding location, the corresponding storage location of the first packet in the cache is first determined, and the specific implementation steps of determining the location may be as follows:
the cat viewing terminal acquires a first video network serial number of the first message;
and the cat terminal obtains a remainder of the first video network serial number to the cache threshold length, and determines the remainder as a first corresponding position number of the first message in the cache.
Because the length of the cache threshold is fixed, and the number of bits of the video network serial number carried by the video network message header is also fixed, the first video network serial number and the length of the cache threshold are counted in percentage, and the remainder is taken, so that the circulating traversal of the remainder can be realized. Because the serial number of the video network of the same fragmentation message is fixed, the serial number of the fragmentation message takes the remainder of the length of the cache threshold value, and the obtained first corresponding position number is also fixed. The video networking messages are sent to the video networking terminal in a periodic mode, namely, the video networking server continuously sends a certain service signaling to the video networking terminal in a broadcast mode, the service signaling comprises a plurality of different video networking messages, and after all the video networking messages of the service signaling are sent completely, the video networking server repeatedly sends the service signaling to the video networking terminal. Therefore, the cat viewing terminal can receive the video network message (fragment message) twice in a time period, so that the circulating traversal of the remainder can be realized, namely, a step of inquiring whether the first corresponding position number of the first fragment message in the cache is occupied occurs.
And a second substep: if the first corresponding position is not occupied, the cat viewing terminal stores the first message into the first corresponding position;
and a third substep: and if the first corresponding position is occupied, the cat viewing terminal clears the content of the first corresponding position and stores the first message into the first corresponding position.
When the recognition result of the cat viewing terminal on the fragment message is a second message, the cat viewing terminal may specifically execute the following steps:
step S506: the cat viewing terminal judges whether a target first message corresponding to the second message exists in a cache;
and the cat viewing terminal can judge whether a target first message corresponding to the second message exists in the cache or not according to the fragment identifier and the second fragment identifier.
Step S507: if the target first message exists in the cache, the cat viewing terminal recombines the second message and the target first message to generate an internet message, and sends the internet message to an internet terminal;
the above-mentioned reorganization step is basically the same as the implementation principle of step S504, and the principle is not described too much here, and the specific implementation manner of the reorganization step is as follows:
the cat viewing terminal disassembles the second message and the target first message into a video networking message header and a load;
the cat viewing terminal splices the load of the second message and the load of the target first message;
and the cat terminal adds an internet message header to the spliced load to generate an internet message.
Step S508: and if the cache does not contain the target first message, the cat viewing terminal stores the second message into the cache.
The implementation principle of step S508 is substantially the same as that of step S505, and is not described here too much.
The specific implementation of the storage cache is as follows:
if the cache does not contain the target first message, the cat viewing terminal judges whether a second corresponding position of the second message in the cache is occupied or not;
if the second corresponding position is not occupied, the cat viewing terminal stores the second message into the second corresponding position;
and if the second corresponding position is occupied, the cat viewing terminal clears the content of the second corresponding position and stores the second message into the second corresponding position.
Determining a second corresponding position of the second packet in the cache, wherein the specific implementation steps of the position determining mode may be as follows:
the cat viewing terminal acquires a second video network serial number of the second message;
and the cat terminal obtains a remainder of the second video network serial number to the cache threshold length, and determines the remainder as a second corresponding position number of the second message in the cache. The principle of traversing the remainder of the second packet is described with reference to the first packet, but not to mention it.
In conclusion, after the cat viewing terminal stores the first message into the first corresponding position, the cat viewing terminal can wait for the arrival of a target second message; or after the second message is stored in the second corresponding position, the arrival of the target first message can be waited, so that the data recombination is realized. According to the embodiment of the application, the aim of avoiding discarding the fragment message and reducing the packet loss rate can be achieved when the data forwarded by the cat viewing terminal or the cat viewing server is out of order within a small range.
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 2:
as shown in fig. 6, corresponding to the method in embodiment 1, a block diagram of a structure of a device for processing messages out of order in an embodiment of the present application is shown, where the device may be applied to a video network, where the video network includes a cat terminal and an internet terminal connected to the cat terminal, and the cat terminal may specifically include the following modules:
a video networking message judgment module 601, configured to judge, for a currently received video networking message, whether the video networking message is a fragment message;
a fragment message identification module 602, configured to identify, when the video network message is a fragment message, that the fragment message is a first message or a second message;
when the recognition result is the first message, the method comprises the following modules:
a first cache determining module 603, configured to determine whether a second target packet corresponding to the first packet exists in a cache;
a first message reassembly module 604, configured to reassemble the first message and the target second message to generate an internet message when the target second message is in the cache, and send the internet message to an internet terminal;
a first message storing module 605, configured to store the first message into the cache when the target second message is not present in the cache;
when the identification result is the second message, the method comprises the following modules:
a second cache determining module 606, configured to determine whether a target first packet corresponding to the second packet exists in a cache;
a second packet reassembly module 607, configured to, when the target first packet is in the cache, reassemble the second packet with the target first packet to generate an internet packet, and send the internet packet to an internet terminal;
a second message storing module 608, configured to store the second message into the cache when the target first message is not present in the cache.
Corresponding to the method in embodiment 1 of the present application, the cat viewing terminal may specifically include the following modules:
a message disassembling module, configured to disassemble both the first message and the target second message into a video networking message header and a load, or disassemble both the second message and the target first message into a video networking message header and a load;
the load splicing module is used for splicing the load of the first message and the target second message or splicing the load of the second message and the target first message;
and the internet message generation module is used for adding an internet message header to the spliced load to generate an internet message.
Corresponding to the method in embodiment 1 of the present application, the cat viewing terminal may specifically include the following modules:
the video network serial number acquisition module is used for acquiring a first video network serial number of the first message or a second video network serial number of the second message;
a corresponding position determining module, configured to take a remainder of the first video network serial number for the cache threshold length, and determine the remainder as a first corresponding position number of the first packet in the cache; or the cat terminal takes the remainder of the second video network serial number to the cache threshold length, and determines the remainder as the second corresponding position number of the second message in the cache.
Corresponding to the method in embodiment 1 of the present application, the first message storage module 605 may specifically include the following sub-modules:
the first corresponding position judgment sub-module is used for judging whether the first corresponding position of the first message in the cache is occupied or not by the cat viewing terminal when the target second message does not exist in the cache;
the first message storage sub-module is used for storing the first message into a first corresponding position when the first corresponding position is not occupied;
and the first message replacing submodule is used for clearing the content of the first corresponding position and storing the first message into the first corresponding position when the first corresponding position is occupied.
Corresponding to the method in embodiment 1 of the present application, the second message storage module 608 may specifically include the following sub-modules:
a second corresponding position judgment sub-module, configured to judge whether a second corresponding position of the second packet in the cache is occupied when the target first packet is not present in the cache;
the second message storage submodule is used for storing the second message into a second corresponding position when the second corresponding position is not occupied;
and the second message replacing submodule is used for clearing the content of the second corresponding position and storing the second message into the second corresponding position when the second corresponding position is occupied.
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 detailed description is given above to a method and a device for processing a message out-of-order provided by the present application, and a specific example is applied in the present application to explain the principle and the implementation manner of the present application, and the description of the above embodiment is only used to help understand the method and the core idea 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 message out-of-order processing method is applied to a video network, wherein the video network comprises a modem terminal and an Internet terminal connected with the modem terminal, and the method comprises the following steps:
the method comprises the steps that the cat viewing terminal judges whether a video networking message is a fragment message or not according to the currently received video networking message;
if so, the cat terminal identifies that the fragment message is a first message or a second message, the size of the first message is the size of a standard video network data packet, the size of the second fragment message is the size obtained by subtracting the standard video network data packet from the video network message, and the size of one standard video network data packet is suitable for transmission in the video network;
when the recognition result is the first message, the method comprises the following steps:
the cat viewing terminal judges whether a target second message corresponding to the first message exists in a cache or not;
if the target second message exists in the cache, the cat viewing terminal recombines the first message and the target second message to generate an internet message, and sends the internet message to the internet terminal;
if the target second message does not exist in the cache, the cat viewing terminal stores the first message into the cache;
when the identification result is the second message, the method comprises the following steps:
the cat viewing terminal judges whether a target first message corresponding to the second message exists in a cache;
if the target first message exists in the cache, the cat viewing terminal recombines the second message and the target first message to generate an internet message, and sends the internet message to the internet terminal;
and if the cache does not contain the target first message, the cat viewing terminal stores the second message into the cache.
2. The method of claim 1,
the fragment message comprises a video network message header and a load;
the video network message header carries a fragment identifier, and the fragment identifier comprises a first fragment identifier or a second fragment identifier.
3. The method according to claim 2, wherein the step of recombining, by the cat viewing terminal, the first message with the target second message, or recombining the second message with the target first message to generate the internet message comprises:
the cat viewing terminal disassembles the first message and the target second message into a video networking message header and a load, or disassembles the second message and the target first message into a video networking message header and a load;
the cat viewing terminal splices the load of the first message and the load of the target second message, or splices the load of the second message and the load of the target first message;
and the cat terminal adds an internet message header to the spliced load to generate an internet message.
4. The method of claim 2, wherein the video network header further carries a video network sequence number; the cache comprises a cache threshold length;
before the step of storing the first message or the second message into the cache by the cat viewing terminal, the method further includes:
the cat viewing terminal acquires a first video network serial number of the first message or a second video network serial number of the second message;
the cat terminal obtains a remainder of the first video network serial number to the cache threshold length, and the remainder is determined as a first corresponding position number of the first message in the cache; or taking the remainder of the second video network serial number to the cache threshold length, and determining the remainder as the serial number of the second corresponding position of the second message in the cache.
5. The method according to claim 4, wherein if the cache does not contain the target second message, the step of storing the first message into the cache by the FeiTo terminal comprises:
if the cache does not contain the target second message, the cat viewing terminal judges whether a first corresponding position of the first message in the cache is occupied or not;
if the first corresponding position is not occupied, the cat viewing terminal stores the first message into the first corresponding position;
and if the first corresponding position is occupied, the cat viewing terminal clears the content of the first corresponding position and stores the first message into the first corresponding position.
6. The method according to claim 4, wherein if the cache does not contain the target first message, the step of storing the second message into the cache by the cat-over-video terminal comprises:
if the cache does not contain the target first message, the cat viewing terminal judges whether a second corresponding position of the second message in the cache is occupied or not;
if the second corresponding position is not occupied, the cat viewing terminal stores the second message into the second corresponding position;
and if the second corresponding position is occupied, the cat viewing terminal clears the content of the second corresponding position and stores the second message into the second corresponding position.
7. The method according to claim 1, wherein the FeiMa terminal comprises a FeiMa client and a FeiMa server; the internet terminal comprises a user terminal based on an internet protocol and an internet website server;
when the cat viewing terminal is a cat viewing client, the internet terminal is a user terminal;
and when the cat viewing terminal is a cat viewing server, the internet terminal is an internet website server.
8. The utility model provides a processing apparatus of messaged, its characterized in that, the device is applied to in the video networking, the video networking includes the cat terminal of looking allies oneself with, with the internet terminal that cat terminal of looking allies oneself with is connected, the cat terminal of looking allies oneself with includes:
the video networking message judgment module is used for judging whether the video networking message is a fragment message or not according to the currently received video networking message;
the fragment message identification module is used for identifying the fragment message as a first message or a second message when the video network message is a fragment message; the size of the first fragment of message is the size of a standard video networking data packet, the size of the second fragment of message is the size obtained by subtracting the standard video networking data packet from the video networking message, and the size of one standard video networking data packet is suitable for being transmitted in the video networking;
when the recognition result is the first message, the method comprises the following modules:
the first cache judging module is used for judging whether a target second message corresponding to the first message exists in the cache;
the message first recombination module is used for recombining the first message and the target second message to generate an internet message and sending the internet message to the internet terminal when the target second message exists in the cache;
the first message storing module is used for storing the first message into the cache when the target second message does not exist in the cache;
when the identification result is the second message, the method comprises the following modules:
the second cache judging module is used for judging whether a target first message corresponding to the second message exists in the cache;
the message second recombination module is used for recombining the second message and the target first message to generate an internet message and sending the internet message to the internet terminal when the target first message exists in the cache;
and the second message storing module is used for storing the second message into the cache when the target first message does not exist in the cache.
9. An apparatus for processing packets out of order, 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.
CN201910100778.2A 2019-01-31 2019-01-31 Message out-of-order processing method and device Active CN109889779B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910100778.2A CN109889779B (en) 2019-01-31 2019-01-31 Message out-of-order processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910100778.2A CN109889779B (en) 2019-01-31 2019-01-31 Message out-of-order processing method and device

Publications (2)

Publication Number Publication Date
CN109889779A CN109889779A (en) 2019-06-14
CN109889779B true CN109889779B (en) 2021-04-23

Family

ID=66927645

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910100778.2A Active CN109889779B (en) 2019-01-31 2019-01-31 Message out-of-order processing method and device

Country Status (1)

Country Link
CN (1) CN109889779B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110336796B (en) * 2019-06-17 2022-06-14 视联动力信息技术股份有限公司 Communication method and communication device
CN110380946A (en) * 2019-06-17 2019-10-25 视联动力信息技术股份有限公司 A kind of communication means and communication device
CN110401513B (en) * 2019-08-02 2021-12-17 视联动力信息技术股份有限公司 Data transmission method and device
CN110958331A (en) * 2019-12-27 2020-04-03 视联动力信息技术股份有限公司 Data transmission method and terminal
CN115529286A (en) * 2022-08-29 2022-12-27 北京明朝万达科技股份有限公司 Message reassembly method, message reassembly device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101286945A (en) * 2008-05-22 2008-10-15 北京星网锐捷网络技术有限公司 Method and apparatus for processing of data fragmentation
CN101917472A (en) * 2010-08-12 2010-12-15 北京星网锐捷网络技术有限公司 Method, device and equipment for recombining multi-link messages
EP2316201A1 (en) * 2008-06-23 2011-05-04 Alcatel-Lucent USA Inc. Processing of packet fragments
CN102546397A (en) * 2011-12-16 2012-07-04 福建星网锐捷网络有限公司 Method, apparatus and device for balancing traffic of uplink aggregation port
CN104579948A (en) * 2013-10-29 2015-04-29 国家计算机网络与信息安全管理中心 Method and device for fragmenting message
JP2017212487A (en) * 2016-05-23 2017-11-30 Necプラットフォームズ株式会社 Ip fragmenting device, ip de-fragmenting device, ip fragment packet communication system, ip fragment packet transmission method, ip fragment packet de-fragmenting method, ip fragment packet communication method, and program

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107342955B (en) * 2017-06-29 2020-09-22 迈普通信技术股份有限公司 Data message fragmentation method and device and data message recombination method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101286945A (en) * 2008-05-22 2008-10-15 北京星网锐捷网络技术有限公司 Method and apparatus for processing of data fragmentation
EP2316201A1 (en) * 2008-06-23 2011-05-04 Alcatel-Lucent USA Inc. Processing of packet fragments
CN101917472A (en) * 2010-08-12 2010-12-15 北京星网锐捷网络技术有限公司 Method, device and equipment for recombining multi-link messages
CN102546397A (en) * 2011-12-16 2012-07-04 福建星网锐捷网络有限公司 Method, apparatus and device for balancing traffic of uplink aggregation port
CN104579948A (en) * 2013-10-29 2015-04-29 国家计算机网络与信息安全管理中心 Method and device for fragmenting message
JP2017212487A (en) * 2016-05-23 2017-11-30 Necプラットフォームズ株式会社 Ip fragmenting device, ip de-fragmenting device, ip fragment packet communication system, ip fragment packet transmission method, ip fragment packet de-fragmenting method, ip fragment packet communication method, and program

Also Published As

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

Similar Documents

Publication Publication Date Title
CN109889779B (en) Message out-of-order processing method and device
CN109996086B (en) Method and device for inquiring service state of video networking
CN111193788A (en) Audio and video stream load balancing method and device
CN109617956B (en) Data processing method and device
CN110190973B (en) Online state detection method and device
CN109889373B (en) Method, device and system for transmitting alarm information
CN109120879B (en) Video conference processing method and system
CN110022295B (en) Data transmission method and video networking system
CN109768963B (en) Conference opening method and system based on video network
CN108881948B (en) Method and system for video inspection network polling monitoring video
CN110049273B (en) Video networking-based conference recording method and transfer server
CN109040656B (en) Video conference processing method and system
CN110557319B (en) Message processing method and device based on video network
CN109743284B (en) Video processing method and system based on video network
CN111211982B (en) Data forwarding method and device, electronic equipment and storage medium
CN109889516B (en) Method and device for establishing session channel
CN110336710B (en) Terminal testing method, system and device and storage medium
CN110493149B (en) Message processing method and device
CN110446058B (en) Video acquisition method, system, device and computer readable storage medium
CN109698953B (en) State detection method and system for video network monitoring equipment
CN109861929B (en) Data caching processing method and device
CN110557411A (en) video stream processing method and device based on video network
CN110493311B (en) Service processing method and device
CN110213533B (en) Method and device for acquiring video stream monitored by video network
CN110557687B (en) Multicast data packet processing method, device and storage medium

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