CN111787416A - Data packet processing method and device and readable storage medium - Google Patents

Data packet processing method and device and readable storage medium Download PDF

Info

Publication number
CN111787416A
CN111787416A CN202010437804.3A CN202010437804A CN111787416A CN 111787416 A CN111787416 A CN 111787416A CN 202010437804 A CN202010437804 A CN 202010437804A CN 111787416 A CN111787416 A CN 111787416A
Authority
CN
China
Prior art keywords
data
packet
video networking
service type
length
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010437804.3A
Other languages
Chinese (zh)
Inventor
贺传森
王晓燕
亓娜
王艳辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 CN202010437804.3A priority Critical patent/CN111787416A/en
Publication of CN111787416A publication Critical patent/CN111787416A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/60Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client 
    • H04N21/63Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing
    • H04N21/643Communication protocols

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the invention provides a data packet processing method, a data packet processing device and a readable storage medium, wherein the method comprises the following steps: first data with preset length is sequentially acquired from the head of a service data queue of the video network equipment, if a service type identifier in the first data does not belong to the video network service type identifier, then based on the first video networking protocol data packet stored by the video networking device and/or the second data in the traffic data queue, updating the first data, taking the updated first data as target data under the condition that the service type identification in the updated first data belongs to the video network service type identification, acquiring second packet data from the second data according to the set length in the target data and the length of the first packet data included in the first data, and under the condition that the first length of the acquired third packet data is equal to the set length, performing service processing on the third packet data, so that the stability of the video networking service system is improved.

Description

Data packet processing method and device and readable storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for processing a data packet, and a readable storage medium.
Background
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.
At present, video networking services implemented through video networking are increasing. The video networking service comprises, for example, a video conference service, a video telephone service, a live broadcast distribution service, and the like, each video networking service has a corresponding video networking service system, and the video networking service system realizes normal operation of the video networking service through communication with a core server.
However, when the existing video networking service system communicates with the core server, the data packets sent by the core server are analyzed strictly according to the video networking protocol, and when the data packets sent by the core server are in error or under abnormal conditions such as errors in data in the data packets acquired by the video networking service system, the video networking service system is in a failure state.
Disclosure of Invention
Embodiments of the present invention provide a data packet processing method, an apparatus, and a readable storage medium, so as to avoid a failure of a video networking service system under abnormal conditions, such as an error occurring in a data packet sent by a core server or an error occurring in data in a data packet acquired by the video networking service system, thereby improving stability of the video networking service system. The specific technical scheme is as follows:
in a first aspect of the present invention, a method for processing a data packet is first provided, where the method is applied to a video networking device deployed with a video networking service system, and includes:
sequentially acquiring first data with a preset length from the head of a service data queue of the video networking equipment;
if the service type identification in the first data does not belong to the video networking service type identification, updating the first data according to a first video networking protocol data packet currently stored by the video networking equipment and/or second data in the service data queue, and taking the updated first data as target data under the condition that the service type identification in the updated first data belongs to the video networking service type identification;
acquiring second packet data from the second data according to the set length in the target data and the length of the first packet data included in the first data;
and under the condition that the first length of the acquired third packet data is equal to the set length, performing service processing on the third packet data, wherein the third packet data comprises the first packet data and the second packet data.
In a second aspect of the present invention, there is also provided a packet processing apparatus, including:
the first acquisition module is used for sequentially acquiring first data with preset length from the head of a service data queue of the video networking equipment;
the updating module is used for updating the first data according to a first video networking protocol data packet currently stored by the video networking equipment and/or second data in the service data queue if the service type identifier in the first data does not belong to a video networking service type identifier, and taking the updated first data as target data under the condition that the service type identifier in the updated first data belongs to the video networking service type identifier;
a second obtaining module, configured to obtain second packet data from the second data according to a set length in the target data and a length of the first packet data included in the first data;
and the processing module is used for performing service processing on the third packet data under the condition that the first length of the acquired third packet data is equal to the set length, wherein the third packet data comprises the first packet data and the second packet data.
In a third aspect of the embodiments of the present invention, there is provided a packet processing 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 the packet processing methods described above.
In a fourth aspect of the present invention, a computer-readable storage medium is provided, which stores a computer program for causing a processor to execute the packet processing method described above.
Aiming at the prior art, the invention has the following advantages:
the data packet processing method provided by the embodiment of the invention sequentially obtains the first data with the preset length from the head of the service data queue of the video networking equipment, if the service type identifier in the first data does not belong to the video networking service type identifier, then based on the first video networking protocol data packet stored by the video networking device and/or the second data in the traffic data queue, updating the first data, taking the updated first data as target data under the condition that the service type identification in the updated first data belongs to the video network service type identification, acquiring second packet data from the second data according to the set length in the target data and the length of the first packet data included in the first data, and under the condition that the first length of the acquired third packet data is equal to the set length, performing service processing on the third packet data. Under the condition that the service type identification in the first data does not belong to the video networking service type identification, the first data is updated according to the first video networking protocol data packet currently stored by the video networking equipment and/or the second data in the service data queue, the service type identification in the updated first data can belong to the video networking service type identification, the updated first data is further used as target data, the second packet data is obtained from the second data according to the set length in the target data and the length of the first packet data included in the first data, and the third packet data is subjected to service processing under the condition that the first length of the obtained third packet data is equal to the set length, so that the stability of the video networking service system under abnormal conditions is guaranteed. The problem that in the prior art, when the video networking service system or the core server is abnormal, the video networking service system does not include the video networking service type identifier in the first data with the preset length, the first data with the preset length is obtained again, and the video networking service type identifier is still not included in the first data with the preset length, so that the video networking service type identifier is not included in the first data with the preset length continuously obtained subsequently, and the service cannot be used is solved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below.
Fig. 1 is a flowchart illustrating steps of a data packet processing method according to an embodiment of the present invention;
FIG. 2 is a flow chart illustrating steps of another method for processing data packets in accordance with an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a packet processing apparatus according to an embodiment of the present invention;
FIG. 4 is a networking schematic of a video network of the present invention;
FIG. 5 is a schematic diagram of a hardware architecture of a node server according to the present invention;
fig. 6 is a schematic diagram of a hardware structure of an access switch of the present invention;
fig. 7 is a schematic diagram of a hardware structure of an ethernet protocol conversion gateway according to the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention.
Referring to fig. 1, fig. 1 is a flowchart illustrating steps of a data packet processing method according to an embodiment of the present invention. The method is applied to video networking equipment with a video networking service system, wherein the video networking service system can comprise a video networking conference management system, a live broadcasting service publishing system, a live broadcasting service watching system and the like, the video networking equipment can be electronic equipment such as a notebook computer, a desktop computer and the like, and the method comprises the following steps:
step 101, sequentially acquiring first data with a preset length from the head of a service data queue of the video networking device.
The video networking service system may be communicatively connected to one or more core servers through a Transmission Control Protocol (TCP) socket, and log in to the core servers using an account registered in the core servers, so that response data sent by the core servers may be received and stored in a service data queue. For example, the video networking service system sends a conference opening request to the core server, the core server sends conference response data to the video networking service system in response to the conference opening request, and the video networking service system stores the conference response data in the service data queue.
The preset length indicates the number of bytes, for example, when the preset length is equal to 4, it indicates that 4 bytes need to be acquired.
It should be noted that the common header of the video networking transport protocol data packet includes 4 bytes, the first 2 bytes of the 4 bytes include information such as a service type identifier, and the second 2 bytes include information such as a set length of service data corresponding to the service type identifier. The service type identifier is used to identify a certain type of service in the video network, for example, 0x6101 represents user management, and 0x6102 represents device management.
And 102, if the service type identifier in the first data does not belong to the video networking service type identifier, updating the first data according to a first video networking protocol data packet currently stored by the video networking equipment and/or second data in a service data queue, and taking the updated first data as target data under the condition that the service type identifier in the updated first data belongs to the video networking service type identifier.
In the prior art, when a data packet sent by a core server has no error and data in the data packet acquired by a video networking service system has no error, first data of a first preset length acquired by the video networking service system is data of 4 bytes of a common header of the data packet sent by the core server (the data of the 4 bytes of the common header is header data), the first two bytes of the 4 bytes are service type identifiers of the video networking of the data packet, the last two bytes of the 4 bytes are set lengths of packet body data, except the common header, in the data packet set by the core server, the video networking service system acquires the packet body data with the same set length from a service data queue, and further performs service processing on the packet body data. However, in the case that an error occurs in a data packet sent by the core server or an error occurs in data in a data packet acquired by the video networking service system, the first data with the preset length acquired by the video networking service system is not data with 4 bytes of the common header, the data with the first two bytes of the acquired 4 bytes is not the video networking service type identifier, and the length of the packet data of the data packet acquired by the video networking service system is not equal to the set length, and in this case, when the video networking service system still performs processing (e.g., parsing) on the acquired packet data, the parsing result is incorrect, and then 4 bytes are continuously acquired from the service data queue to continuously acquire the packet data of the data packet and the parsing result obtained when the packet data is processed is incorrect, so that the cycle may still cause the service system to be paralyzed, The problem of being unusable.
For example, if the set length of the data packet set by the core server is greater than or less than the actual length of the packet body data, the length of the packet body data of the data packet acquired by the video networking service system is not equal to the actual length of the data packet, so that the data acquired subsequently by the video networking service system is erroneous. For example, to simplify the description, in the embodiment of the present invention, two numbers are used to represent one byte, two response packets (response packet 1 and response packet 2) returned by the core server to the video network service system are provided, the service type identifiers are 6101 and 6102, and normally, the packet body data in each response packet except the common header is 10 bytes, for the reason of the core server, the last two bytes of the common header of the response packet 1 are assigned with 11 when a data encapsulation error occurs in the last two bytes of the common header of the response packet 1, for example, when the core server encapsulates the service data with the service type identifier 6101 with a data length, that is, the length of the data in the response packet 1 except the 4 bytes of the common header is set to 11.
Response packet 1 is: 6101001100110011001100110011, wherein 61010011 is 4 bytes of the common header of the response packet 1, and the remaining 10 bytes other than the 4 bytes are the body data of the response packet 1; response packet 2 is: 6102001011001100110011001100, wherein 61020010 is 4 bytes of the common header of the response packet 2, and the remaining 10 bytes other than the 4 bytes are the body data of the response packet 2.
Before the video networking service system starts to acquire data from the service data queue, the head of the service data queue starts to store the response data packet 1 and the response data packet 2 in sequence, after the video networking service system acquires the first 4 bytes of the response data packet 1, because the set length in the first 4 bytes is equal to 11, after the video networking service system acquires the 10-byte packet body data of the response data packet 1, the first byte 61 of the common head of the response data packet 2 is acquired (namely the length 11 of the acquired packet body data of the response data packet 1 is not equal to the actual length 10 of the data packet), then the continuous 4 bytes of the response data packet 2 are acquired (02001011), the service type identification represented by the data in the first two bytes in the 4 bytes is not the video networking service type identification, and in the case that other data besides the 4 bytes exist in the service data queue, the video network service system takes 4 bytes after the 4 bytes again, and the first two bytes in the 4 bytes obtained again are still not the video network service type identification, so that the subsequently obtained packet header data are continuous and wrong, and the video network service system cannot be used.
Errors occur to data in data packets acquired by the video networking service system, for example during acquisition of payload content, if the video networking service system is acquired too fast, and the packet body data acquired by the video networking service system is smaller than the set length of the packet body data in the data packet due to network reasons or the core server is sent out too slowly, for example, the length is set to 10 bytes, and only 9 bytes in the service data queue (for example, for network reasons, etc., the remaining 1 byte is not stored in the service data queue), therefore, the data acquired by the video networking service system at this time is finally 9 bytes, so that the length of the packet data acquired by the video networking service system is not equal to the actual length of the packet data, and the remaining 1 residual byte can cause the packet header data error subsequently acquired by the video networking service system, so that the service system is paralyzed and cannot process subsequent services.
In order to solve the above problem, in this step, it may be determined whether the service type identifier in the first data belongs to a video networking service type identifier, if the service type identifier in the first data does not belong to the video networking service type identifier, the first data may be updated according to a first video networking protocol data packet currently stored in the video networking device and/or second data in a service data queue, and in a case that the service type identifier in the updated first data belongs to the video networking service type identifier, the updated first data is used as target data, and then step 103 is executed again, so as to ensure that a next data packet in the service data queue is normally obtained, thereby ensuring normal operation of the video networking service.
Wherein, step 102 can be realized by the following steps:
if the service type identification in the first data does not belong to the video networking service type identification, removing the last first byte in the first data, and adding the last second byte in the first video networking protocol data packet to the front of first remaining data in the first data except the first byte so as to update the first data to obtain first target data;
and if the service type identification in the first target data belongs to the video networking service type identification, taking the first target data as target data.
In connection with the above example, for example, after the video networking service system acquires the first 4 bytes of the response packet 1, since the set length in the first 4 bytes is equal to 11, after the video networking service system acquires the 10 bytes of the packet body data of the response packet 1, the first byte 61 of the common header of the response packet 2 is acquired, and then the consecutive 4 bytes (02001011) after the first byte of the response packet 2 are acquired, so as to determine whether the data of the first two bytes of the acquired 4 bytes is the video networking service type identifier, and at this time, an error occurs because the first two bytes of the acquired 4 bytes 02001011 (at this time, 02001011 is the first data) do not belong to the video networking service type identifier. In this case, in the embodiment of the present invention, the first data may be updated according to the first video networking protocol data packet currently stored by the video networking device, so that the service type identifier included in the finally updated data is the video networking service type identifier. Specifically, for example, the first preset-length first data obtained by the service data queue by the video networking service system is 61010011, then 11 bytes of data are obtained according to the set length 11 in 61010011, that is, 11 bytes of data in total are obtained 0011001100110011001161 (61 is the first byte in the header data of the response packet 2, that is, the data obtained from the second data at this time is 610100110011001100110011001161), and the first data and the 11 bytes of data are stored as a first video networking protocol data packet, that is, the currently stored first video networking protocol data packet is: 610100110011001100110011001161, after the video networking service system obtains 610100110011001100110011001161 from the service data queue, the service data queue does not include 610100110011001100110011001161, then the video networking service system continues to obtain first data (02001011) with preset length from the head of the current service data queue again from the second data in the service data queue, because the video networking service type identifier is not included in 02001011, the last byte 11 in the first data 02001011 is removed, 61(61 is the last second byte in the first video networking protocol data packet stored currently) is added before 020010, so as to obtain first target data 61020010, and because the service type identifier in the first target data 61020010 belongs to the video networking service type identifier, the first target data is taken as target data.
And 103, acquiring second packet data from the second data according to the set length in the target data and the length of the first packet data included in the first data.
And 104, performing service processing on the third packet data under the condition that the first length of the acquired third packet data is equal to the set length.
The third packet body data is packet body data of a second video networking protocol data packet, and the target data is packet head data of the second video networking protocol data packet.
With reference to the foregoing example, in step 103 and step 104, when the first data is 02001011, the last byte 11 in the obtained first data is the body data of the response data packet 2, that is, the body data of one byte has been currently obtained, the length of the first body data is equal to 1, only after the first 5 bytes (the first 5 bytes are 6102001011) in the response data packet 2, the data of 9 bytes is sequentially obtained, that is, the body data of 10 bytes of the response data packet 2 is obtained, the first length of the obtained third body data is equal to 10, and then the third body data is subjected to service processing, where performing service processing on the third body data includes parsing the third body data, detecting whether the video networking protocol is satisfied, and determining whether the service is successful or not according to the parsed attribute value.
It should be noted that, when the first length of the third packet data is equal to 10, the currently acquired video networking protocol data packet is used to replace the currently stored first video networking protocol data packet, so as to use the currently acquired video networking protocol data packet as the first video networking protocol data packet currently stored by the video networking device. Under the condition that the first length of the third packet data is equal to 10, the currently acquired video networking protocol data packet includes packet header data (target data is packet header data) and packet body data, the third packet data is packet body data in the currently acquired video networking protocol data packet, and the currently acquired video networking protocol data packet can be used as the currently stored first video networking protocol data packet. When the first data with the preset length is obtained again, under the condition that the obtained first data does not include the video networking service type identifier, the obtained first data can be updated according to the currently stored first video networking protocol data packet (namely, the currently obtained video networking protocol data packet).
In the data packet processing method provided in this embodiment, first data with a preset length is sequentially obtained from the head of a service data queue of an internet of view device, and if a service type identifier in the first data does not belong to an internet of view service type identifier, then based on the first video networking protocol data packet stored by the video networking device and/or the second data in the traffic data queue, updating the first data, taking the updated first data as target data under the condition that the service type identification in the updated first data belongs to the video network service type identification, acquiring second packet data from the second data according to the set length in the target data and the length of third packet data included in the first data, and under the condition that the first length of the acquired third packet data is equal to the set length, performing service processing on the third packet data. Since the service type identification in the first data does not belong to the internet-of-view service type identification, according to the first video network protocol data packet currently stored by the video network equipment and/or the second data in the service data queue, updating the first data to enable the service type identification in the updated first data to belong to the video network service type identification, further taking the updated first data as target data, acquiring third packet data according to the set length in the target data, and acquiring second packet data from the second data according to the set length in the target data and the length of the third packet data included in the first data, in the case where the first length of the acquired third packet data is equal to the set length, and the third packet data is subjected to service processing, so that the stability of the video networking service system under the abnormal condition is ensured. The problem that in the prior art, when the video networking service system or the core server is abnormal, the video networking service system does not include the video networking service type identifier in the first data with the preset length, the first data with the preset length is obtained again, and the video networking service type identifier is still not included in the first data with the preset length, so that the video networking service type identifier is not included in the first data with the preset length continuously obtained subsequently, and the service cannot be used is solved.
Referring to fig. 2, fig. 2 is a flowchart illustrating steps of another data packet processing method provided in an embodiment of the present invention, where the method includes the following steps:
step 201, first data with a preset length is sequentially acquired from the head of a service data queue of the video networking device.
Step 202, if the service type identifier in the first data does not belong to the video networking service type identifier, removing the last first byte in the first data, and adding the last second byte in the first video networking protocol data packet to the front of the first remaining data in the first data except the first byte, so as to update the first data, thereby obtaining the first target data.
It should be noted that, if the service type identifier in the first data belongs to the service type identifier of the video network, third data is obtained from the second data, and if the length of the third data is equal to the set length, service processing is performed on the third data. For example, in combination with the above example, the first 4 bytes in the get response packet 1 are 61010011 (i.e. the first data is 61010011), and the service type identifier in the first data belongs to the internet-of-view service type identifier, that is, 11 bytes are obtained from the second data according to the set length (the set length is equal to 11) in the first data, that is, 11 bytes are obtained sequentially from 61010011.
If the length of the third data is smaller than the set length, sequentially acquiring data with the length equal to N from the head parts of other data behind the third data, and accumulating the data with the length equal to N to the third data to obtain accumulated data, wherein N is equal to the difference value between the set length and the length of the third data. For example, in the case of setting the length equal to 10, if the service data queue only includes data of 9 bytes after 61010011, and the video network service system can only acquire data of 9 bytes, that is, the length of the third data is 9, it is necessary to cyclically acquire the last byte in the response packet 1 (wait for the core server to continue sending the last byte in the response packet 1 to the service data queue and the video network service system to acquire the last byte from the service data queue), accumulate the data of the last byte into the third data of length 9 to obtain accumulated data, and the accumulated data includes the third data and data of length equal to 1 after the third data (at this time, N is equal to 1). Therefore, the sum of the length of the finally obtained third data and the N is equal to the set length, and finally, the accumulated data is subjected to service processing.
Step 203, judging whether the service type identification in the first target data belongs to the video networking service type identification.
If the service type identifier in the first target data belongs to the video networking service type identifier, executing step 204; if the service type identifier in the first target data does not belong to the service type identifier of the video networking, step 205 is executed.
And step 204, taking the first target data as target data.
Step 206 is performed after step 204 is performed.
Step 205, determining whether a second length of second remaining data except the second byte in the first video networking protocol data packet is greater than a preset length.
If the second length is greater than the predetermined length, go to step 208; if the second length is not greater than the predetermined length, step 210 is performed.
And step 206, acquiring second packet data from the second data according to the set length in the target data and the length of the first packet data included in the first data.
And step 207, performing service processing on the third packet data under the condition that the first length of the acquired third packet data is equal to the set length.
And 208, removing the last third byte in the first target data, and adding the last byte in the second residual data to the front of the third residual data except the third byte in the first target data to update the first target data to obtain the second target data.
For example, before the service system of the video network starts to acquire data from the service data queue, if the second data stored in the service data queue is the response data packet 3, the response data packet 4, and the response data packet 5 in sequence, where the data of the response data packet 3 is:
6101001200110011001100110011;
the data of the response packet 4 is: 6102001011001100110011001100, respectively;
response packet 5 is: 6102001011001100110011001100. if, after obtaining the header data 61010012 of the response packet 3, it is determined 6101 to be the video networking service type identifier, and the set length in the header data is equal to 12, then 12 bytes of data are obtained from 61010012, that is, the obtained video networking protocol packet is: 61010012001100110011001100116101 (storing the currently acquired video networking protocol data packet and using the currently acquired video networking protocol data packet as the currently stored first video networking protocol data packet), then acquiring the first data (i.e. 00100011) of the preset length from the other data except 6101 in the response data packet 4, and since the video networking service type identifier is not included in 00100011, performing data up-filtering, i.e. removing the last byte 11 in 00100011, to obtain 001000. And adds the last byte 01 in the first video networking protocol packet to 001000, resulting in 01001000, with 01001000 as the first destination data, since the service type identification in the first target data does not belong to the internet-of-view service type identification, step 205 is performed, namely, judging whether the second length of the second remaining data (the second remaining data is 610100120011001100110011001161) except the second byte in the first video network protocol data packet is larger than the preset length, if so, continuing to perform the data upward filtering, step 207 is executed, i.e. the last third byte 00 in 01001000 is removed, resulting in a third remaining data 010010, and the last byte 61 in the second remaining data is added before 010010, resulting in second target data 61010010, and since the service type identifier in the second target data belongs to the video networking service type identifier, the second target data is taken as target data. If the traffic type identifier in the second destination data 61010010 does not belong to an internet of view traffic type identifier, upward filtering continues to be performed to update the second destination data according to the method described above.
Step 209 may be performed after step 208 is performed.
And 209, if the service type identifier in the second target data belongs to the video networking service type identifier, taking the second target data as target data.
It should be noted that, step 208 may be regarded as a data upward filtering process, and if the service type identifier in the second target data does not belong to the video network service type identifier, the data upward filtering process is continuously performed. Step 206 is executed after step 209 is executed.
Step 210, restoring the first target data to the first data, removing the first byte in the first data, and adding the first byte in the second data to fourth remaining data, so as to update the first data to obtain third target data, where the fourth remaining data is data of the first data except the first byte in the first data.
The first byte in the second data refers to the first byte in other bytes except the acquired data in the current second data. For example, for step 201, first data with a preset length is sequentially obtained from the head of a service data queue of the video network device, the obtained data is the first data, and a first byte in the second data refers to a first byte in other bytes except the first data in the current second data. For example, for the illustration in step 102, the second data in the service data queue includes a response data packet 1 and a response data packet 2, and after the 4 bytes 61010011 of the common header of the response data packet 1 are obtained, the first byte in the current second data is the next byte 00 after 61010011, that is, the bytes other than 61010011 are the body data 00110011001100110011 of the response data packet 1 and the response data packet 2, so that the first byte in the current second data is 00.
It should be noted that, if the service type identifier in the first target data does not belong to the service type identifier of the video networking, and the second length is not greater than the preset length, that is, after performing the upward filtering once, the second length of the second remaining data is not greater than the preset length, step 210 is performed. Step 210 is the process of data down-filtering.
For example, before the service system of the video network starts to acquire data from the service data queue, the second data stored in the service data queue is a response data packet 6 and a response data packet 7 in sequence, where the data of the response data packet 6 is: 6101000900110011001100110011, the response packet 6 has a real length of 10, and the core server encapsulates the packet with a set length of 9. The response packet 7 is: 6102001011001100110011001100, after obtaining the first 4 bytes in the response packet 6, since 6101 belongs to the video network service type identifier, and the length is set equal to 9, then 9 bytes of data are obtained: 001100110011001100, taking 61010009001100110011001100 as a currently acquired video networking protocol data packet, and taking the currently acquired video networking protocol data packet as a first video networking protocol data packet, wherein the header data of the video networking protocol data packet is 61010009, and the body data of the video networking protocol data packet is 001100110011001100. Then, first data with a preset length is obtained, that is, the first two bytes in the obtained first data are 11610200, and the first two bytes in the 11610200 do not include the video network service type identifier, so that upward filtering can be performed first, that is, upward filtering is performed according to the first video network protocol packet 61010009001100110011001100, and the process of performing the first upward filtering is as follows: removing the last byte in 11610200 to obtain 116102, adding the last byte in 61010009001100110011001100 to the position before 116102 to obtain 00116102, because the data of the first two bytes in 00116102 do not belong to the video networking service type identifier, continuing to perform upward filtering, adding the penultimate byte in the first video networking protocol data packet to the position before 001161 to obtain 11001161, and after performing upward filtering for multiple times in a circulating manner until 4 bytes of unused byte data in the first video networking protocol data packet remain, not performing upward filtering again, and beginning to perform step 210 to perform downward filtering.
It should be noted that, if the data of the response packet 6 is: 6101000100110011001100110011, that is, the core server encapsulates the set length to 1, the obtained first video networking protocol data packet is 6101000100, then 4 bytes of data after 6101000100 are obtained (that is, the first data is 11001100), because after performing upward filtering once, 00110011 is obtained, that is, the service type identifier in the first target data 00110011 does not belong to the video networking service type identifier, and the second length of the second remaining data (61010001) in the first video networking protocol data packet 6101000100 except the second byte (the second byte is the last byte 00) is equal to 4, and the second length is not greater than the preset length 4, then downward filtering is performed, and the process of performing downward filtering is, for example:
for example: the downward filtering process is to restore the first target data (00110011) to the first data (11001100), and then add the first byte in the second data to the fourth remaining data, wherein since 6101000100 has been removed from the second data, the first byte in the current second data is 11, that is, 00110011 is obtained after 11 is added to 001100. Since the service type identifiers in the first two bytes in 00110011 do not belong to the service type identifiers of the video networking, the first byte 00 in the current second data is added to 110011 to obtain 11001100, and after downward filtering is performed for multiple times, the header data 61020010 of the response data packet 7 can be obtained, so that the finally obtained service type identifiers of the first two bytes in 4 bytes are the service type identifiers of the video networking.
It should be noted that, if the data of the response packet 6 is: 6101000900110011001100110011, if the service type identifier in the first two bytes of the 4 bytes that cannot be obtained after performing upward filtering for multiple times is the video networking service type identifier, then downward filtering may be performed again on the basis of the first data, that is, it may be achieved that the service type identifier in the obtained third target data belongs to the video networking service type identifier. For example: the first data is 11610200, the first byte 11 in the first data is removed, and the first byte 10 in the second data is added after 610200 (since 3 bytes 610200 have been currently removed from the response packet 7, the first byte in the second data is currently the first byte after 610200 in the response packet 7), resulting in 61020010, which is 61020010 the third destination data. And if the service type identification in the third target data belongs to the video networking service type identification, the third target data is taken as target data.
And step 211, if the service type identifier in the third target data belongs to the service type identifier of the video networking, taking the third target data as target data.
It should be noted that, if the service type identifier in the third target data does not belong to the service type identifier of the video networking, the first byte in the third target data is removed, and the first byte adjacent to the first byte in the second data and located after the first byte in the second data is added to the fifth residual data, so as to update the third target data to obtain fourth target data, where the fifth residual data is data in the third target data except for the first byte in the third target data;
and if the service type identification in the fourth target data belongs to the video networking service type identification, taking the fourth target data as target data.
It should be noted that, the data may also be directly filtered downward, that is, if the service type identifier in the first data does not belong to the video network service type identifier, the first byte in the first data is removed, and after the first byte in the second data is added to the sixth remaining data, the first data is updated to obtain fifth target data, where the sixth remaining data is data in the first data except the first byte in the first data;
and if the service type identifier in the fifth target data belongs to the video networking service type identifier, taking the fifth target data as target data.
The process of directly performing the downward filtering is similar to the above-described downward filtering process, and is not described herein again.
Optionally, the method may further include the following steps:
under the condition that the first length of the acquired third packet data is not equal to the set length in the target data, acquiring third data from second data until the sum of the length of the acquired third data and the first length is equal to the set length, and taking the third packet data and the third data as packet body data of a second video networking protocol data packet;
and replacing the first video networking protocol data packet with the second video networking protocol data packet to take the second video networking protocol data as the currently stored first video networking protocol data packet, and performing service processing on the packet body data of the second video networking protocol data packet.
For example, a first video networking protocol data packet currently stored in the video networking device is a video networking protocol data packet 1, if the set length in the target data is equal to 10, and the first length of the currently acquired third packet data is equal to 7, then 3 bytes of third data need to be acquired again, if 2 bytes of third data are acquired next from the second data, then 1 byte of third data need to be acquired again, until the sum of the length of the third data and the first length is equal to the set length 10, the video networking protocol data packet 1 is replaced by a second video networking protocol data packet, where the second video networking protocol data packet includes header data and body data, the header data is the target data, and the body data includes the third packet data and the third data.
By replacing the first video networking protocol data packet with the second video networking protocol data packet, the first video networking protocol data packet stored currently can be the latest video networking protocol data packet, and after the first data with the preset length is acquired again subsequently, the first data can be upwards filtered according to the latest video networking protocol data packet, so that the header data corresponding to the first data acquired currently can be quickly determined through the latest video networking protocol data packet under the condition that the set length in the acquired first data is greater than the actual length of a certain data packet.
Referring to fig. 3, fig. 3 is a schematic structural diagram of a packet processing apparatus according to an embodiment of the present invention, where the apparatus 300 includes:
a first obtaining module 310, configured to sequentially obtain first data with a preset length from a head of a service data queue of the video networking device;
an updating module 320, configured to update the first data according to a first video networking protocol data packet currently stored by the video networking device and/or second data in the service data queue if the service type identifier in the first data does not belong to a video networking service type identifier, and take the updated first data as target data when the service type identifier in the updated first data belongs to the video networking service type identifier;
a second obtaining module 330, configured to obtain second packet data from the second data according to a set length in the target data and a length of the first packet data included in the first data;
a processing module 340, configured to perform service processing on third packet data when a first length of the obtained third packet data is equal to the set length, where the third packet data includes the first packet data and the second packet data.
Optionally, the updating module 320 is specifically configured to, if the service type identifier in the first data does not belong to the video networking service type identifier, remove a last first byte in the first data, and add a last second byte in the first video networking protocol data packet to a front of first remaining data in the first data, except for the first byte, to update the first data, so as to obtain first target data;
and if the service type identification in the first target data belongs to the video networking service type identification, taking the first target data as the target data.
Optionally, the updating module 320 is further configured to determine whether a second length of second remaining data in the first video networking protocol data packet, except for the second byte, is greater than the preset length if the service type identifier in the first target data does not belong to the video networking service type identifier;
if the second length is greater than the preset length, removing the last third byte in the first target data, and adding the last byte in the second residual data to the first target data before the third residual data except the third byte to update the first target data to obtain second target data;
and if the service type identification in the second target data belongs to the video networking service type identification, taking the second target data as the target data.
Optionally, the updating module 320 is further configured to, if the second length is not greater than the preset length, restore the first target data to the first data, remove a first byte in the first data, add the first byte in the second data to fourth remaining data, and update the first data to obtain third target data, where the fourth remaining data is data of the first data except for the first byte in the first data;
and if the service type identifier in the third target data belongs to the video networking service type identifier, taking the third target data as the target data.
Optionally, the updating module 320 is further configured to, if the service type identifier in the third target data does not belong to the service type identifier of the internet of view, remove a first byte in the third target data, and add a first byte, which is adjacent to the first byte in the second data and is located after the first byte in the second data, to fifth remaining data, so as to update the third target data to obtain fourth target data, where the fifth remaining data is data in the third target data except for the first byte in the third target data;
and if the service type identifier in the fourth target data belongs to the video networking service type identifier, taking the fourth target data as the target data.
The updating module 320 is further configured to, if the service type identifier in the first data does not belong to the service type identifier of the internet of view, remove a first byte in the first data, and add the first byte in the second data to sixth remaining data, so as to update the first data to obtain fifth target data, where the sixth remaining data is data in the first data except for the first byte in the first data;
and if the service type identifier in the fifth target data belongs to the video networking service type identifier, taking the fifth target data as the target data.
Optionally, the method further includes:
a second obtaining module, configured to, when a first length of obtained third packet data is not equal to a set length in the target data, obtain third data from the second data until a sum of the obtained length of the third data and the first length is equal to the set length, and use the third packet data and the third data as packet data of a second video networking protocol data packet;
and the replacing module is used for replacing the first video networking protocol data packet with the second video networking protocol data packet so as to take the second video networking protocol data as the currently stored first video networking protocol data packet and carry out service processing on the packet body data of the second video networking protocol data packet.
In addition, an embodiment of the present invention further provides a packet processing apparatus, where the packet processing apparatus includes:
one or more processors; and
one or more machine-readable media storing instructions thereon, which when executed by the one or more processors, enable the apparatus to perform the processes of the data packet processing method embodiments of the foregoing embodiments, and achieve the same technical effects, and are not described herein again to avoid repetition.
The embodiment of the present invention further provides a computer-readable storage medium, where when being executed by a processor, the computer program implements each process of the foregoing data packet processing method embodiment, and can achieve the same technical effect, and is not described herein again to avoid repetition. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
The embodiment of the invention also provides a computer program, and the computer program can be stored on a cloud or a local storage medium. When being executed by a computer or a processor, the computer program is used for executing the corresponding steps of the data packet processing method according to the embodiment of the present invention and for realizing the corresponding modules in the data packet processing device according to the embodiment of the present invention.
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 is readily imaginable to the person skilled in the art: any combination of the above embodiments is possible, and thus any combination between the above embodiments is an embodiment of the present invention, but the present disclosure is not necessarily detailed herein for reasons of space.
The packet processing methods provided herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose systems may also be used with the teachings herein. The structure required to construct a system incorporating aspects of the present invention will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the invention and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components of the packet processing method according to embodiments of the present invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
To better understand the embodiments of the present invention, 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. 4, 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 invention 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. 5, the system mainly includes a network interface module 501, a switching engine module 502, a CPU module 503, and a disk array module 504;
the network interface module 501, the CPU module 503 and the disk array module 504 all enter the switching engine module 502; the switching engine module 502 performs an operation of looking up the address table 505 on the incoming packet, thereby obtaining the direction information of the packet; and stores the packet in a corresponding queue of the packet buffer 506 based on the packet's steering information; if the queue of the packet buffer 506 is nearly full, it is discarded; the switching engine module 502 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 504 mainly implements control over the hard disk, including initialization, read-write, and other operations of the hard disk; the CPU module 503 is mainly responsible for protocol processing with an access switch and a terminal (not shown in the figure), configuring an address table 505 (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 504.
The access switch:
as shown in fig. 6, the network interface module (downlink network interface module 601, uplink network interface module 602), switching engine module 603, and CPU module 604 are mainly included;
wherein, the packet (uplink data) coming from the downlink network interface module 601 enters the packet detection module 605; the packet detection module 605 detects whether the Destination Address (DA), the Source Address (SA), the type of the packet, and the length of the packet meet the requirements, if so, allocates a corresponding stream identifier (stream-id) and enters the switching engine module 603, otherwise, discards the stream identifier; the packet (downstream data) coming from the upstream network interface module 602 enters the switching engine module 603; the incoming data packet from the CPU module 604 enters the switching engine module 603; the switching engine module 603 performs an operation of looking up the address table 606 on the incoming packet, thereby obtaining the direction information of the packet; if the packet entering the switching engine module 603 is from the downstream network interface to the upstream network interface, the packet is stored in the queue of the corresponding packet buffer 607 in association with the stream-id; if the queue of the packet buffer 607 is close to full, it is discarded; if the packet entering the switching engine module 603 is not from the downlink network interface to the uplink network interface, the packet is stored in the queue of the corresponding packet buffer 607 according to the packet guiding information; if the queue of the packet buffer 607 is close to full, it is discarded.
The switching engine module 603 polls all packet buffer queues, which in this embodiment of the present invention 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 608 is configured by the CPU module 604 and generates tokens for packet buffer queues going to the upstream network interface from all downstream network interfaces at programmable intervals to control the rate of upstream forwarding.
The CPU module 604 is mainly responsible for protocol processing with the node server, configuration of the address table 606, and configuration of the code rate control module 608.
Ethernet protocol gateway:
as shown in fig. 7, the apparatus mainly includes a network interface module (a downlink network interface module 701, an uplink network interface module 702), a switching engine module 703, a CPU module 704, a packet detection module 705, a rate control module 708, an address table 706, a packet buffer 707, a MAC adding module 709, and a MAC deleting module 710.
Wherein, the data packet coming from the downlink network interface module 701 enters the packet detection module 705; the packet detection module 705 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 deleting module 710 subtracts MAC DA, MAC SA, length or frame type (2byte), and enters the corresponding receiving buffer, otherwise, discards;
the downlink network interface module 701 detects the sending buffer of the port, and if a packet exists, the downlink network interface module learns 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 MACSA of the ethernet coordination 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 invention: 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.

Claims (10)

1. A data packet processing method is applied to video networking equipment with a video networking service system, and comprises the following steps:
sequentially acquiring first data with a preset length from the head of a service data queue of the video networking equipment;
if the service type identification in the first data does not belong to the video networking service type identification, updating the first data according to a first video networking protocol data packet currently stored by the video networking equipment and/or second data in the service data queue, and taking the updated first data as target data under the condition that the service type identification in the updated first data belongs to the video networking service type identification;
acquiring second packet data from the second data according to the set length in the target data and the length of the first packet data included in the first data;
and under the condition that the first length of the acquired third packet data is equal to the set length, performing service processing on the third packet data, wherein the third packet data comprises the first packet data and the second packet data.
2. The method according to claim 1, wherein if the service type identifier in the first data does not belong to an internet of view service type identifier, updating the first data according to a first internet of view protocol data packet stored in the internet of view device and/or second data in the service data queue, and if the service type identifier in the updated first data belongs to the internet of view service type identifier, taking the updated first data as target data includes:
if the service type identification in the first data does not belong to the video networking service type identification, removing the last first byte in the first data, and adding the last second byte in the first video networking protocol data packet to the front of first remaining data in the first data except the first byte so as to update the first data to obtain first target data;
and if the service type identification in the first target data belongs to the video networking service type identification, taking the first target data as the target data.
3. The method of claim 2, further comprising:
if the service type identification in the first target data does not belong to the video networking service type identification, judging whether a second length of second remaining data except the second byte in the first video networking protocol data packet is greater than the preset length;
if the second length is greater than the preset length, removing the last third byte in the first target data, and adding the last byte in the second residual data to the first target data before the third residual data except the third byte to update the first target data to obtain second target data;
and if the service type identification in the second target data belongs to the video networking service type identification, taking the second target data as the target data.
4. The method of claim 3, further comprising:
if the second length is not greater than the preset length, restoring the first target data to the first data, removing a first byte in the first data, and adding the first byte in the second data to fourth remaining data, so as to update the first data to obtain third target data, wherein the fourth remaining data is data in the first data except the first byte in the first data;
and if the service type identifier in the third target data belongs to the video networking service type identifier, taking the third target data as the target data.
5. The method of claim 4, further comprising:
if the service type identifier in the third target data does not belong to the video networking service type identifier, removing a first byte in the third target data, and adding a first byte which is adjacent to the first byte in the second data and is positioned behind the first byte in the second data to fifth residual data to update the third target data to obtain fourth target data, wherein the fifth residual data is data in the third target data except the first byte in the third target data;
and if the service type identifier in the fourth target data belongs to the video networking service type identifier, taking the fourth target data as the target data.
6. The method of claim 1, further comprising:
if the service type identifier in the first data does not belong to the video networking service type identifier, removing a first byte in the first data, and adding the first byte in the second data to sixth residual data to update the first data to obtain fifth target data, wherein the sixth residual data is data in the first data except the first byte in the first data;
and if the service type identifier in the fifth target data belongs to the video networking service type identifier, taking the fifth target data as the target data.
7. The method of claim 1, further comprising:
under the condition that the first length of the acquired third packet data is not equal to the set length in the target data, acquiring third data from the second data until the sum of the length of the acquired third data and the first length is equal to the set length, and taking the third packet data and the third data as packet data of a second video networking protocol data packet;
and replacing the first video networking protocol data packet with the second video networking protocol data packet to take the second video networking protocol data as the currently stored first video networking protocol data packet, and performing service processing on the packet body data of the second video networking protocol data packet.
8. A packet processing apparatus, comprising:
the first acquisition module is used for sequentially acquiring first data with preset length from the head of a service data queue of the video networking equipment;
the updating module is used for updating the first data according to a first video networking protocol data packet currently stored by the video networking equipment and/or second data in the service data queue if the service type identifier in the first data does not belong to a video networking service type identifier, and taking the updated first data as target data under the condition that the service type identifier in the updated first data belongs to the video networking service type identifier;
a second obtaining module, configured to obtain second packet data from the second data according to a set length in the target data and a length of the first packet data included in the first data;
and the processing module is used for performing service processing on the third packet data under the condition that the first length of the acquired third packet data is equal to the set length, wherein the third packet data comprises the first packet data and the second packet data.
9. A packet processing apparatus, comprising:
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 the data packet processing method of any of claims 1 to 7.
10. A computer-readable storage medium storing a computer program for causing a processor to execute the packet processing method according to any one of claims 1 to 7.
CN202010437804.3A 2020-05-21 2020-05-21 Data packet processing method and device and readable storage medium Pending CN111787416A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010437804.3A CN111787416A (en) 2020-05-21 2020-05-21 Data packet processing method and device and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010437804.3A CN111787416A (en) 2020-05-21 2020-05-21 Data packet processing method and device and readable storage medium

Publications (1)

Publication Number Publication Date
CN111787416A true CN111787416A (en) 2020-10-16

Family

ID=72754223

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010437804.3A Pending CN111787416A (en) 2020-05-21 2020-05-21 Data packet processing method and device and readable storage medium

Country Status (1)

Country Link
CN (1) CN111787416A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023283926A1 (en) * 2021-07-16 2023-01-19 北京小米移动软件有限公司 Data transmission method, data transmission apparatus and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150237398A1 (en) * 2014-02-18 2015-08-20 Kylintv, Inc. Internet protocol television
CN106326499A (en) * 2016-10-14 2017-01-11 广州市千钧网络科技有限公司 Data processing method and device
CN109302452A (en) * 2018-09-03 2019-02-01 视联动力信息技术股份有限公司 A kind of method and apparatus of business processing
CN110516061A (en) * 2019-07-24 2019-11-29 视联动力信息技术股份有限公司 A kind of data processing method, device and computer readable storage medium
CN110719495A (en) * 2018-07-13 2020-01-21 视联动力信息技术股份有限公司 Video data processing method and system
CN110839141A (en) * 2018-08-17 2020-02-25 视联动力信息技术股份有限公司 Resource acquisition method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150237398A1 (en) * 2014-02-18 2015-08-20 Kylintv, Inc. Internet protocol television
CN106326499A (en) * 2016-10-14 2017-01-11 广州市千钧网络科技有限公司 Data processing method and device
CN110719495A (en) * 2018-07-13 2020-01-21 视联动力信息技术股份有限公司 Video data processing method and system
CN110839141A (en) * 2018-08-17 2020-02-25 视联动力信息技术股份有限公司 Resource acquisition method and device
CN109302452A (en) * 2018-09-03 2019-02-01 视联动力信息技术股份有限公司 A kind of method and apparatus of business processing
CN110516061A (en) * 2019-07-24 2019-11-29 视联动力信息技术股份有限公司 A kind of data processing method, device and computer readable storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023283926A1 (en) * 2021-07-16 2023-01-19 北京小米移动软件有限公司 Data transmission method, data transmission apparatus and storage medium

Similar Documents

Publication Publication Date Title
CN109462753B (en) System and method for testing multiple video conferences
CN109617956B (en) Data processing method and device
CN108880851B (en) Configuration updating method and interaction system
CN110086850B (en) File processing method and video network disk system
CN111614509B (en) Packet loss statistical method and device and readable storage medium
CN111447393A (en) Conference maintenance method and device and readable storage medium
CN110557319B (en) Message processing method and device based on video network
CN110120885B (en) Method and device for processing equipment state information
CN111211982B (en) Data forwarding method and device, electronic equipment and storage medium
CN110493149B (en) Message processing method and device
CN110336796B (en) Communication method and communication device
CN110336710B (en) Terminal testing method, system and device and storage medium
CN108874844B (en) Form data processing method and video network server
CN111787416A (en) Data packet processing method and device and readable storage medium
CN111478880A (en) Data processing method and device
CN110830817A (en) Video transcoding capacity adjusting method and video transcoding server
CN110650169A (en) Terminal equipment upgrading method and device
CN110688532B (en) Transaction management method and device
CN110351137B (en) Method, system, electronic device and storage medium for automatically updating configuration information
CN110062259B (en) Video acquisition method, system, device and computer readable storage medium
CN110120937B (en) Resource acquisition method, system, device and computer readable storage medium
CN109714641B (en) Data processing method and device based on video network
CN109451030B (en) Method and system for downloading video network file
CN111478940A (en) Data processing method and device
CN110691036A (en) Data transmission method and device based on video network

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