Audio and video association method and device, computer equipment and readable storage medium

By querying and correlating the audio and video data streams in VoIP video calls in the preset audio and video association table, the problem that audio and video cannot be associated in VoIP video calls is solved, achieving a more comprehensive information acquisition and a better user experience.

CN119450002APending Publication Date: 2025-02-14DAWNING NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411587688.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-07
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

During VoIP video calls, audio and video are transmitted in two independent media streams, which results in the fact that when viewing media files, you can only restore a single audio file or video file, and the two cannot be associated. The information obtained is obtained Not comprehensive enough.

Method used

By querying the second data stream corresponding to the index value of the first data stream in the preset audio and video association table, the first data stream and the second data stream are associated to obtain the audio and video data stream.

Benefits of technology

It realizes synchronously obtaining audio data streams and video data streams for pending calls, and can obtain audio and video information more comprehensively, providing users with a complete audio-visual experience and improving users' experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119450002A_ABST
    Figure CN119450002A_ABST
Patent Text Reader

Abstract

The invention relates to an audio and video association method and device, computer equipment and a readable storage medium. The method comprises: based on an index value of a first data stream, querying in a preset audio and video association table to obtain a second data stream, the first data stream being an audio data stream or a video data stream; the second data stream is an opposite end data stream of the first data stream; and associating the first data stream with the second data stream to obtain an audio and video data stream. By adopting the method, the audio and video information can be obtained more comprehensively.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of network technology, and in particular to an audio and video association method, apparatus, computer equipment and readable storage medium. Background Art

[0002] Voice over Internet Protocol (VoIP) video calls based on Internet Protocol (IP) are a communication method that transmits voice and video data over the Internet. It allows users to conduct real-time video communications through computers, smartphones or other devices that support the VoIP protocol. With the development of network technology, VoIP video calls have also been widely used in people's daily lives and work. However, with the development of VoIP video calls, VoIP has gradually been applied to all walks of life. Currently, common VoIP video call applications include Zoom (a cloud video conferencing service software), WhatsApp (a cross-platform encrypted instant messaging application for smartphones), FaceTime (a video call application), etc. Therefore, audio and video restoration for VoIP is very important, which can record and save key information such as the content, people, and time of the call to better protect the rights and interests of users.

[0003] During a VoIP video call, audio and video are transmitted as two independent media streams, which are encoded in different ways and often use different network ports for transmission. Therefore, during the media stream transmission process, when the audio and video streams are identified, reassembled and restored, only a single audio file or video file can be restored. This will result in only video images without audio, or only audio without video images when viewing the media files. It is impossible to associate the two, and the information that can be obtained is not comprehensive enough. Summary of the invention

[0004] Based on this, it is necessary to provide an audio and video association method, device, computer equipment and readable storage medium that can more comprehensively obtain audio and video information in response to the above technical problems.

[0005] In a first aspect, the present application provides a method for associating audio and video, the method comprising:

[0006] Based on the index value of the first data stream, query in the preset audio and video association table to obtain the second data stream, the first data stream is an audio data stream or a video data stream; the second data stream is the peer data stream of the first data stream;

[0007] The first data stream and the second data stream are associated to obtain an audio and video data stream.

[0008] In this embodiment, by querying the second data stream corresponding to the first index value of the first data stream in the preset audio and video association table, the first data stream and the second data stream are associated to obtain the audio and video data stream, and the audio data stream and video data stream of the call to be processed can be obtained synchronously, and the audio and video information can be obtained more comprehensively, while providing the user with a complete audio-visual experience and enhancing the user experience.

[0009] In one embodiment, the method further comprises:

[0010] Get real-time data streams;

[0011] Based on a preset message payload structure, each message in the real-time data stream is parsed to obtain message parameters of each message, wherein the message parameters include at least a sequence number and an encoding method;

[0012] Based on a preset arrangement order and a sequence number of each of the messages, reorganize each of the messages to obtain a reorganized data stream;

[0013] The reorganized data stream is decoded based on the encoding method to obtain a first data stream.

[0014] In this embodiment, the message is parsed by a preset message payload structure, and each message is reassembled based on the parsed message parameters, and the reassembled data stream is decoded to obtain the first data stream, thereby improving the restoration rate of the data stream.

[0015] In one embodiment, the method further comprises:

[0016] Calculate a first two-tuple hash value of source address and port information of User Datagram Protocol (UDP) traffic and a second two-tuple hash value of destination address and port information based on a preset hash algorithm;

[0017] Based on the first two-tuple hash value or the second two-tuple hash value, the target node is searched in the preset associated flow table, and the UDP traffic is determined as the real-time data flow.

[0018] In this embodiment, the real-time data stream is determined by searching for the target node in the preset associated stream table, so as to be subsequently merged with the audio data stream and the video data stream.

[0019] In one embodiment, the method further comprises:

[0020] Extracting the media information of the signaling stream based on a preset keyword matching method to obtain the address port information of the audio data stream and the address port information of the video data stream in the signaling stream;

[0021] Based on the preset hash algorithm and the address port information of the audio data stream, calculate the binary hash value of the audio data stream; based on the preset hash algorithm and the address port information of the video data stream, calculate the binary hash value of the video data stream;

[0022] The binary hash value of the audio data stream and the binary hash value of the video data stream are stored in the target node, the binary hash value of the audio data stream is determined as the index value, and inserted into the preset associated stream table.

[0023] In this embodiment, the audio and video are parsed through the media information of the signaling stream to obtain a preset associated stream table, so as to associate the subsequent audio data stream with the corresponding video data stream.

[0024] In one embodiment, the method further comprises:

[0025] If the second data stream is not found in the preset audio and video association table, calculating a binary hash value in the reverse direction based on the address port information in the reverse direction;

[0026] The preset audio and video association table is queried based on the binary hash value in the reverse direction to obtain the second data stream.

[0027] In this embodiment, when the second data stream is not queried, the preset audio and video association table is queried through the reverse direction address port information to obtain the second data stream, which can further improve the restoration rate of audio and video.

[0028] In one embodiment, the method further comprises:

[0029] If the second data stream is not found in the preset audio and video association table, the binary hash value of the video data stream is determined as an index value and added to the preset audio and video association table.

[0030] In this embodiment, when the second data stream is not found, the first data stream is added to the preset audio and video association table, thereby improving the audio and video association efficiency.

[0031] In one embodiment, the method further comprises:

[0032] In the preset audio and video association table, if the first data stream does not find the second data stream within a preset time length, the first data stream is output.

[0033] In this embodiment, by outputting the data stream for which the peer data stream is not found, the memory usage and the overhead of global hash table query are reduced.

[0034] In a second aspect, the present application further provides an audio and video association device, the device comprising:

[0035] A query module, configured to query a preset audio and video association table based on an index value of a first data stream to obtain a second data stream, wherein the first data stream is an audio data stream or a video data stream; and the second data stream is a peer data stream of the first data stream;

[0036] The association module associates the first data stream and the second data stream to obtain an audio and video data stream.

[0037] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0038] Based on the index value of the first data stream, query in the preset audio and video association table to obtain the second data stream, the first data stream is an audio data stream or a video data stream; the second data stream is the peer data stream of the first data stream;

[0039] The first data stream and the second data stream are associated to obtain an audio and video data stream.

[0040] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0041] Based on the index value of the first data stream, query in the preset audio and video association table to obtain the second data stream, the first data stream is an audio data stream or a video data stream; the second data stream is the peer data stream of the first data stream;

[0042] The first data stream and the second data stream are associated to obtain an audio and video data stream.

[0043] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0044] Based on the index value of the first data stream, query in the preset audio and video association table to obtain the second data stream, the first data stream is an audio data stream or a video data stream; the second data stream is the peer data stream of the first data stream;

[0045] The first data stream and the second data stream are associated to obtain an audio and video data stream.

[0046] The above-mentioned audio and video association method, device, computer equipment and readable storage medium obtain the audio and video data stream by querying the second data stream corresponding to the index value of the first data stream in the preset audio and video association table, and associating the first data stream and the second data stream. It can synchronously obtain the audio data stream and video data stream of the call to be processed, and can more comprehensively obtain audio and video information. At the same time, it provides users with a complete audio-visual experience and enhances the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0048] FIG1 is a schematic diagram of a flow chart of a method for associating audio and video in one embodiment;

[0049] FIG2 is a schematic diagram of a message format in an embodiment;

[0050] FIG3 is a schematic diagram of a flow chart of a method for associating audio and video in one embodiment;

[0051] FIG4 is a structural block diagram of an audio and video association device in one embodiment;

[0052] FIG. 5 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0053] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0054] In one embodiment, as shown in FIG1 , a method for associating audio and video is provided. This embodiment is illustrated by applying the method to a terminal. It is understandable that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:

[0055] Step 101: Based on the index value of the first data stream, query in a preset audio and video association table to obtain a second data stream.

[0056] The first data stream is an audio data stream or a video data stream; the first data stream may also be a reorganized data stream. The index value may be a binary hash value. The preset audio and video association table may be a hash table with a binary hash value as an index. The preset audio and video association table may include the reorganized data stream and the index value corresponding to the reorganized data stream. The second data stream is the peer data stream of the first data stream. For example, the first data stream is an audio data stream, and the second data stream is a video data stream; the first data stream may also be a video data stream, and the second data stream may correspond to an audio data stream.

[0057] Specifically, the terminal can obtain the binary hash value of the first data stream in the private data domain. The terminal can search for the data stream associated with the index value of the first data stream in the preset audio and video association table. If the terminal queries the preset audio and video association table and finds that there is an index value consistent with the index value of the first data stream, the terminal will store the data stream corresponding to the index value stored in the preset audio and video association table, and determine the data stream as the second data stream.

[0058] Step 102: Associating the first data stream and the second data stream to obtain an audio and video data stream.

[0059] The terminal may associate the first data stream with the second data stream to obtain an audio and video data stream. In addition, the terminal may also use a preset merging tool to merge the audio and video data streams to obtain a file in MP4 (MPEG-4 Part 14) format, and the MP4 file may be directly played offline. Exemplarily, the preset merging tool may be Fast Forward Moving Picture Experts Group (ffmpeg).

[0060] In the above-mentioned audio and video association method, by querying the second data stream corresponding to the index value of the first data stream in the preset audio and video association table, the first data stream and the second data stream are associated to obtain the audio and video data stream, which can synchronously obtain the audio data stream and video data stream of the call to be processed, and can more comprehensively obtain audio and video information, while providing users with a complete audio-visual experience and enhancing the user experience.

[0061] In an exemplary embodiment, the audio and video association method further includes:

[0062] Acquire a real-time data stream; parse each message in the real-time data stream based on a preset message load structure to obtain message parameters of each message; reorganize each message based on a preset arrangement order and a sequence number of each message to obtain a reorganized data stream; decode the reorganized data stream based on a coding method to obtain a first data stream.

[0063] The real-time data stream may be a real-time transport protocol (RTP) data stream, which is a data stream to be reassembled and may include multiple messages. The preset message payload structure may be an RTP protocol payload structure, and the message parameters at least include but are not limited to a coding method (PT), a sequence number (sequencenumber), a timestamp (timestamp), and a session number (ssrc). The message parameters include a session number and a sequence number, and the session numbers for the same data stream are the same. Based on this, the preset arrangement order is that the sequence numbers are arranged in ascending order.

[0064] Specifically, the terminal can obtain the data stream to be reassembled, and the terminal can determine the encoding mode (PT), sequence number (sequence number), timestamp (timestamp) and session number (ssrc) in each RTP message header in the real-time data stream based on the RTP protocol load structure. The session number of the same data stream is the same, based on this, the terminal can obtain multiple messages with the same session number, and sort each message according to the target order and the sequence number of each message to obtain the reassembled data stream; for example, the target order can be the order of the sequence number from small to large, or it can also be the order from large to small.

[0065] Exemplarily, Figure 2 is a schematic diagram of the format of a message in an embodiment, wherein PT represents the effective load type, i.e., the media stream encoding method, which occupies 7 bits; sequence number represents the sequence number, which occupies 16 bits and is used to identify the sequence number of the RTP message sent by the sender. The sequence number increases by 1 for each message sent; timestamp represents the timestamp, which occupies 32 bits and reflects the sampling time of the RTP message; ssrc is used to identify the synchronization source, which occupies 32 bits. The value of the identifier is randomly selected, but the ssrc of the same source is the same.

[0066] After the reorganization is completed, the data decoding operation is performed according to the PT encoding type. It should be noted here that the encoding method PT may be static encoding or dynamic encoding. If the PT value is less than 96, the encoding method can be obtained through a fixed mapping relationship, such as 9 for G722 encoding; if the PT value is greater than or equal to 96, it is necessary to obtain the encoding method of the current stream through the SIP dynamic encoding mapping relationship saved in the private data field of the stream, and 96 represents H264 encoding.

[0067] In this embodiment, the message is parsed by a preset message payload structure, and each message is reassembled based on the parsed message parameters, and the reassembled data stream is decoded to obtain the first data stream, thereby improving the restoration rate of the data stream.

[0068] In an exemplary embodiment, the audio and video association method further includes:

[0069] Based on a preset hash algorithm, a first two-tuple hash value of the source address and port information of the User Datagram Protocol UDP traffic and a second two-tuple hash value of the destination address and port information are calculated; based on the first two-tuple hash value or the second two-tuple hash value, a target node is searched in a preset associated flow table, and the UDP traffic is determined as the real-time data stream.

[0070] Among them, the source address port information at least includes the source communication address and the source communication port; the destination address port information at least includes the destination communication address and the destination communication port. The preset associated flow table can be a VoIP associated flow table, and the VoIP associated flow table is a hash table with a two-tuple hash value as an index; the preset associated flow table at least includes the address port information corresponding to the data flow and the index value corresponding to the address port information. The target node can be a media information description node. Exemplarily, the preset hash algorithm can be an MD5 algorithm or a SHA-1 algorithm, etc., and the specific type of the preset hash algorithm is not limited here.

[0071] Specifically, the terminal can receive User Datagram Protocol (UDP) traffic of a non-public port and determine the source address information and port address information of the UDP traffic. The terminal forms a tuple of the source communication address and the source communication port of the UDP traffic, and forms a tuple of the destination communication address and the destination communication port. The terminal calculates the tuple composed of the source communication address and the source communication port based on a preset hash algorithm to obtain a source tuple hash value (a first tuple hash value), and calculates the tuple composed of the destination communication address and the destination communication port to obtain a destination tuple hash value (a second tuple hash value). The terminal can use the first tuple hash value or the second tuple hash value as an index value to find out whether there is a corresponding target node in the VoIP associated flow table. If the first tuple hash value is used as an index value to query a target node, the UDP traffic is determined to be a real-time data stream; if not, the second tuple hash value is used as an index value for querying. The terminal copies the address port information of the target node and the tuple hash value corresponding to the address port information to the private data domain.

[0072] In this embodiment, the real-time data stream is determined by searching for the target node in the preset associated stream table, so as to be subsequently merged with the audio data stream and the video data stream.

[0073] In an exemplary embodiment, the audio and video association method further includes:

[0074] Based on a preset keyword matching method, information is extracted from the media information of the signaling stream to obtain the address port information of the audio data stream and the address port information of the video data stream in the signaling stream; based on a preset hash algorithm and the address port information of the audio data stream, a two-tuple hash value of the audio data stream is calculated; based on a preset hash algorithm and the address port information of the video data stream, a two-tuple hash value of the video data stream is calculated; the two-tuple hash value of the audio data stream and the two-tuple hash value of the video data stream are stored in a target node, the two-tuple hash value of the audio data stream is determined as an index value, and inserted into a preset associated stream table.

[0075] The address port information may specifically include transmission IP, transmission port, encoding type and sampling rate.

[0076] Specifically, the terminal identifies the SIP signaling stream through the well-known port 5060 as the destination port. During a video call, the SDP of the SIP load will contain both the media information of the audio data stream and the media information of the video data stream. The terminal extracts the address and port information of the audio data stream and the address and port information of the video data stream from the media information through a preset keyword matching method. The terminal calculates the IP and port binary hash values ​​of the audio and the IP and port binary hash values ​​of the video. Taking the first data stream as an audio data stream as an example, the terminal can apply for a media information description node, and save the binary hash value of the audio and video data stream in the media information description node. The terminal uses the binary hash value of the audio data stream as an index value and inserts it into the VoIP associated flow table. Or the terminal can store the address and port information of the audio and video data stream in a preset associated flow table, each address and port information corresponds to an index item, and the terminal can match the corresponding index item based on the index value. The terminal calculates the binary hash value corresponding to the video data stream based on the preset hash algorithm and the media description information of the video data stream, and determines the binary hash value as the index value. The terminal stores the binary hash value of the audio data stream and the binary hash value of the video data stream to the target node based on the index value, determines the binary hash value of the audio data stream as the index value, and inserts it into the preset associated flow table.

[0077] Exemplarily, the terminal can identify the SDP structure and obtain the address port information of the audio and video data stream based on the identified SDP structure. Specifically, the transmission IP of the audio and video data stream is 10.12.9.117, the transmission port of the audio data stream is 53159, the available encoding methods are 18 and 101, 18 represents the static encoding method G729, 101 represents the dynamic encoding method telephone-event, and the time frequency is 8000; the transmission port of the video data stream is 53161, the encoding method is 96, which represents the dynamic encoding method H264, and the time frequency is 90000.

[0078] For example, taking the audio data stream as an example, the terminal can apply for a media information description node, save the address port information of the audio data stream extracted from the signaling stream and the two-tuple hash value of the video media of this call, and add it to the preset associated flow table with the two-tuple hash value of the audio data stream as the index. When processing the video data stream, the terminal saves the address port information of the video data stream, and inserts the two-tuple hash value of the audio data stream as the index into the preset associated flow table.

[0079] In this embodiment, the audio and video are parsed through the media information of the signaling stream to obtain a preset associated stream table, so as to associate the subsequent audio data stream with the corresponding video data stream.

[0080] In an exemplary embodiment, the audio and video association method further includes:

[0081] If the second data stream is not found in the preset audio and video association table, the binary hash value in the reverse direction is calculated based on the address port information in the reverse direction; the preset audio and video association table is queried based on the binary hash value in the reverse direction to obtain the second data stream.

[0082] Specifically, if the second data stream is not found in the preset audio association table, the terminal reversely combines the address port information, calculates the reversely combined address port information based on the preset hash algorithm, and obtains a binary hash value in the reverse direction. The terminal queries the preset audio and video association table based on the binary hash value in the reverse direction to obtain the second data stream.

[0083] In this embodiment, when the second data stream is not queried, the preset audio and video association table is queried through the address port information in the reverse direction to obtain the second data stream, which can further improve the restoration rate of audio and video.

[0084] In an exemplary embodiment, the audio and video association method further includes:

[0085] If the second data stream is not found in the preset audio and video association table, the binary hash value of the video data stream is determined as the index value and added to the preset audio and video association table.

[0086] Specifically, if the terminal fails to find the second data stream in the preset audio and video association table, the binary hash value of the video data stream is used as an index, the first data stream is added to the preset audio and video association table, and the query is performed after the associated data streams are reassembled. That is, if one of the audio data stream and the video data stream is reassembled first, the preset audio and video association table will be added first, and after the other is reassembled, the binary hash value of the data stream can be used to query the corresponding data stream from the preset audio and video association table. In addition, if the corresponding data stream is not found, the file corresponding to the current data stream is directly output, and the node in the preset audio and video association table is directly released.

[0087] In this embodiment, when the second data stream is not found, the first data stream is added to the preset audio and video association table, thereby improving the audio and video association efficiency.

[0088] In an exemplary embodiment, the audio and video association method further includes:

[0089] In the preset audio and video association table, if the first data stream does not find the second data stream within a preset time length, the first data stream is output.

[0090] Specifically, a node timeout policy is set in the preset audio and video association table. If the first data stream does not find the media data of the other end within the preset time, the current first data stream is directly released and output without further waiting, and the node in the association table is directly released.

[0091] In this embodiment, by outputting the data stream for which the peer data stream is not found, the memory usage and the overhead of global hash table query are reduced.

[0092] In an exemplary embodiment, after the audio and video data are associated, ffmpeg is used to merge the audio and video into an MP4 file for output. When merging, if the start time of the audio is greater than the start time of the video, a black screen video with a duration equal to the time difference between the two is constructed, the black screen video is merged with the original video, and then the merged video is merged with the audio to ensure that the start time axis of the audio and video are consistent; if the start time of the video is greater than the start time of the audio, the audio is delayed so that the audio starts playing from the correct time axis, and the merged MP4 video is silent in the part without audio in the front after the merger. It can alleviate the phenomenon of audio and video being out of sync after the audio and video are merged to a certain extent.

[0093] In an exemplary embodiment, as shown in FIG3 , FIG3 is a flow chart of an audio and video association method in an embodiment, and the audio and video association method specifically includes the following steps:

[0094] Step 301: The terminal may create a preset associated flow table and a preset audio and video associated table.

[0095] Step 302: The terminal can identify the signaling flow according to the known port, parse the signaling flow, extract the address and port information of the audio and video data flow, calculate the index value by IP and port, and add the address and port information to the preset associated flow table.

[0096] Step 303: The terminal uses the IP and port tuple to calculate the index value for the non-public port UDP traffic, searches for media description information from the preset associated flow table, and parses the data flow messages in sequence to obtain the first data flow.

[0097] Step 304: the terminal searches the preset audio and video association table for the second data stream corresponding to the first data stream, and associates the first data stream with the second data stream; merges the associated audio and video data, and restores the output mp4 file.

[0098] In this embodiment, the identification, reorganization, decoding, association, and merging of audio and video media are all completed in one software device. The output files do not require additional processing by a third party, nor do they require manual synchronization or management of multiple files. They can be directly played, distributed, or archived, thereby improving the user experience.

[0099] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0100] Based on the same inventive concept, the embodiment of the present application also provides an audio and video association device for implementing the audio and video association method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the one or more audio and video association device embodiments provided below can refer to the limitations of the audio and video association method above, and will not be repeated here.

[0101] In an exemplary embodiment, as shown in FIG. 4 , an audio and video association device is provided. The audio and video association device 40 includes: a query module 41 and an association module 42, wherein:

[0102] A query module 41 is used to query a preset audio and video association table based on an index value of the first data stream to obtain a second data stream, wherein the first data stream is an audio data stream or a video data stream; and the second data stream is a peer data stream of the first data stream;

[0103] The association module 42 is used to associate the first data stream and the second data stream to obtain an audio and video data stream.

[0104] In one embodiment, the query module 41 is also used to obtain real-time data streams;

[0105] Based on a preset message payload structure, each message in the real-time data stream is parsed to obtain message parameters of each message, where the message parameters at least include a sequence number and an encoding method;

[0106] Based on a preset arrangement order and a sequence number of each message, each message is reassembled to obtain a reassembled data stream;

[0107] The reorganized data stream is decoded based on the encoding method to obtain a first data stream.

[0108] In one of the embodiments, the query module 41 is further used to calculate a first two-tuple hash value of source address port information of User Datagram Protocol UDP traffic and a second two-tuple hash value of destination address port information based on a preset hash algorithm;

[0109] Based on the first two-tuple hash value or the second two-tuple hash value, the target node is searched in the preset associated flow table, and the UDP traffic is determined as a real-time data flow.

[0110] In one embodiment, the query module 41 is further used to extract information from the media information of the signaling stream based on a preset keyword matching method to obtain the address port information of the audio data stream and the address port information of the video data stream in the signaling stream;

[0111] Based on a preset hash algorithm and the address port information of the audio data stream, a binary hash value of the audio data stream is calculated; based on a preset hash algorithm and the address port information of the video data stream, a binary hash value of the video data stream is calculated;

[0112] The binary hash value of the audio data stream and the binary hash value of the video data stream are stored in the target node, the binary hash value of the audio data stream is determined as an index value, and inserted into a preset associated stream table.

[0113] In one embodiment, the query module 41 is further configured to calculate a binary hash value in the reverse direction based on the address port information in the reverse direction if the second data stream is not found in the preset audio and video association table;

[0114] A query is performed in the preset audio and video association table based on the binary hash value in the reverse direction to obtain the second data stream.

[0115] In one embodiment, the query module 41 is further configured to determine the binary hash value of the video data stream as an index value and add the index value to the preset audio and video association table if the second data stream is not found in the preset audio and video association table.

[0116] In one embodiment, the query module 41 is further configured to output the first data stream if the second data stream is not found in the preset audio and video association table within a preset time period.

[0117] Each module in the above-mentioned audio and video association device can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each of the above modules.

[0118] In an exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be shown in FIG5. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, the memory, and the input / output interface are connected via a system bus, and the communication interface, the display unit, and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner may be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a method for associating audio and video is implemented. The display unit of the computer device is used to form a visually visible picture, which may be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.

[0119] Those skilled in the art will understand that the structure shown in FIG. 5 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0120] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0121] Based on the index value of the first data stream, a query is performed in a preset audio and video association table to obtain a second data stream, where the first data stream is an audio data stream or a video data stream; and the second data stream is a peer data stream of the first data stream;

[0122] The first data stream and the second data stream are associated to obtain an audio and video data stream.

[0123] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0124] Get real-time data streams;

[0125] Based on a preset message payload structure, each message in the real-time data stream is parsed to obtain message parameters of each message, where the message parameters at least include a sequence number and an encoding method;

[0126] Based on a preset arrangement order and a sequence number of each message, each message is reassembled to obtain a reassembled data stream;

[0127] The reorganized data stream is decoded based on the encoding method to obtain a first data stream.

[0128] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0129] Calculate a first two-tuple hash value of source address and port information of User Datagram Protocol (UDP) traffic and a second two-tuple hash value of destination address and port information based on a preset hash algorithm;

[0130] Based on the first two-tuple hash value or the second two-tuple hash value, the target node is searched in the preset associated flow table, and the UDP traffic is determined as a real-time data flow.

[0131] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0132] Extracting the media information of the signaling stream based on a preset keyword matching method to obtain the address port information of the audio data stream and the address port information of the video data stream in the signaling stream;

[0133] Based on a preset hash algorithm and the address port information of the audio data stream, a binary hash value of the audio data stream is calculated; based on a preset hash algorithm and the address port information of the video data stream, a binary hash value of the video data stream is calculated;

[0134] The binary hash value of the audio data stream and the binary hash value of the video data stream are stored in the target node, the binary hash value of the audio data stream is determined as an index value, and inserted into a preset associated stream table.

[0135] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0136] If the second data stream is not found in the preset audio and video association table, a binary hash value in the reverse direction is calculated based on the address port information in the reverse direction;

[0137] A query is performed in the preset audio and video association table based on the binary hash value in the reverse direction to obtain the second data stream.

[0138] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0139] If the second data stream is not found in the preset audio and video association table, the binary hash value of the video data stream is determined as the index value and added to the preset audio and video association table.

[0140] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0141] In the preset audio and video association table, if the first data stream does not find the second data stream within the preset time length, the first data stream is output.

[0142] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0143] Based on the index value of the first data stream, a query is performed in a preset audio and video association table to obtain a second data stream, where the first data stream is an audio data stream or a video data stream; and the second data stream is a peer data stream of the first data stream;

[0144] The first data stream and the second data stream are associated to obtain an audio and video data stream.

[0145] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0146] Get real-time data streams;

[0147] Based on a preset message payload structure, each message in the real-time data stream is parsed to obtain message parameters of each message, where the message parameters at least include a sequence number and an encoding method;

[0148] Based on a preset arrangement order and a sequence number of each message, each message is reassembled to obtain a reassembled data stream;

[0149] The reorganized data stream is decoded based on the encoding method to obtain a first data stream.

[0150] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0151] Calculate a first two-tuple hash value of source address and port information of User Datagram Protocol (UDP) traffic and a second two-tuple hash value of destination address and port information based on a preset hash algorithm;

[0152] Based on the first two-tuple hash value or the second two-tuple hash value, the target node is searched in the preset associated flow table, and the UDP traffic is determined as a real-time data flow.

[0153] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0154] Extracting the media information of the signaling stream based on a preset keyword matching method to obtain the address port information of the audio data stream and the address port information of the video data stream in the signaling stream;

[0155] Based on a preset hash algorithm and the address port information of the audio data stream, a binary hash value of the audio data stream is calculated; based on a preset hash algorithm and the address port information of the video data stream, a binary hash value of the video data stream is calculated;

[0156] The binary hash value of the audio data stream and the binary hash value of the video data stream are stored in the target node, the binary hash value of the audio data stream is determined as an index value, and inserted into a preset associated stream table.

[0157] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0158] If the second data stream is not found in the preset audio and video association table, a binary hash value in the reverse direction is calculated based on the address port information in the reverse direction;

[0159] A query is performed in the preset audio and video association table based on the binary hash value in the reverse direction to obtain the second data stream.

[0160] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0161] If the second data stream is not found in the preset audio and video association table, the binary hash value of the video data stream is determined as the index value and added to the preset audio and video association table.

[0162] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0163] In the preset audio and video association table, if the first data stream does not find the second data stream within the preset time length, the first data stream is output.

[0164] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:

[0165] Based on the index value of the first data stream, a query is performed in a preset audio and video association table to obtain a second data stream, where the first data stream is an audio data stream or a video data stream; and the second data stream is a peer data stream of the first data stream;

[0166] The first data stream and the second data stream are associated to obtain an audio and video data stream.

[0167] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0168] Get real-time data streams;

[0169] Based on a preset message payload structure, each message in the real-time data stream is parsed to obtain message parameters of each message, where the message parameters at least include a sequence number and an encoding method;

[0170] Based on a preset arrangement order and a sequence number of each message, each message is reassembled to obtain a reassembled data stream;

[0171] The reorganized data stream is decoded based on the encoding method to obtain a first data stream.

[0172] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0173] Calculate a first two-tuple hash value of source address and port information of User Datagram Protocol (UDP) traffic and a second two-tuple hash value of destination address and port information based on a preset hash algorithm;

[0174] Based on the first two-tuple hash value or the second two-tuple hash value, the target node is searched in the preset associated flow table, and the UDP traffic is determined as a real-time data flow.

[0175] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0176] Extracting the media information of the signaling stream based on a preset keyword matching method to obtain the address port information of the audio data stream and the address port information of the video data stream in the signaling stream;

[0177] Based on a preset hash algorithm and the address port information of the audio data stream, a binary hash value of the audio data stream is calculated; based on a preset hash algorithm and the address port information of the video data stream, a binary hash value of the video data stream is calculated;

[0178] The binary hash value of the audio data stream and the binary hash value of the video data stream are stored in the target node, the binary hash value of the audio data stream is determined as an index value, and inserted into a preset associated stream table.

[0179] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0180] If the second data stream is not found in the preset audio and video association table, a binary hash value in the reverse direction is calculated based on the address port information in the reverse direction;

[0181] A query is performed in the preset audio and video association table based on the binary hash value in the reverse direction to obtain the second data stream.

[0182] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0183] If the second data stream is not found in the preset audio and video association table, the binary hash value of the video data stream is determined as the index value and added to the preset audio and video association table.

[0184] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0185] In the preset audio and video association table, if the first data stream does not find the second data stream within the preset time length, the first data stream is output.

[0186] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0187] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0188] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A method for associating audio and video, characterized in that: The method comprises: Based on the index value of the first data stream, query in the preset audio and video association table to obtain the second data stream, the first data stream is an audio data stream or a video data stream; the second data stream is the peer data stream of the first data stream; The first data stream and the second data stream are associated to obtain an audio and video data stream.

2. The method according to claim 1, characterized in that The method further comprises: Get real-time data streams; Based on a preset message payload structure, each message in the real-time data stream is parsed to obtain message parameters of each message, wherein the message parameters include at least a sequence number and an encoding method; Based on a preset arrangement order and a sequence number of each of the messages, reorganize each of the messages to obtain a reorganized data stream; The reorganized data stream is decoded based on the encoding method to obtain a first data stream.

3. The method according to claim 2, characterized in that The method further comprises: Calculate a first two-tuple hash value of source address and port information of User Datagram Protocol (UDP) traffic and a second two-tuple hash value of destination address and port information based on a preset hash algorithm; Based on the first two-tuple hash value or the second two-tuple hash value, the target node is searched in the preset associated flow table, and the UDP traffic is determined as the real-time data flow.

4. The method according to claim 3, characterized in that The method further comprises: Extracting the media information of the signaling stream based on a preset keyword matching method to obtain the address port information of the audio data stream and the address port information of the video data stream in the signaling stream; Based on the preset hash algorithm and the address port information of the audio data stream, calculate the binary hash value of the audio data stream; based on the preset hash algorithm and the address port information of the video data stream, calculate the binary hash value of the video data stream; The binary hash value of the audio data stream and the binary hash value of the video data stream are stored in the target node, the binary hash value of the audio data stream is determined as the index value, and inserted into the preset associated stream table.

5. The method according to claim 1, characterized in that The method further comprises: If the second data stream is not found in the preset audio and video association table, calculating a binary hash value in the reverse direction based on the address port information in the reverse direction; The preset audio and video association table is queried based on the binary hash value in the reverse direction to obtain the second data stream.

6. The method according to claim 4, characterized in that The method further comprises: If the second data stream is not found in the preset audio and video association table, the binary hash value of the video data stream is determined as an index value and added to the preset audio and video association table.

7. The method according to claim 1, characterized in that The method further comprises: In the preset audio and video association table, if the first data stream does not find the second data stream within a preset time length, the first data stream is output.

8. An audio and video association device, characterized in that: The device comprises: A query module, configured to query a preset audio and video association table based on an index value of a first data stream to obtain a second data stream, wherein the first data stream is an audio data stream or a video data stream; and the second data stream is a peer data stream of the first data stream; The association module is used to associate the first data stream and the second data stream to obtain an audio and video data stream.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.