CN116489134A - Data receiving method and device, data generating method and device, equipment and medium - Google Patents
Data receiving method and device, data generating method and device, equipment and medium Download PDFInfo
- Publication number
- CN116489134A CN116489134A CN202310473216.9A CN202310473216A CN116489134A CN 116489134 A CN116489134 A CN 116489134A CN 202310473216 A CN202310473216 A CN 202310473216A CN 116489134 A CN116489134 A CN 116489134A
- Authority
- CN
- China
- Prior art keywords
- data
- sub
- identification information
- media stream
- receiving
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 77
- 230000011664 signaling Effects 0.000 claims description 48
- 230000003993 interaction Effects 0.000 claims description 22
- 238000012545 processing Methods 0.000 claims description 18
- 230000005540 biological transmission Effects 0.000 claims description 9
- 238000004590 computer program Methods 0.000 claims description 7
- 230000005641 tunneling Effects 0.000 claims description 2
- 230000008569 process Effects 0.000 description 18
- 238000004891 communication Methods 0.000 description 12
- 238000010586 diagram Methods 0.000 description 9
- 230000006870 function Effects 0.000 description 5
- 238000007405 data analysis Methods 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 238000006467 substitution reaction Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000005070 sampling Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/60—Network streaming of media packets
- H04L65/65—Network streaming protocols, e.g. real-time transport protocol [RTP] or real-time control protocol [RTCP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/32—Flow control; Congestion control by discarding or delaying data units, e.g. packets or frames
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/80—Responding to QoS
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/70—Reducing energy consumption in communication networks in wireless communication networks
Abstract
The embodiment of the application provides a data receiving method and device, a data generating method and device, equipment and a medium, wherein the data receiving method is applied to a receiving end and comprises the following steps: receiving first data with a preset byte length; judging whether first sub-data of the first data comprises first identification information or not; if yes, judging whether second sub-data of the first data comprise second identification information, and if not, releasing the first data; if the second sub-data of the first data comprises the second identification information, fourth sub-data is acquired from the third sub-data of the first data, and media stream data is acquired according to the fourth sub-data; and if the second sub data of the first data does not comprise the second identification information, releasing the first data. The method provided by the embodiment of the application can detect the media stream data in the data packet in real time and receive the media stream data in the RTSP.
Description
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a data receiving method and apparatus, a data generating method and apparatus, an electronic device, and a computer readable storage medium.
Background
With the development of computer networks, information security is receiving more and more attention, and communication agents among sub-networks isolated from each other are widely applied to various gateway devices, wherein an RTSP audio/video protocol is used as a common protocol in the audio/video transmission field, protocol standards of the protocol set different modes for acquiring media streams, and the modes for acquiring media stream data in different modes are naturally different.
The existing mode of pulling audio and video streams by using the RTSP protocol is a mode of parent-child connection, namely, the parent connection is used for signaling interaction, so that audio and video stream transmission channels of a client and a media server are negotiated; the sub-link is a channel negotiated during signaling transmission and used for transmitting audio and video data; in this way, the media data stream and the signaling data can be distinguished by different transmission channels.
The existing method for distinguishing the signaling and the media stream by the parent-child connection method and detecting the media stream data has obvious limitation in an interleaved mode specified by a protocol, and the signaling and the media data are not distinguished from each other in the interleaved mode, namely, the signaling and the media data are transmitted through the same channel in the interleaved mode, so that the prior art can not play a role in detecting and distinguishing the signaling and the media data in the mode, and can only accept the data and then analyze the data locally to obtain the media stream data.
Disclosure of Invention
An object of the embodiments of the present invention is to provide a data receiving method and apparatus, a data generating method and apparatus, a device and a medium, which can detect media stream data in a data packet in real time and receive the media stream data in an RTSP protocol interleaved mode.
In a first aspect, an embodiment of the present application provides a data receiving method, including:
receiving first data with a preset byte length;
judging whether first sub-data of the first data comprises first identification information or not;
if yes, judging whether second sub-data of the first data comprise second identification information, and if not, releasing the first data;
if the second sub-data of the first data comprises the second identification information, fourth sub-data is acquired from the third sub-data of the first data, and media stream data is acquired according to the fourth sub-data;
and if the second sub data of the first data does not comprise the second identification information, releasing the first data.
In the implementation process, first data is received first, if the first identification information is included in the first data, further identification can be performed, and if the first identification information is not included in the first data, the first data can be directly released without receiving the first data. When the first data comprises the first identification information, the first data is further identified, if the second identification information is included, fourth sub-data is extracted from the first data, the fourth sub-data obtains media stream data, and otherwise, the first data is lost. The whole process of obtaining the media stream data does not need to store the first data for a long time and locally, multiple judgment is carried out, if the first data is not accordant with the requirement of directly discarding the first data, the storage pressure is reduced, the media stream data is obtained through the finally analyzed fourth sub-data, the steps of obtaining redundant data and analyzing the redundant data to obtain the media stream data are avoided, and the receiving speed of the media stream data is improved.
Further, before receiving the first data with the preset byte length, the method includes:
judging whether the signaling comprises third identification information in the signaling interaction stage;
if so, tunneling to receive media data, wherein the media data comprises the first data and the media stream data.
In the implementation process, a signaling interaction stage is needed in the process of communication between the receiving end and the server, and whether to prepare for receiving the media stream data is determined by judging whether third identification information is included in the interaction stage, so that the response speed and the receiving efficiency of the receiving end to the media stream data are improved.
Further, before the determining whether the second asset data of the first data includes the second identification information, the method includes:
and taking a preset field value of preset signaling as the second identification information in the signaling interaction stage.
In the implementation process, the signaling interaction node uses the preset field value of the preset signaling as the second identification information, so that fourth sub-data meeting the requirements can be extracted from the plurality of first data, and corresponding media stream data can be obtained through the fourth sub-data.
Further, the obtaining the fourth sub-data from the third sub-data of the first data, and obtaining the media stream data according to the fourth sub-data includes:
taking the fourth sub data as a data length;
receiving second data according to the data length;
and acquiring the media stream data according to the second data.
In the implementation process, the fourth sub-data is used as a data length; and receiving the second data according to the data length can directly acquire the fifth sub data, save the data analysis time and realize the real-time receiving of the media stream data.
Further, the obtaining the media stream data according to the second data includes:
and taking the data in the preset range in the second data as the media stream data.
In the implementation process, the data in the preset range in the second data is used as the media stream data, so that the data analysis time can be saved, and the media stream data can be received in real time.
Further, the second identification information is also used to identify a data type of the media stream data.
In a second aspect, an embodiment of the present application provides a data sending method, including:
generating first sub-data according to the first identification information;
generating second sub-data according to the second identification information;
generating fourth sub-data from the media stream data;
generating third sub-data according to the fourth sub-data;
generating first data with preset byte length according to the first sub data, the second sub data and the third sub data;
transmitting the first data with the preset byte length to a receiving end, so that the receiving end executes the following method:
judging whether first sub-data of the first data comprises first identification information or not;
if yes, judging whether second sub-data of the first data comprise second identification information, and if not, releasing the first data;
if the second sub-data of the first data comprises the second identification information, fourth sub-data is acquired from the third sub-data of the first data, and media stream data is acquired according to the fourth sub-data;
and if the second sub data of the first data does not comprise the second identification information, releasing the first data.
In a third aspect, an embodiment of the present application provides a data receiving apparatus, applied to a receiving end, including:
the receiving module is used for receiving the first data with the preset byte length;
the judging module is used for judging whether the first sub-data of the first data comprises first identification information or not;
the processing module is used for judging whether the second sub-data of the first data comprises second identification information or not when the judging result of the judging module is yes, and releasing the first data if not;
the processing module is further configured to obtain fourth sub-data from third sub-data of the first data when the second sub-data of the first data includes the second identification information, and obtain media stream data according to the fourth sub-data;
the processing module is further configured to release the first data when the second sub-data of the first data does not include the second identification information.
In a fourth aspect, an embodiment of the present application provides a data sending device, applied to a sending end, where the method includes:
the generation module is used for generating first sub-data according to the first identification information;
the generation module is also used for generating second sub-data according to the second identification information;
the generating module is further used for generating fourth sub-data according to the media stream data;
the generation module is further used for generating third sub-data according to the fourth sub-data;
the generation module is further used for generating first data with preset byte length according to the first sub data, the second sub data and the third sub data;
the generating module is further configured to send the first data with the preset byte length to a receiving end, so that the receiving end performs the following method:
judging whether first sub-data of the first data comprises first identification information or not;
if yes, judging whether second sub-data of the first data comprise second identification information, and if not, releasing the first data;
if the second sub-data of the first data comprises the second identification information, fourth sub-data is acquired from the third sub-data of the first data, and media stream data is acquired according to the fourth sub-data;
and if the second sub data of the first data does not comprise the second identification information, releasing the first data.
In a fifth aspect, an electronic device provided in an embodiment of the present application includes: a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the method according to any one of the first aspects when the computer program is executed.
In a sixth aspect, embodiments of the present application provide a computer-readable storage medium having instructions stored thereon, which when executed on a computer, cause the computer to perform the method according to any of the first aspects.
Additional features and advantages of the disclosure will be set forth in the description which follows, or in part will be obvious from the description, or may be learned by practice of the techniques of the disclosure.
And may be practiced in accordance with the disclosure as hereinafter described in detail with reference to the preferred embodiments of the present application.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flow chart of a data receiving method according to an embodiment of the present application;
fig. 2 is a flow chart of a data transmission method according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a data receiving device according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a data transmitting apparatus according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only to distinguish the description, and are not to be construed as indicating or implying relative importance.
The embodiment of the application provides a data receiving method, which can be applied to a server, wherein the server can be an independent server or a server cluster formed by a plurality of servers, and can also be a cloud server for providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, big data, artificial intelligent sampling point equipment and the like. Referring to fig. 1, the method includes:
s11: receiving first data with a preset byte length;
s12: judging whether first sub data of the first data comprise first identification information, if so, executing S13, and if not, executing S16;
s13: judging whether the second sub data of the first data comprises second identification information, if not, executing S16;
s14: if the second sub-data of the first data comprises the second identification information, acquiring fourth sub-data from the third sub-data of the first data, and acquiring media stream data according to the fourth sub-data;
s15: and if the second sub data of the first data does not comprise the second identification information, releasing the first data.
S16: the first data is released.
In some embodiments, in steps S3 and S5, after the first data is released, the first data of the first preset byte is continuously received.
Taking the RTSP protocol interleaved mode as an example, a field called Transport is included in the SETUP signaling and a field called interleaved is included in this field, which field must be in a state of value in this mode. Examples are as follows:
transport RTP/AVP/TCP; interleaved=0-1 or
Transport:RTP/AVP/TCP;interleaved=2-3
Wherein the value of interleaved is non-standard and is formulated by the protocol manufacturer. The media stream is in the form of a 1 byte $+1 byte channel identifier +2 bytes rtp/rtcp data length + media data + upper layer header information during transmission.
Firstly, receiving media data of 4 bytes, when the content of the first byte (first sub data) is '$' (first identification information), continuously judging whether the next byte (second sub data) is an interrupted set value (second identification information), if not, skipping the acquired content, and re-matching the character '$'; if the packet can be paired with the value set in interleaved, the content of the data packet which is rtp or rtcp can be judged by using the value set in interleaved; when the next 2 bytes of data (third sub data) are acquired, the two bytes of data are the real content length (fourth sub data) of the media stream data, the data of the byte with the specified length can be acquired according to the content length, the data content acquired now is the actual media stream data, and the subsequent upper header information is not needed, so that the receiving processing logic of the part can be skipped directly in general, and the receiving processing of the media stream data can be continued.
In the implementation process, first data is received first, if the first identification information is included in the first data, further identification can be performed, and if the first identification information is not included in the first data, the first data can be directly released without receiving the first data. When the first data comprises the first identification information, the first data is further identified, if the second identification information is included, fourth sub-data is extracted from the first data, the fourth sub-data obtains media stream data, and otherwise, the first data is lost. The whole process of obtaining the media stream data does not need to store the first data for a long time and locally, multiple judgment is carried out, if the first data is not accordant with the requirement of directly discarding the first data, the storage pressure is reduced, the media stream data is obtained through the finally analyzed fourth sub-data, the steps of obtaining redundant data and analyzing the redundant data to obtain the media stream data are avoided, and the receiving speed of the media stream data is improved.
In some embodiments, prior to receiving the first data of the preset byte length, the method comprises:
judging whether the signaling comprises third identification information in the signaling interaction stage;
if so, a channel is opened to receive media data, the media data including first data and media stream data.
Taking the interleaved mode of the RTSP protocol as an example, in the signaling interaction stage, when the signaling is identified to include the interleaved field (the third identification information), it can be known that the current mode of obtaining the media stream is the media data transmitted through the signaling channel, and the signaling and the media data are transmitted in an interleaved manner, and after the transmission mode is identified, the preset media data can be received.
In the implementation process, a signaling interaction stage is needed in the process of communication between the receiving end and the server, and whether to prepare for receiving the media stream data is determined by judging whether third identification information is included in the interaction stage, so that the response speed and the receiving efficiency of the receiving end to the media stream data are improved.
In some embodiments, before determining whether the second asset data of the first data includes the second identification information, comprising:
and taking a preset field value of preset signaling as second identification information in the signaling interaction stage.
Taking the RTSP protocol interleaved mode as an example, a field called Transport is included in the SETUP signaling and a field called interleaved is included in this field, which field must be in a state of value in this mode. Examples are as follows:
transport RTP/AVP/TCP; interleaved=0-1 or
Transport:RTP/AVP/TCP;interleaved=2-3
The 2 values of the interleaved field are (second identification information), the first value being used for the rtp packet for identifying that the content of the packet is rtp data; the second value is used for the rtcp packet to identify that the content of the packet is rtcp data.
It is appreciated that in some embodiments, the second identification information is also used to identify the data type of the media stream data.
In the implementation process, the signaling interaction node uses the preset field value of the preset signaling as the second identification information, so that fourth sub-data meeting the requirements can be extracted from the plurality of first data, and corresponding media stream data can be obtained through the fourth sub-data.
In some embodiments, obtaining fourth sub-data at the third sub-data of the first data, obtaining media stream data from the fourth sub-data, includes:
taking the fourth sub data as the data length;
receiving second data according to the data length;
and acquiring media stream data according to the second data.
Illustratively, taking the interleaved mode of the RTSP protocol as an example, first receiving media data of 4 bytes, when the content of the first byte (first sub data) is '$' (first identification information), continuing to determine whether the next byte (second sub data) is the value (second identification information) set by interleaved, if not, skipping the content acquired this time, and re-matching the character '$'; if the packet can be paired with the value set in interleaved, the content of the data packet which is rtp or rtcp can be judged by using the value set in interleaved; when the next 2 bytes of data (third sub data) are acquired, the two bytes of data are the real content length (fourth sub data) of the media stream data, the data of the byte with the specified length can be acquired according to the content length, the data content acquired now is the actual media stream data, and the subsequent upper header information is not needed, so that the receiving processing logic of the part can be skipped directly in general, and the receiving processing of the media stream data can be continued.
In the implementation process, the fourth sub-data is used as the data length; the fifth sub data can be directly obtained by receiving the second data according to the data length, so that the data analysis time is saved, and the real-time receiving of the media stream data is realized.
In some embodiments, the data in the preset range in the second data is used as media stream data.
In the implementation process, the data in the preset range in the second data is used as the media stream data, so that the data analysis time can be saved, and the real-time receiving of the media stream data is realized.
Further, the first data is composed of second sub data, third sub data and fourth sub data according to a preset sequence.
In the implementation process, based on the preset sequence, the receiving end can rapidly analyze the second sub-data, the third sub-data and the fourth sub-data.
Example 2
Referring to fig. 2, an embodiment of the present application provides a data sending method, applied to a sending end, where the method includes:
s21: generating first sub-data according to the first identification information;
s22: generating second sub-data according to the second identification information;
s23: generating fourth sub-data from the media stream data;
s24: generating third sub-data according to the fourth sub-data;
s25: generating first data with preset byte length according to the first sub data, the second sub data and the third sub data;
s26: transmitting the first data with the preset byte length to the receiving end so that the receiving end executes the following method:
judging whether first sub-data of the first data comprises first identification information or not;
if yes, judging whether second sub-data of the first data comprise second identification information, and if not, releasing the first data;
if the second sub-data of the first data comprises the second identification information, acquiring fourth sub-data from the third sub-data of the first data, and acquiring media stream data according to the fourth sub-data;
and if the second sub data of the first data does not comprise the second identification information, releasing the first data.
In some embodiments, the method further comprises: generating a signaling according to the third identification information, and transmitting the signaling to the receiving end of the channel in the signaling interaction stage.
In some embodiments, the method further comprises: and generating a preset field value of the signaling according to the second identification information, and transmitting the signaling to the receiving end of the channel in the signaling interaction stage.
In some embodiments, the method further comprises: the data length is taken as fourth sub-data.
In some embodiments, the second identification information is further used to identify a data type of the media stream data.
Other possible embodiments and application scenarios of the transmitting end correspond to embodiment 1, and are not described herein.
Example 3
Referring to fig. 3, an embodiment of the present application provides a data receiving apparatus, including;
a receiving module 31, configured to receive first data with a preset byte length;
a judging module 32, configured to judge whether the first sub-data of the first data includes first identification information;
the processing module 33 is configured to determine whether the second sub-data of the first data includes the second identification information when the determination result of the determining module 32 is yes, and if not, release the first data;
the processing module 33 is further configured to obtain fourth sub-data from the third sub-data of the first data when the second sub-data of the first data includes the second identification information, and obtain media stream data according to the fourth sub-data;
the processing module 33 is further configured to release the first data when the second sub-data of the first data does not include the second identification information.
In some embodiments, the receiving module 31 is further configured to determine, in the signaling interaction stage, whether the signaling includes third identification information;
if so, a channel is opened to receive media data, the media data including first data and media stream data.
In some embodiments, the receiving module 31 is further configured to use a preset field value of the preset signaling as the second identification information in the signaling interaction stage.
In some embodiments, the processing module 33 is further configured to take the fourth sub-data as a data length;
receiving second data according to the data length;
and acquiring media stream data according to the second data.
In some embodiments, the processing module 33 is further configured to use the data in the preset range in the second data as media stream data.
In some embodiments, the second identification information is further used to identify a data type of the media stream data.
Example 4
Referring to fig. 4, an embodiment of the present application provides a data transmitting apparatus, including;
a generating module 41, configured to generate first sub-data according to the first identification information;
the generating module 41 is further configured to generate second sub-data according to the second identification information;
the generating module 41 is further configured to generate fourth sub-data from the media stream data;
the generating module 41 is further configured to generate third sub-data according to the fourth sub-data;
the generating module 41 is further configured to generate first data with a preset byte length according to the first sub data, the second sub data and the third sub data;
the generating module 41 is further configured to send the first data with the preset byte length to the receiving end, so that the receiving end performs the following method:
judging whether first sub-data of the first data comprises first identification information or not;
if yes, judging whether second sub-data of the first data comprise second identification information, and if not, releasing the first data;
if the second sub-data of the first data comprises the second identification information, acquiring fourth sub-data from the third sub-data of the first data, and acquiring media stream data according to the fourth sub-data;
and if the second sub data of the first data does not comprise the second identification information, releasing the first data.
In some embodiments, the generating module 41 is further configured to generate signaling according to the third identification information, and send the signaling to the receiving end in the signaling interaction stage.
In some embodiments, the generating module 41 is further configured to generate a preset field value of the signaling according to the second identification information, and send the signaling to the receiving end in the signaling interaction stage.
In some embodiments, the generating module 41 is further configured to use the data length as the fourth sub-data.
In some embodiments, the second identification information is further used to identify a data type of the media stream data.
The application further provides an electronic device, please refer to fig. 5, and fig. 5 is a block diagram of an electronic device according to an embodiment of the application. The electronic device may include a processor 51, a communication interface 52, a memory 53, and at least one communication bus 54. Wherein the communication bus 54 is used to enable direct connection communication of these components. The communication interface 52 of the electronic device in the embodiment of the present application is used for performing signaling or data communication with other node devices. The processor 51 may be an integrated circuit chip with signal processing capabilities.
The processor 51 may be a general-purpose processor including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but may also be a Digital Signal Processor (DSP), application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components. The disclosed methods, steps, and logic blocks in the embodiments of the present application may be implemented or performed. The general purpose processor may be a microprocessor or the processor 51 may be any conventional processor or the like.
The Memory 53 may be, but is not limited to, random access Memory (Random Access Memory, RAM), read Only Memory (ROM), programmable Read Only Memory (Programmable Read-Only Memory, PROM), erasable Read Only Memory (Erasable Programmable Read-Only Memory, EPROM), electrically erasable Read Only Memory (Electric Erasable Programmable Read-Only Memory, EEPROM), etc. The memory 53 has stored therein computer readable instructions which, when executed by the processor 51, can perform the steps involved in the above-described method embodiments.
Optionally, the electronic device may further include a storage controller, an input-output unit.
The memory 53, the memory controller, the processor 51, the peripheral interface, and the input/output unit are electrically connected directly or indirectly to each other, so as to realize data transmission or interaction. For example, the components may be electrically coupled to each other via one or more communication buses 54. The processor 51 is adapted to execute executable modules stored in the memory 53, such as software functional modules or computer programs comprised by the electronic device.
The input-output unit is used for providing the user with the creation task and creating the starting selectable period or the preset execution time for the task so as to realize the interaction between the user and the server. The input/output unit may be, but is not limited to, a mouse, a keyboard, and the like.
It will be appreciated that the configuration shown in fig. 5 is merely illustrative, and that the electronic device may also include more or fewer components than shown in fig. 5, or have a different configuration than shown in fig. 5. The components shown in fig. 5 may be implemented in hardware, software, or a combination thereof.
The embodiment of the application further provides a computer readable storage medium, on which instructions are stored, and when the instructions run on a computer, the computer program is executed by a processor to implement the method of the method embodiment, so that repetition is avoided, and no further description is given here.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other manners as well. The apparatus embodiments described above are merely illustrative, for example, flow diagrams and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, the functional modules in the embodiments of the present application may be integrated together to form a single part, or each module may exist alone, or two or more modules may be integrated to form a single part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored on a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The above is only an example of the present application, and is not intended to limit the scope of the present application, and various modifications and variations will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application. It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures.
The foregoing is merely specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the present application, and the changes or substitutions are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
It is noted that relational terms such as first and second, and the like are 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. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus 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 apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises an element.
Claims (11)
1. A data receiving method, applied to a receiving end, the method comprising:
receiving first data with a preset byte length;
judging whether first sub-data of the first data comprises first identification information or not;
if yes, judging whether second sub-data of the first data comprise second identification information, and if not, releasing the first data;
if the second sub-data of the first data comprises the second identification information, fourth sub-data is acquired from the third sub-data of the first data, and media stream data is acquired according to the fourth sub-data;
and if the second sub data of the first data does not comprise the second identification information, releasing the first data.
2. The data receiving method according to claim 1, wherein before receiving the first data of the preset byte length, comprising:
judging whether the signaling comprises third identification information in the signaling interaction stage;
if so, tunneling to receive media data, wherein the media data comprises the first data and the media stream data.
3. The data receiving method according to claim 1, characterized by comprising, before said judging whether the second asset data of the first data includes the second identification information:
and taking a preset field value of preset signaling as the second identification information in the signaling interaction stage.
4. The data receiving method according to claim 2, wherein the obtaining fourth sub-data at the third sub-data of the first data, obtaining media stream data according to the fourth sub-data, comprises:
taking the fourth sub data as a data length;
receiving second data according to the data length;
and acquiring the media stream data according to the second data.
5. The data receiving method according to claim 4, wherein the acquiring the media stream data from the second data includes:
and taking the data in the preset range in the second data as the media stream data.
6. The data receiving method according to claim 1, wherein the second identification information is further used to identify a data type of the media stream data.
7. The data transmission method is characterized by being applied to a transmitting end, and comprises the following steps:
generating first sub-data according to the first identification information;
generating second sub-data according to the second identification information;
generating fourth sub-data from the media stream data;
generating third sub-data according to the fourth sub-data;
generating first data with preset byte length according to the first sub data, the second sub data and the third sub data;
transmitting the first data with the preset byte length to a receiving end, so that the receiving end executes the following method:
judging whether first sub-data of the first data comprises first identification information or not;
if yes, judging whether second sub-data of the first data comprise second identification information, and if not, releasing the first data;
if the second sub-data of the first data comprises the second identification information, fourth sub-data is acquired from the third sub-data of the first data, and media stream data is acquired according to the fourth sub-data;
and if the second sub data of the first data does not comprise the second identification information, releasing the first data.
8. A data receiving apparatus, applied to a receiving end, comprising:
the receiving module is used for receiving the first data with the preset byte length;
the judging module is used for judging whether the first sub-data of the first data comprises first identification information or not;
the processing module is used for judging whether the second sub-data of the first data comprises second identification information or not when the judging result of the judging module is yes, and releasing the first data if not;
the processing module is further configured to obtain fourth sub-data from third sub-data of the first data when the second sub-data of the first data includes the second identification information, and obtain media stream data according to the fourth sub-data;
the processing module is further configured to release the first data when the second sub-data of the first data does not include the second identification information.
9. A data transmitting apparatus, applied to a transmitting end, the method comprising:
the generation module is used for generating first sub-data according to the first identification information;
the generation module is also used for generating second sub-data according to the second identification information;
the generating module is further used for generating fourth sub-data according to the media stream data;
the generation module is further used for generating third sub-data according to the fourth sub-data;
the generation module is further used for generating first data with preset byte length according to the first sub data, the second sub data and the third sub data;
the generating module is further configured to send the first data with the preset byte length to a receiving end, so that the receiving end performs the following method:
judging whether first sub-data of the first data comprises first identification information or not;
if yes, judging whether second sub-data of the first data comprise second identification information, and if not, releasing the first data;
if the second sub-data of the first data comprises the second identification information, fourth sub-data is acquired from the third sub-data of the first data, and media stream data is acquired according to the fourth sub-data;
and if the second sub data of the first data does not comprise the second identification information, releasing the first data.
10. An electronic device, comprising: memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the method according to any one of claims 1-7 when the computer program is executed.
11. A computer readable storage medium having instructions stored thereon which, when run on a computer, cause the computer to perform the method of any of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310473216.9A CN116489134A (en) | 2023-04-27 | 2023-04-27 | Data receiving method and device, data generating method and device, equipment and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310473216.9A CN116489134A (en) | 2023-04-27 | 2023-04-27 | Data receiving method and device, data generating method and device, equipment and medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116489134A true CN116489134A (en) | 2023-07-25 |
Family
ID=87221210
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310473216.9A Pending CN116489134A (en) | 2023-04-27 | 2023-04-27 | Data receiving method and device, data generating method and device, equipment and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116489134A (en) |
-
2023
- 2023-04-27 CN CN202310473216.9A patent/CN116489134A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102045363B (en) | Establishment, identification control method and device for network flow characteristic identification rule | |
US10547523B2 (en) | Systems and methods for extracting media from network traffic having unknown protocols | |
CN109815256A (en) | A kind of data processing method, device, electronic equipment and storage medium | |
CN108076017B (en) | Protocol analysis method and device for data packet | |
CN101287010A (en) | Method and apparatus for identifying and verifying type of message protocol | |
CN107562426B (en) | Method and system for collecting and analyzing Trace of browser in non-embedded cloud | |
CN111756716A (en) | Flow detection method and device and computer readable storage medium | |
KR101703805B1 (en) | Supervision of a communication session comprising several flows over a data network | |
CN113630418B (en) | Network service identification method, device, equipment and medium | |
CN107592554A (en) | Live video retransmission method and device | |
CN106648722B (en) | Method and device for processing Flume receiving terminal data based on big data | |
KR100548923B1 (en) | A system for monitoring multi-media service traffic and method thereof | |
WO2018205736A1 (en) | Multimedia information retrieval method, device and storage medium | |
WO2021174879A1 (en) | Ai video call quality analysis method and apparatus, computer device, and storage medium | |
CN116489134A (en) | Data receiving method and device, data generating method and device, equipment and medium | |
CN112436950A (en) | Method for discovering equipment in local area network based on UDP broadcast | |
CN113973111B (en) | Data forwarding method, device, gateway equipment and computer readable storage medium | |
US20160126976A1 (en) | Methods, systems, and computer readable media for optimized message decoding | |
CN111277449B (en) | Safety testing method and device for voice service equipment | |
CN108833724B (en) | CDR synthesis method and device | |
CN114048467A (en) | Model data processing method, device, equipment and storage medium based on intrusion detection system | |
CN113852551A (en) | Message processing method and device | |
CN109462496B (en) | Data processing method and device for video network terminal | |
CN112910920A (en) | Malicious communication detection method, system, storage medium and electronic device | |
JP2002259216A (en) | Method for detecting electronic file alteration, method for describing electronic file for the same and communication equipment |
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 |