Video code stream transmission method and device, electronic equipment and storage medium
By splitting and reorganizing the video code stream using random strings and target sequences in video code streaming, the security problem of video code streaming is solved, and efficient and secure video code streaming is achieved.
Patent Information
- Application Number
- CN202311202718.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-18
- Publication Date
- 2025-03-18
AI Technical Summary
The prior art has security problems when streaming video codes in security monitoring systems, which are easily intercepted and tampered.
By generating a random string and generating a target sequence based on the string, the video code stream to be transmitted is split, at least two serialized byte streams are generated, and they are transmitted to the receiving end according to the corresponding serialization channel, and the receiving end recombines the video code stream according to the random string and the target sequence.
It effectively ensures the security of video streaming, reduces system resource expenditure, improves data processing performance, and improves the real-time performance of video streaming display.
Smart Images

Figure CN119653195A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of video transmission technology, and in particular to a video code stream transmission method, device, electronic equipment and storage medium. Background Art
[0002] In security monitoring systems, when transmitting video streams between cameras and various servers or video request terminals, most cameras use transmission protocols such as SIP, RTSP, and RTMP to send video streams to the video request terminals in the form of plain text streams. This will result in the video stream being transmitted over the network. The video content can be intercepted and tampered with in the form of message capture in the network link.
[0003] In the related art, in order to ensure the security of video stream transmission, the camera encrypts the video stream based on an encryption algorithm and transmits the encrypted video stream to the video request end, and then the video request end decrypts the received encrypted video stream. However, many encryption and decryption algorithms still have many security issues and cannot well ensure the security of video stream transmission. Summary of the invention
[0004] The present invention provides a video code stream transmission method, device, electronic equipment and storage medium to solve the security problem of video code stream transmission.
[0005] According to one aspect of the present invention, a video code stream transmission method is provided, which is applied to a first electronic device, and the method includes:
[0006] In response to a video code stream transmission event being triggered, a random string is generated, and a target sequence is generated based on the random string;
[0007] Based on the target sequence, the initial video code stream to be transmitted is split into bytes to generate at least two serialized byte streams;
[0008] The at least two serialized byte streams are transmitted to a second electronic device according to corresponding serialized channels, and the random character string is transmitted to the second electronic device.
[0009] According to another aspect of the present invention, a video code stream transmission method is provided, which is applied to a second electronic device, and the method includes:
[0010] Receiving at least two serialized byte streams and a random character string sent by a first electronic device through a network link;
[0011] generating a target sequence based on the random string;
[0012] The at least two serialized byte streams are reassembled into a target video code stream based on the target sequence.
[0013] According to another aspect of the present invention, a video code stream transmission device is provided, which is applied to a first electronic device, and the device includes:
[0014] A first target sequence generation module, configured to generate a random string in response to a video code stream transmission event being triggered, and to generate a target sequence based on the random string;
[0015] A serialized byte stream generation module, used for splitting the initial video code stream to be transmitted in bytes based on the target sequence to generate at least two serialized byte streams;
[0016] The serialized byte stream transmission module is used to transmit the at least two serialized byte streams to the second electronic device according to the corresponding serialization channels, and transmit the random character string to the second electronic device.
[0017] According to another aspect of the present invention, a video code stream transmission device is provided, which is applied to a second electronic device, and the device includes:
[0018] A serialized byte stream receiving module, used to receive at least two serialized byte streams and a random character string sent by the first electronic device through a network link;
[0019] A second target sequence generation module, used to generate a target sequence based on the random string;
[0020] The serialized byte stream reassembly module is used to reassemble the at least two serialized byte streams into a target video code stream based on the target sequence.
[0021] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0022] at least one processor; and
[0023] a memory communicatively connected to the at least one processor; wherein,
[0024] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the video code stream transmission method described in any embodiment of the present invention.
[0025] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the video code stream transmission method described in any embodiment of the present invention when executed.
[0026] The video code stream transmission scheme of the embodiment of the present invention is applied to a first electronic device, and the method includes: in response to a video code stream transmission event being triggered, generating a random string, and generating a target sequence based on the random string; splitting the initial video code stream to be transmitted in bytes based on the target sequence to generate at least two serialized byte streams; transmitting the at least two serialized byte streams to a second electronic device according to the corresponding serialization channel, and transmitting the random string to the second electronic device. The technical solution provided by the embodiment of the present invention not only effectively guarantees the security of video code stream transmission, but also effectively reduces system resource expenditure and improves data processing performance because there is no need to perform encryption operations on the video code stream.
[0027] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0029] Figure 1 is a flowchart of a video code stream transmission method provided according to Embodiment 1 of the present invention;
[0030] Figure 2 is a flowchart of a video code stream transmission method provided according to Embodiment 2 of the present invention;
[0031] Figure 3 is a schematic diagram of the format of a data packet provided by an embodiment of the present invention;
[0032] Figure 4 is a flowchart of a video code stream transmission method provided according to Embodiment 3 of the present invention;
[0033] Figure 5 This is a schematic diagram of a video code stream transmission scenario provided by an embodiment of the present invention;
[0034] Figure 6 is a structural schematic diagram of a video code stream transmission device provided according to a fourth embodiment of the present invention;
[0035] Figure 7 is a structural schematic diagram of a video code stream transmission device provided according to Embodiment 5 of the present invention;
[0036] Figure 8 It is a structural schematic diagram of an electronic device for implementing the video code stream transmission method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0037] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0038] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0039] Embodiment 1
[0040] Figure 1 A flowchart of a video code stream transmission method is provided for the first embodiment of the present invention. This embodiment is applicable to the case of transmitting a video code stream. The method can be performed by a video code stream transmission device. The video code stream transmission device can be implemented in the form of hardware and / or software. The video code stream transmission device can be configured in a first electronic device. Figure 1 As shown, the method includes:
[0041] S110 . In response to a video code stream transmission event being triggered, generate a random string, and generate a target sequence based on the random string.
[0042] The first electronic device may be a transmitter for video code stream transmission, that is, a video code stream transmitter. The first electronic device may be an electronic device such as a camera or a server.
[0043] In an embodiment of the present invention, when a video request sent by a video request end is received, it indicates that a video stream transmission event is triggered, or when a video sending instruction input by a user is received, it indicates that a video stream transmission event is triggered. In response to the video stream transmission event being triggered, a random string is generated. It should be noted that the embodiment of the present invention does not limit the length of the random string. The random string is processed to generate a target sequence. For example, the random string can be processed according to a preset algorithm to generate a target sequence, such as performing an asymmetric operation on the random string to generate a target sequence; for example, the user name and user password can be obtained, and then the user name, user password and random string are concatenated and asymmetric operations are performed to generate a target sequence.
[0044] Optionally, in response to a video stream transmission event being triggered, a random string is generated, and a target sequence is generated based on the random string, including: in response to a video stream transmission event being triggered, authentication information is obtained and a random string is generated; based on a preset encryption algorithm, a target sequence is generated according to the authentication information and the random string. Exemplarily, when a video request sent by a video request end is received, the authentication information contained in the video request is obtained, wherein the authentication information may include a user name and a user password. Based on a preset encryption algorithm, a target sequence is generated according to the authentication information and the random string. Exemplarily, the authentication information and the random string are operated based on the MD5 algorithm to generate a target sequence, wherein the target sequence = MD5 (user name + random string + user password). For example, the target sequence can be a character sequence of a preset length consisting of 0 and 1.
[0045] S120: Split the initial video code stream to be transmitted into bytes based on the target sequence to generate at least two serialized byte streams.
[0046] In the embodiment of the present invention, the initial video code stream to be transmitted is split into bytes based on the target sequence to generate at least two serialized byte streams. It should be noted that the embodiment of the present invention does not limit the number of serialized byte streams, which can be two, three, or more.
[0047] Optionally, the splitting of the video stream to be transmitted based on the target sequence in units of bytes to generate at least two serialized byte streams includes: determining the total number N of serialized byte stream channels; wherein N is an integer greater than or equal to 2; and distributing the video stream to be transmitted to N serialized byte stream channels in units of bytes according to a preset splitting rule and the total number of serialized byte stream channels and the target sequence to generate N serialized byte streams.
[0048] In an embodiment of the present invention, the total number N of serialized byte stream channels is determined, wherein the first electronic device may determine the total number N of serialized byte stream channels according to the size of the initial video code stream to be transmitted, or may randomly determine the total number N of serialized byte stream channels, or may be set by the user in the first electronic device. According to the preset splitting rule, the video code stream to be transmitted is distributed to the N serialized byte stream channels in units of bytes according to the total number of serialized byte stream channels and the target sequence, thereby generating N serialized byte streams.
[0049] Exemplarily, the total number of serialized byte stream channels N is converted into a binary number to determine the number of binary bits occupied by the serialized byte stream channels. For example, when the total number of serialized byte stream channels N is 8, the corresponding binary number is 0B1000, so four binary bits are required to identify a serialized byte stream channel number. Therefore, starting from the start position of the target sequence, four bits are taken from the target sequence each time, and the values corresponding to the four bits taken are used as the serial number of the serialized byte stream channel. Starting from the first byte data of the video code stream, the byte data is distributed to the serialized byte stream channel of the corresponding serial number, and so on, thereby generating N serialized byte streams. For example, the target sequence is 001000010101011101010101..., then starting from the starting position of the target sequence, the serialized byte stream channels corresponding to every four bits in the target sequence are S2, S1, S5, S7, S6, S6..., respectively. Therefore, starting from the first byte data of the video code stream, the first byte data is distributed to the serialized byte stream channel S2, the second byte data is distributed to the serialized byte stream channel S1, the third byte data is distributed to the serialized byte stream channel S5, the fourth byte data is distributed to the serialized byte stream channel S7, the fifth byte data is distributed to the serialized byte stream channel S6, the sixth byte data is distributed to the serialized byte stream channel S6,..., and so on. After the byte data is distributed to the serialized byte stream channel corresponding to the channel number determined based on the last four bits of the target sequence, the target sequence is looped, and the following byte data is distributed to each serialized byte stream channel corresponding to every four bits in the target sequence in turn.
[0050] Optionally, the target sequence is looped, and the byte data in the video code stream corresponding to the 0 position in the target sequence is distributed to the first serialized byte stream channel, and the byte data in the video code stream corresponding to the 1 position in the target sequence is distributed to the second serialized byte stream channel; wherein the first serialized byte stream channel is a serialized byte stream channel with odd numbers, and the second serialized byte stream is a serialized byte stream channel with even numbers; or, the first serialized byte stream is a serialized byte stream with even numbers, and the second serialized byte stream is a serialized byte stream with odd numbers; wherein, the order of the 0 position is different, and the corresponding byte data is distributed to different first serialized byte stream channels, and the order of the 1 position is different, and the corresponding byte data is distributed to different second serialized byte streams.
[0051] Exemplarily, each serialized byte stream channel is numbered, wherein the serialized byte stream channel sequence numbers are divided into odd and even. For example, if the total number of serialized byte stream channels is 6, the sequence numbers of the serialized byte stream channels can be S1, S2, S3, S4, S5 and S6. Obviously, the serialized byte stream channels with odd sequence numbers are S1, S3, S5, and the serialized byte stream channels with even sequence numbers are S2, S4, S6. 0 in the target sequence corresponds to the serialized byte stream channel with an odd sequence number, and 1 in the target sequence corresponds to the serialized byte stream channel with an even sequence number. It can be understood that starting from the starting position of the target sequence, a bit is taken from the target sequence each time, and the corresponding serialized byte stream channel with an even sequence number or the serialized byte stream channel with an even sequence number is determined according to the value (0 or 1) corresponding to the taken bit. Exemplarily, the first 0 in the target sequence can correspond to the serialized byte stream channel S1, the second 0 corresponds to the serialized byte stream channel S3, the third 0 corresponds to the serialized byte stream channel S5, the fourth 0 corresponds to the serialized byte stream channel S1, the fifth 0 corresponds to the serialized byte stream channel S3, and the sixth 0 corresponds to the serialized byte stream channel S5, and so on. Similarly, the first 1 in the target sequence corresponds to the serialized byte stream channel S2, the second 1 corresponds to the serialized byte stream channel S4, the third 1 corresponds to the serialized byte stream channel S6, the fourth 1 corresponds to the serialized byte stream channel S2, the fifth 1 corresponds to the serialized byte stream channel S4, and the sixth 1 corresponds to the serialized byte stream channel S6, and so on. Starting from the first byte data of the video code stream, the first byte data is distributed to the serialized byte stream channel corresponding to the first bit in the target sequence, and the second byte data is distributed to the serialized byte stream channel corresponding to the second bit in the target sequence, and so on, thereby generating N serialized byte streams.
[0052] For example, the target sequence is 001000010101..., then starting from the starting position of the target sequence, the serialized byte stream channels corresponding to each bit in the target sequence are S1, S3, S2, S5, S1, S3, S5, S4, S1, S6, S3, S2..., therefore, starting from the first byte data of the video code stream, the first byte data to the tenth byte data are distributed to the serialized byte stream channels S1, S3, S2, S5, S1, S3, S5, S4, S1, S6, S3, S2, and so on. After the byte data is distributed to the serialized byte stream channel corresponding to the channel number determined based on the last bit of the target sequence, the target sequence is looped, and the subsequent byte data are distributed to each serialized byte stream channel corresponding to each bit in the target sequence in turn.
[0053] It should be noted that the embodiment of the present invention does not limit the rule for splitting the initial video code stream based on the target sequence.
[0054] S130: Transmit the at least two serialized byte streams to a second electronic device according to corresponding serialization channels, and transmit the random character string to the second electronic device.
[0055] In an embodiment of the present invention, the first electronic device transmits at least two serialized byte streams to the second electronic device according to the corresponding serialization channel, and sends the random string to the second electronic device through a network link, so that the second electronic device reorganizes the at least two serialized byte streams based on the received random string to generate a target video code stream. Among them, the first electronic device can transmit the random string to the second electronic device through any one or more serialization channels. It can be understood that before the first electronic device and the second electronic device transmit the video code stream, they agree on the serialization rules for splitting the initial video code stream into at least two serialized byte streams, and ensure that the serialization rules are only known to the communicating parties. Therefore, when the first electronic device transmits the at least two serialized byte streams after the video code stream is split to the second electronic device through a network link, the serialized byte stream becomes a byte stream that cannot identify the original video code stream in the network link, thereby effectively ensuring the security of the video code stream transmission.
[0056] Optionally, when all serialized byte streams are sent to the second electronic device, the first electronic device may update the random string in real time, and synchronously update the target sequence based on the updated random string, and send the updated random string to the second electronic device.
[0057] The video code stream transmission method of the embodiment of the present invention is applied to a first electronic device, and the method includes: in response to a video code stream transmission event being triggered, generating a random string, and generating a target sequence based on the random string; splitting the initial video code stream to be transmitted in bytes based on the target sequence to generate at least two serialized byte streams; transmitting the at least two serialized byte streams to a second electronic device according to the corresponding serialization channel, and transmitting the random string to the second electronic device. The technical solution provided by the embodiment of the present invention not only effectively guarantees the security of video code stream transmission, but also effectively reduces system resource expenditure and improves data processing performance because there is no need to perform encryption operations on the video code stream.
[0058] Embodiment 2
[0059] Figure 2 This is a flowchart of a video code stream transmission method provided in the second embodiment of the present invention. This embodiment is applicable to the case of transmitting a video code stream. The method can be executed by a video code stream transmission device. The video code stream transmission device can be implemented in the form of hardware and / or software. The video code stream transmission device can be configured in the second electronic device. Figure 2 As shown, the method includes:
[0060] S210. Receive at least two serialized byte streams and a random character string sent by the first electronic device through a network link.
[0061] In an embodiment of the present invention, the first electronic device is a video code stream transmitter, and the second electronic device is a video code stream receiver. The second electronic device can be understood as a video requester, for example, a server. The second electronic device receives at least two serialized byte stream sequences and a random string sent by the first electronic device through a network link. The at least two serialized byte streams are serialized byte streams generated by the first electronic device by splitting the initial video code stream based on the target sequence generated by the random string. Exemplarily, the at least two serialized byte streams received by the second electronic device can be serialized byte streams generated by the first electronic device through S120 in Example 1, and the random string received by the second electronic device is a random string generated by the first electronic device through S110 in Example 1.
[0062] S220: Generate a target sequence based on the random character string.
[0063] In an embodiment of the present invention, the second electronic device processes the random string to generate a target sequence, for example, the user name, the user password and the random string are concatenated and then asymmetric operations are performed to generate the target sequence. Optionally, the target sequence is generated based on the random string, including: based on a preset encryption algorithm, the target sequence is generated according to the authentication information and the random string. Exemplarily, when the second electronic device sends a video request to the first electronic device, the second electronic device needs to have the authority to access the video of the first electronic device. Therefore, the second electronic device generates the target sequence based on the preset encryption algorithm, according to the authentication information and the random string obtained from the first electronic device. Among them, the authentication information may include the user name and the user password. Exemplarily, the authentication information and the random string are operated based on the MD5 algorithm to generate the target sequence, wherein the target sequence = MD5 (user name + random string + user password). For example, the target sequence can be a character sequence of a preset length composed of 0 and 1. It should be noted that the second electronic device and the first electronic device both generate the target sequence based on the same encryption algorithm according to the random string, that is, the target sequence generated by the second electronic device based on the random string is the same as the target sequence generated in S110.
[0064] S230: Recombining the at least two serialized byte streams into a target video code stream based on the target sequence.
[0065] In an embodiment of the present invention, the second electronic device reassembles at least two serialized byte streams into a target video bitstream based on the target sequence according to a preset reassembly rule, wherein the preset reassembly rule corresponds to the splitting rule of the first electronic device to split the initial video bitstream into at least two serialized byte streams.
[0066] Optionally, the reorganizing the at least two serialized byte streams into a target video code stream based on the target sequence also includes: receiving byte stream identification information and a serialized byte stream length of each of the serialized byte streams sent by the first electronic device via a network link; and reorganizing the at least two serialized byte streams into a target video code stream according to the byte stream identification information, the serialized byte stream length and the target sequence.
[0067] In an embodiment of the present invention, the second electronic device receives the byte stream identification information and the serialized byte stream length of each serialized byte stream sent by the first electronic device through the network link, wherein the byte stream identification information may be the sequence number of the serialized byte stream, and the serialized byte stream length is the number of byte data contained in the serialized byte stream. Exemplarily, the first electronic device may send at least two serialized byte streams, a random string, the byte stream identification information of each serialized byte stream, and the serialized byte stream length to the second electronic device. Among them, the first electronic device may send the serialized byte stream in the form of a data packet to the second electronic device according to the corresponding serialization channel for each serialized byte stream in the at least two serialized byte streams, wherein the data packet may contain not only the serialized byte stream, but also the random string, the byte stream identification information of the serialized byte stream, and the serialized byte stream length. Figure 3 The format diagram of the data packet provided by the embodiment of the present invention is shown in FIG. Figure 3 As shown, the data packet includes a serialized byte stream header and serialized byte stream data, wherein the serialized byte stream header includes byte stream identification information, serialized byte stream length, and a random character string.
[0068] It can be understood that the second electronic device receives the byte data of one of the at least two serialized byte streams sent by the first electronic device in the form of a data stream. Among them, the serialized byte stream length is used to determine the number of byte data contained in the serialized byte stream, the byte stream identification information is used to indicate the serialized byte stream to which each byte data belongs, and the target sequence is used to indicate the order in which the byte data is read from the at least two serialized byte streams during the serialized byte stream reorganization process. Therefore, the second electronic device reorganizes the at least two serialized byte streams into a target video code stream based on the byte stream identification information, the serialized byte stream length and the target sequence. .
[0069] Exemplarily, the first electronic device starts from the starting position of the target sequence, takes four bits from the target sequence each time, uses the values corresponding to the four bits taken as the serial number of the serialized byte stream channel, starts from the first byte data of the video code stream, distributes the byte data to the serialized byte stream channel of the corresponding sequence number, and so on, thereby generating 8 serialized byte streams. Therefore, when the second electronic device reorganizes the 8 serialized byte streams received from the first electronic device, it starts from the starting position of the target sequence, takes four bits from the target sequence each time, uses the values corresponding to the four bits taken as the serial number of the serialized byte stream channel, and then reads the first byte data from the serialized byte stream corresponding to the sequence number of the serialized byte stream channel, and so on, thereby reorganizing at least two serialized byte streams into the target video code stream. For example, if the target sequence is 001000010101011101010101..., the first byte data in the serialized byte stream corresponding to the serialized byte stream channel S2 is read as the first byte data of the target video code stream, the first byte data in the serialized byte stream corresponding to the serialized byte stream channel S1 is read as the second byte data of the target video code stream, the first byte data in the serialized byte stream corresponding to the serialized byte stream channel S5 is read as the third byte data of the target video code stream, the first byte data in the serialized byte stream corresponding to the serialized byte stream channel S7 is read as the fourth byte data of the target video code stream, the first byte data in the serialized byte stream corresponding to the serialized byte stream channel S6 is read as the fifth byte data of the target video code stream, the second byte data in the serialized byte stream corresponding to the serialized byte stream channel S6 is read as the sixth byte data of the target video code stream, and so on. After the corresponding byte data is read from the serialized byte stream corresponding to the channel number determined based on the last four bits of the target sequence, the target sequence is looped until all the byte data are read from the serialized byte streams corresponding to all the serialized byte stream channels, thereby completing the reorganization of the target video code stream.
[0070] Optionally, in the process of recombining the at least two serialized byte streams into a target video code stream according to the byte stream identification information, the serialized byte stream length and the target sequence, it also includes: when receiving the correction information sent by the first electronic device through the network link, judging whether the correction information is preset correction information, if so, jumping to the starting position of the target sequence, and returning to execute the recombining of the at least two serialized byte streams into a target video code stream according to the byte stream identification information, the serialized byte stream length and the target sequence. The advantage of such a setting is that it can effectively prevent serialized byte stream reorganization errors caused by network packet loss.
[0071] Exemplarily, in the process of sending at least two serialized byte streams and a random string to the second electronic device, the first electronic device sends correction information to the second electronic device in real time or at preset intervals, wherein the correction information may be a correction bit, which may be 0 (false) or 1 (true). Figure 3 As shown, the correction information may be included in the serialized byte stream header. When the correction information sent by the first electronic device through the network link is received, it is determined whether the correction information is the preset correction information. For example, it is determined whether the correction bit is 1. If so, it jumps to the starting position of the target sequence, and returns to execute the reorganization of at least two serialized byte streams into a target video code stream according to the byte stream identification information, the serialized byte stream length and the target sequence. Exemplarily, the target sequence is 00100001010101011101010101..., when the second electronic device reads the byte data in the serialized byte stream S5, if the correction bit is 1, it jumps to the starting position of the target sequence and reads the first unread byte data in the serialized byte stream S2.
[0072] The video code stream transmission method provided by the embodiment of the present invention is applied to a second electronic device, and the method includes: receiving at least two serialized byte streams and a random string sent by a first electronic device through a network link; generating a target sequence based on the random string; and recombining the at least two serialized byte streams into a target video code stream based on the target sequence. Through the solution provided by the embodiment of the present invention, the received serialized byte stream can be recombined into a video code stream in real time, effectively improving the real-time performance of the video code stream display.
[0073] Embodiment 3
[0074] Figure 4 The present invention provides a flowchart of a video code stream transmission method according to the third embodiment of the present invention. Figure 5 A schematic diagram of a video code stream transmission scenario provided by an embodiment of the present invention. Figure 4 As shown, the method includes:
[0075] S410: In response to a video code stream transmission event being triggered, the first electronic device obtains authentication information and generates a random character string.
[0076] S420: The first electronic device generates a target sequence based on a preset encryption algorithm, authentication information and a random character string.
[0077] S430. The first electronic device determines the total number N of serialized byte stream channels, and distributes the video code stream to be transmitted to the N serialized byte stream channels in units of bytes according to the preset splitting rules, the total number of serialized byte stream channels and the target sequence, to generate N serialized byte streams.
[0078] S440: The first electronic device transmits N serialized byte streams, the random character string, the byte stream identification information of each serialized byte stream, and the serialized byte stream length to the second electronic device according to the corresponding serialization channel.
[0079] S450: The second electronic device generates a target sequence based on a preset encryption algorithm, according to the authentication information and the received random character string.
[0080] S460: The second electronic device reassembles the N serialized byte streams into a target video code stream according to the byte stream identification information, the serialized byte stream length and the target sequence.
[0081] The video code stream transmission method of the embodiment of the present invention not only effectively ensures the security of video code stream transmission, but also effectively reduces system resource expenditure and improves data processing performance because there is no need to perform encryption and decryption operations on the video code stream. In addition, the receiving end can instantly reorganize the received serialized byte stream into a video code stream, effectively improving the real-time performance of the video code stream display.
[0082] Embodiment 4
[0083] Figure 6 A schematic diagram of the structure of a video code stream transmission device provided in Embodiment 4 of the present invention.
[0084] like Figure 6 As shown, the device is applied to a first electronic device, including:
[0085] A first target sequence generating module 610, configured to generate a random string in response to a video code stream transmission event being triggered, and to generate a target sequence based on the random string;
[0086] A serialized byte stream generating module 620 is used to split the initial video code stream to be transmitted in bytes based on the target sequence to generate at least two serialized byte streams;
[0087] The serialized byte stream transmission module 630 is used to transmit the at least two serialized byte streams to the second electronic device according to the corresponding serialization channels, and transmit the random character string to the second electronic device.
[0088] Optionally, the serialized byte stream generation module is used to:
[0089] Determine the total number N of serialized byte stream channels; where N is an integer greater than or equal to 2;
[0090] According to the preset splitting rule, based on the total number of serialized byte stream channels and the target sequence, the video code stream to be transmitted is distributed to N serialized byte stream channels in bytes to generate N serialized byte streams.
[0091] Optionally, the first target sequence generating module is used to:
[0092] In response to a video code stream transmission event being triggered, obtaining authentication information and generating a random string;
[0093] Based on a preset encryption algorithm, a target sequence is generated according to the authentication information and the random character string.
[0094] The video code stream transmission device provided in the embodiment of the present invention can execute the video code stream transmission method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0095] Embodiment 5
[0096] Figure 7 A schematic diagram of the structure of a video code stream transmission device provided in Embodiment 5 of the present invention.
[0097] like Figure 7 As shown, the device is applied to a second electronic device, comprising:
[0098] The serialized byte stream receiving module 710 is used to receive at least two serialized byte streams and a random character string sent by the first electronic device through a network link;
[0099] A second target sequence generating module 720, configured to generate a target sequence based on the random string;
[0100] The serialized byte stream reassembly module 730 is configured to reassemble the at least two serialized byte streams into a target video code stream based on the target sequence.
[0101] Optionally, the serialized byte stream reassembly module includes:
[0102] A byte stream identification information receiving unit, used to receive the byte stream identification information and the serialized byte stream length of each serialized byte stream sent by the first electronic device through the network link;
[0103] The serialized byte stream reassembly unit is used to reassemble the at least two serialized byte streams into a target video code stream according to the byte stream identification information, the serialized byte stream length and the target sequence.
[0104] Optionally, also include:
[0105] A starting position jump module is used to determine whether the correction information is preset correction information when receiving correction information sent by the first electronic device through a network link during the process of reorganizing the at least two serialized byte streams into a target video code stream according to the byte stream identification information, the serialized byte stream length and the target sequence. If so, jump to the starting position of the target sequence and return to execute the reorganization of the at least two serialized byte streams into a target video code stream according to the byte stream identification information, the serialized byte stream length and the target sequence.
[0106] The video code stream transmission device provided in the embodiment of the present invention can execute the video code stream transmission method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0107] Embodiment 6
[0108] Figure 8 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0109] like Figure 8 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0110] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0111] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as a video stream transmission method.
[0112] In some embodiments, the video code stream transmission method can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the video code stream transmission method described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to perform the video code stream transmission method in any other appropriate manner (for example, by means of firmware).
[0113] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0114] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0115] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0116] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0117] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0118] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0119] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0120] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A video code stream transmission method, characterized in that: Applied to a first electronic device, the method includes: In response to a video code stream transmission event being triggered, generating a random string, and generating a target sequence based on the random string; Based on the target sequence, the initial video code stream to be transmitted is split into bytes to generate at least two serialized byte streams; The at least two serialized byte streams are transmitted to a second electronic device according to corresponding serialized channels, and the random character string is transmitted to the second electronic device.
2. The method according to claim 1, characterized in that The step of splitting the video code stream to be transmitted in bytes based on the target sequence to generate at least two serialized byte streams includes: Determine the total number N of serialized byte stream channels; where N is an integer greater than or equal to 2; According to the preset splitting rule, based on the total number of serialized byte stream channels and the target sequence, the video code stream to be transmitted is distributed to N serialized byte stream channels in bytes to generate N serialized byte streams.
3. The method according to claim 1, characterized in that In response to a video code stream transmission event being triggered, a random string is generated, and a target sequence is generated based on the random string, including: In response to a video code stream transmission event being triggered, obtaining authentication information and generating a random string; Based on a preset encryption algorithm, a target sequence is generated according to the authentication information and the random character string.
4. A video code stream transmission method, characterized in that: Applied to a second electronic device, the method includes: Receiving at least two serialized byte streams and a random character string sent by a first electronic device through a network link; generating a target sequence based on the random string; The at least two serialized byte streams are reassembled into a target video code stream based on the target sequence.
5. The method according to claim 4, characterized in that The step of recombining the at least two serialized byte streams into a target video bitstream based on the target sequence further includes: Receiving byte stream identification information and serialized byte stream length of each serialized byte stream sent by the first electronic device through a network link; The at least two serialized byte streams are reassembled into a target video code stream according to the byte stream identification information, the serialized byte stream length and the target sequence.
6. The method according to claim 5, characterized in that In the process of recombining the at least two serialized byte streams into a target video code stream according to the byte stream identification information, the serialized byte stream length and the target sequence, the process further includes: When correction information sent by the first electronic device through the network link is received, it is determined whether the correction information is preset correction information. If so, jump to the starting position of the target sequence, and return to execute the at least two serialized byte streams according to the byte stream identification information, the serialized byte stream length and the target sequence to reorganize into a target video code stream.
7. A video code stream transmission device, characterized in that: Applied to a first electronic device, the device comprises: A first target sequence generation module, configured to generate a random string in response to a video code stream transmission event being triggered, and generate a target sequence based on the random string; A serialized byte stream generation module, used for splitting the initial video code stream to be transmitted in bytes based on the target sequence to generate at least two serialized byte streams; The serialized byte stream transmission module is used to transmit the at least two serialized byte streams to the second electronic device according to the corresponding serialization channels, and transmit the random character string to the second electronic device.
8. A video code stream transmission device, characterized in that: Applied to a second electronic device, the device comprises: A serialized byte stream receiving module, used to receive at least two serialized byte streams and a random character string sent by the first electronic device through a network link; A second target sequence generation module, used to generate a target sequence based on the random string; The serialized byte stream reassembly module is used to reassemble the at least two serialized byte streams into a target video code stream based on the target sequence.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the video stream transmission method described in any one of claims 1-3 or 4-6.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the video stream transmission method described in any one of claims 1-3 or 4-6 when executed.