Data stream switching method and device, computer equipment and storage medium
By detecting the streaming characteristic code of the target data stream before the data stream switching, ensuring the successful data stream switching, solving the adverse consequences caused by the failure of data stream switching, and achieving efficient data stream transmission.
Patent Information
- Application Number
- CN202510557011.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-29
- Publication Date
- 2025-07-11
AI Technical Summary
In multimedia data transmission scenarios, the failure of data flow switching causes the broadcasting center to be unable to obtain the complete program material, and the online live broadcast platform has problems such as lag or black screen.
By receiving switching instructions, the target data stream and its stream type characteristic code are determined, the target end needs are detected, whether it can be switched, and the data stream switching is performed when it can be switched, to avoid failure.
This increases the probability of successful data flow switching and avoids adverse consequences caused by failure of switching, such as interruption of broadcast center material and lag on the online live broadcast platform.
Smart Images

Figure CN120302079A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of network control technology, and specifically, to a data flow switching method, apparatus, computer device, and storage medium. Background Art
[0002] In the scenario of multimedia data transmission, as a key data source end, the studio undertakes the tasks of collecting and outputting a large amount of audio and video data. These rich data need to be accurately and efficiently transmitted to destination ends such as relay centers and online live broadcast platforms to meet diverse requirements such as real-time playback and post-production.
[0003] During the data transmission process, the switching of data flows plays a crucial connecting role. Currently, the adopted data flow switching method is as follows: When the network controller receives an instruction regarding the source end switching, it calculates the optimal routing path using a specific algorithm based on the source end and destination end information involved in the instruction. Subsequently, the network controller sends the calculated routing path information to the forwarding switching matrix through a specific communication interface. The forwarding switching matrix then performs data forwarding operations based on the received routing path, thereby completing the transmission process of the data flow from the source end to the destination end.
[0004] However, due to the complex types of data flows output by the studio and the limited types of data flows that the destination end can receive, once a failure occurs during the switching process, the data flow output from the source end to the destination end will be interrupted or disordered. This will directly result in the relay center being unable to obtain complete and correct program materials, and the online live broadcast platform experiencing problems such as freezing and black screens, thus causing serious adverse consequences. Therefore, there is an urgent need for a data flow switching method. Summary of the Invention
[0005] In an embodiment of this application, a data flow switching method, apparatus, computer device, and storage medium are provided. This method can improve the probability of successful data flow switching and avoid the adverse consequences caused by failed data flow switching.
[0006] In the first aspect of the embodiments of this application, a data flow switching method is provided, and the method includes:
[0007] Receiving a switching instruction for instructing to switch the current data flow to a target data flow;
[0008] Determining the target data flow to be switched according to the switching instruction, where the target data flow includes at least one data sub-flow and a target identifier for indicating the destination end;
[0009] Determining a first flow type feature code corresponding to each data sub-flow in the target data flow;
[0010] Determine the second flow pattern signature corresponding to the data stream required by the destination end according to the target identifier;
[0011] Determine whether the current data stream can be switched to the target data stream according to the first flow pattern signature and the second flow pattern signature;
[0012] When the current data stream can be switched to the target data stream, switch the current data stream to the target data stream.
[0013] Optionally, the determining the first flow pattern signature corresponding to each data sub-stream in the target data stream includes:
[0014] Divide the target data stream to determine the data sub-streams included in the target data stream, and obtain the data sub-streams sent by the source end;
[0015] Extract features from the data sub-streams sent by the source end to obtain target features;
[0016] Determine the first flow pattern signature of the data sub-streams sent by the source end according to the target features and the pre-created correspondence between features and flow pattern signatures.
[0017] Optionally, the determining the second flow pattern signature corresponding to the data stream required by the destination end according to the target identifier includes:
[0018] Obtain the pre-created correspondence between identifiers and flow pattern signatures;
[0019] Determine the second flow pattern signature corresponding to the data stream required by the destination end according to the target identifier and the correspondence.
[0020] Optionally, the determining whether the current data stream can be switched to the target data stream according to the first flow pattern signature and the second flow pattern signature includes:
[0021] In the second flow pattern signature, detect whether there is a third flow pattern signature identical to the first flow pattern signature;
[0022] When there is the third flow pattern signature, determine that the current data stream can be switched to the target data stream;
[0023] When there is no such third flow pattern signature, determine that the current data stream cannot be switched to the target data stream.
[0024] Optionally, the switching the current data stream to the target data stream includes:
[0025] In the target data stream, determine the target data sub-stream corresponding to the third flow pattern signature;
[0026] Switch the current data stream to the target data sub - stream.
[0027] Optionally, the stream type signature indicates the position of the encoding type of the corresponding data stream in the initial signature sequence. Detecting whether there is a third stream type signature identical to the first stream type signature in the second stream type signature includes:
[0028] Set the initial signature sequence according to the first stream type signature to obtain a first signature sequence;
[0029] Set the initial signature sequence according to the second stream type signature to obtain a second signature sequence;
[0030] Compare the first signature sequence and the second signature sequence to determine whether there is a target data bit that meets the conditions;
[0031] Determine whether there is a third stream type signature identical to the first stream type signature according to whether there is a target data bit that meets the conditions.
[0032] Optionally, the method further includes:
[0033] Determine the maximum pipe diameter of the pipeline where the target data sub - stream is located according to the encoding type of the target data sub - stream;
[0034] Obtain the current flow rate of the target data sub - stream;
[0035] When the current flow rate is greater than the maximum pipe diameter, discard the excess part of the target data sub - stream.
[0036] Optionally, the method further includes:
[0037] Establish cross - point information according to the source - end identifier and destination - end identifier in the target data stream;
[0038] Verify the cross - point information according to a preset rule to obtain a verification result;
[0039] Determine whether the current data stream can be switched to the target data stream according to the verification result.
[0040] In the second aspect of the embodiments of the present application, an apparatus for switching a data stream is provided, including:
[0041] A receiving unit, configured to receive a switching instruction for instructing to switch a current data stream to a target data stream;
[0042] A first determination unit, configured to determine a target data stream to be switched according to the switching instruction, where the target data stream includes at least one data sub-stream and a target identifier for indicating a destination end;
[0043] A second determination unit, configured to determine a first flow type feature code corresponding to each data sub-stream in the target data stream;
[0044] A third determination unit, configured to determine a second flow type feature code corresponding to the data stream required by the destination end according to the target identifier;
[0045] A fourth determination unit, configured to determine whether the current data stream can be switched to the target data stream according to the first flow type feature code and the second flow type feature code;
[0046] A switching unit, configured to switch the current data stream to the target data stream when the current data stream can be switched to the target data stream.
[0047] Optionally, the second determination unit is configured to:
[0048] Divide the target data stream to determine the data sub-streams included in the target data stream, so as to obtain the data sub-streams sent by the source end;
[0049] Extract features from the data sub-streams sent by the source end to obtain target features;
[0050] Determine the first flow type feature code of the data sub-streams sent by the source end according to the target features and the pre-created correspondence between features and flow type feature codes.
[0051] Optionally, the third determination unit is configured to:
[0052] Obtain the pre-created correspondence between identifiers and flow type feature codes;
[0053] Determine the second flow type feature code corresponding to the data stream required by the destination end according to the target identifier and the correspondence.
[0054] Optionally, the fourth determination unit is configured to:
[0055] Detect whether there is a third flow type feature code identical to the first flow type feature code in the second flow type feature code;
[0056] When there is the third flow type feature code, determine that the current data stream can be switched to the target data stream;
[0057] When there is no third flow type feature code, determine that the current data stream cannot be switched to the target data stream.
[0058] Optionally, the switching unit is configured to:
[0059] In the target data stream, determine a target data sub-stream corresponding to the third stream type signature;
[0060] Switch the current data stream to the target data sub-stream.
[0061] Optionally, the stream type signature indicates the position of the encoding type of the corresponding data stream in the initial feature sequence. The fourth determining unit is configured to:
[0062] Set the initial feature sequence according to the first stream type signature to obtain a first feature sequence;
[0063] Set the initial feature sequence according to the second stream type signature to obtain a second feature sequence;
[0064] Compare the first feature sequence and the second feature sequence to determine whether there is a target data bit that meets the conditions;
[0065] Determine whether there is a third stream type signature that is the same as the first stream type signature according to whether there is a target data bit that meets the conditions.
[0066] Optionally, the apparatus further includes a detection unit, and the detection unit is configured to:
[0067] Determine the maximum pipe diameter of the pipe where the target data sub-stream is located according to the encoding type of the target data sub-stream;
[0068] Obtain the current flow rate of the target data sub-stream;
[0069] When the current flow rate is greater than the maximum pipe diameter, discard the excess part of the target data sub-stream.
[0070] Optionally, the apparatus further includes a verification unit, and the verification unit is configured to:
[0071] Establish cross-point information according to the source end identifier and the destination end identifier in the target data stream;
[0072] Verify the cross-point information according to a preset rule to obtain a verification result;
[0073] Determine whether the current data stream can be switched to the target data stream according to the verification result.
[0074] In a third aspect of the embodiments of the present application, a computer device is provided, including: a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the steps of any one of the above methods are implemented.
[0075] In a fourth aspect of the embodiments of the present application, a computer-readable storage medium is provided, on which a computer program is stored, and the computer program, when executed by a processor, implements the steps of the method according to any one of the above.
[0076] In the embodiments of the present application, a switching instruction for instructing to switch the current data stream to a target data stream is received; according to the switching instruction, the target data stream to be switched is determined, and the target data stream includes at least one data sub-stream and a target identifier for indicating a destination; the first stream type feature code corresponding to each data sub-stream in the target data stream is determined; according to the target identifier, the second stream type feature code corresponding to the data stream required by the destination is determined; according to the first stream type feature code and the second stream type feature code, it is determined whether the current data stream can be switched to the target data stream; in the case where the current data stream can be switched to the target data stream, the current data stream is switched to the target data stream. It can be seen that before switching the data stream, the present application first detects whether the data stream switching operation can be performed, improves the probability of successful data stream switching, and avoids the adverse consequences caused by failed data stream switching. Description of the Drawings
[0077] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments and descriptions thereof of the present application are used to explain the present application and do not constitute an improper limitation of the present application. In the drawings:
[0078] Figure 1 It is a schematic structural diagram of a data stream switching method provided by an embodiment of the present application;
[0079] Figure 2 It is a flowchart of a data stream switching method provided by an embodiment of the present application;
[0080] Figure 3 It is a flowchart of a first stream type feature code determination method provided by an embodiment of the present application;
[0081] Figure 4 It is a flowchart of a second stream type feature code determination method provided by an embodiment of the present application;
[0082] Figure 5 It is a flowchart of a data detection method provided by an embodiment of the present application;
[0083] Figure 6 It is a flowchart of a data stream switching method provided by an embodiment of the present application;
[0084] Figure 7 It is a schematic diagram of a full feature-level logic box provided by an embodiment of the present application;
[0085] Figure 8 Flowchart of the third flow pattern signature determination method provided by an embodiment of the present application;
[0086] Figure 9 Flowchart of the data stream control method provided by an embodiment of the present application;
[0087] Figure 10 Flowchart of the data verification method provided by an embodiment of the present application;
[0088] Figure 11 Schematic diagram of the intersection information provided by an embodiment of the present application;
[0089] Figure 12 Schematic diagram of the structure of the data stream switching device provided by an embodiment of the present application;
[0090] Figure 13 Schematic diagram of the structure of a computer device provided by an embodiment of the present application. Detailed implementation manners
[0091] In the multimedia data transmission scenario, as the key data source end, the studio undertakes the tasks of collecting and outputting a large amount of audio and video data. These rich data need to be accurately and efficiently transmitted to destination ends such as relay centers and online live broadcast platforms to meet diverse requirements such as real-time playback and post-production. During the data transmission process, the switching of the data stream plays a crucial connecting role. Currently, the adopted data stream switching method is as follows: when the network controller receives an instruction regarding the source end switching, it will calculate the optimal routing path using a specific algorithm based on the source end and destination end information involved in the instruction. Subsequently, the network controller sends the calculated routing path information to the forwarding switching matrix through a specific communication interface. The forwarding switching matrix then performs the data forwarding operation according to the received routing path, thereby completing the transmission process of the data stream from the source end to the destination end. However, due to the complex types of data streams output by the studio and the limited types of data streams that the destination end can receive, once a failure occurs during the switching process, the data stream output from the source end to the destination end will be interrupted or disordered. This will directly cause the relay center to be unable to obtain complete and correct program materials, and the online live broadcast platform to experience problems such as freezing and black screens, thus resulting in serious adverse consequences.
[0092] In view of the above problems, an embodiment of the present application provides a data stream switching method, which receives a switching instruction for instructing to switch the current data stream to a target data stream; determines the target data stream to be switched according to the switching instruction, where the target data stream includes at least one data sub-stream and a target identifier for indicating a destination; determines a first stream type feature code corresponding to each data sub-stream in the target data stream; determines a second stream type feature code corresponding to the data stream required by the destination according to the target identifier; determines whether the current data stream can be switched to the target data stream according to the first stream type feature code and the second stream type feature code; and switches the current data stream to the target data stream when the current data stream can be switched to the target data stream. It can be seen that before switching the data stream, the present application first detects whether the data stream switching operation can be performed, improves the probability of successful data stream switching, and avoids the adverse consequences caused by failed data stream switching.
[0093] The solutions in the embodiments of the present application can be implemented in various computer languages. For example, object-oriented programming languages such as Java and interpreted scripting languages such as JavaScript.
[0094] In order to make the technical solutions and advantages in the embodiments of the present application clearer and more understandable, the following further details the exemplary embodiments of the present application with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than an exhaustive list of all embodiments. It should be noted that, without conflict, the embodiments in the present application and the features in the embodiments can be combined with each other.
[0095] The following briefly describes the structural schematic diagram of the data stream switching method provided by the embodiments of the present application:
[0096] As Figure 1As described above, the schematic structural diagram at least includes a source end, a destination end, a network controller, and a forwarding switching matrix. The network controller can receive a switching instruction for instructing to switch the current data stream to a target data stream. This instruction can be generated by manual operation of a program producer at a production console, an automated system triggered based on preset program flow time nodes, an error correction mechanism generated according to abnormal feedback from a real-time studio device status monitoring system, etc. When the network controller receives this instruction, the network controller can determine the target data stream to be switched according to the switching instruction, and then verify whether the current data stream can be switched to the target data stream through this target data stream. When the current data stream can be switched to the target data stream, the optimal routing path can be calculated using a specific algorithm based on the source end and destination end information involved in the instruction. Subsequently, the network controller sends the calculated routing path information to the forwarding switching matrix through a specific communication interface. The forwarding switching matrix then performs a data forwarding operation based on the received routing path, thereby completing the transmission process of the data stream from the source end to the destination end. When the current data stream cannot be switched to the target data stream, an alarm message is generated and sent to relevant personnel to notify that the current data stream cannot be switched to the target data stream.
[0097] Furthermore, in order to save data processing time, when the network controller verifies whether the current data stream can be switched to the target data stream, the network controller can also calculate the optimal routing path based on the source end and destination end information involved in the instruction and send it to the forwarding switching matrix. When the network controller notifies the forwarding switching matrix that the current data stream can be switched to the target data stream, the forwarding switching matrix performs a data forwarding operation based on the received routing path, thereby completing the transmission process of the data stream from the source end to the destination end.
[0098] Please refer to Figure 2 , in the following embodiments, the above network controller is used as the execution subject, and the method provided in the embodiments of the present application is applied to the above network controller. The network controller can detect whether the current data stream can be switched to the target data stream and perform a switching operation when the current data stream can be switched to the target data stream. The carriage event detection method provided in the embodiments of the present application includes the following steps 201-step 204:
[0099] Step 201, receive a switching instruction for instructing to switch the current data stream to a target data stream.
[0100] In this step, the network controller can receive a data stream switching instruction, which is used to instruct to switch the current data stream to a target data stream. Among them, this instruction can be manually triggered by a program producer at a production console or triggered based on preset program flow time nodes, and is not limited here.
[0101] Step 202: Determine the target data stream to be switched according to the switching instruction.
[0102] The target data stream includes at least one data sub-stream and a target identifier for indicating the destination end.
[0103] In this step, the switching instruction carries the source end identifier, and the network controller can find the data stream sent by the source end according to the source end identifier, and this data stream is the target data stream to be switched.
[0104] The network controller is used to manage the data streams in the network, so that the network controller can find the data stream corresponding to the source end identifier according to the source end identifier.
[0105] Step 203: Determine the first stream type feature code corresponding to each data sub-stream in the target data stream.
[0106] The stream type feature code is used to indicate the encoding type of the corresponding data stream, and is set by technical personnel for each data stream of each encoding type. For example, the stream type feature code corresponding to a 4K video stream is 1, the stream type feature code corresponding to a 3G video stream is 2, the stream type feature code corresponding to an HD video stream is 3, and the stream type feature code corresponding to an 8ch audio stream is 4.
[0107] In this step, there are two ways to determine the first stream type feature code corresponding to each data sub-stream. One is that each data sub-stream carries the stream type feature code, so that the first stream type feature code can be directly obtained in each data sub-stream. The other is to extract the features of the data sub-stream to obtain the target features, and determine the first stream type feature code according to the corresponding relationship between the target features and the pre-established features and stream type feature codes.
[0108] Step 204: Determine the second stream type feature code corresponding to the data stream required by the destination end according to the target identifier.
[0109] The target identifier is used to uniquely indicate the destination end, which can be the IP address corresponding to the destination end or other data, and is not limited here.
[0110] In this step, the network controller can pre-store the corresponding relationship between the identifier and the stream type feature code. When this step needs to be executed, obtain this corresponding relationship, compare the target identifier with the identifiers in this corresponding relationship, and determine the stream type feature code corresponding to the compared identifier as the second stream type feature code.
[0111] Step 205: Determine whether the current data stream can be switched to the target data stream according to the first stream type feature code and the second stream type feature code.
[0112] In this step, in the second flow pattern signature, check if there is a third flow pattern signature that is the same as that in the first flow pattern signature. If it exists, it indicates that the data stream required by the target end is the same as the data stream sent by the source end. Therefore, the current data stream can be successfully switched to the target data stream. If it does not exist, it means that the data stream required by the target end is different from the data stream sent by the source end. So, the current data stream cannot be switched to the target data stream. If the current data stream is switched to the target data stream, it will cause the data stream switching to fail and result in some adverse consequences.
[0113] For example, the data streams required by the destination end are data sub-stream a and data sub-stream b, and the data streams sent by the source end are data sub-stream c and data sub-stream b. If data sub-stream a and data sub-stream c are the same, the current data stream can be switched to the target data stream. If the data streams required by the destination end and the data streams sent by the source end are all different, the current data stream cannot be switched to the target data stream.
[0114] Step 206: When it is possible to switch the current data stream to the target data stream, switch the current data stream to the target data stream.
[0115] In this step, when it is possible to switch the current data stream to the target data stream, the optimal routing path can be calculated according to the source end identifier and the destination end identifier involved in the instruction by using a specific algorithm. Subsequently, the network controller sends the calculated routing path information to the forwarding switching matrix through a specific communication interface. The forwarding switching matrix then performs data forwarding operations according to the received routing path, thus completing the transmission process of the data stream from the source end to the destination end.
[0116] In the embodiment of the present application, a switching instruction for instructing to switch the current data stream to the target data stream is received; according to the switching instruction, the target data stream to be switched is determined, and the target data stream includes at least one data sub-stream and a target identifier for indicating the destination end; the first flow pattern signature corresponding to each data sub-stream in the target data stream is determined; according to the target identifier, the second flow pattern signature corresponding to the data stream required by the destination end is determined; according to the first flow pattern signature and the second flow pattern signature, it is determined whether the current data stream can be switched to the target data stream; when it is possible to switch the current data stream to the target data stream, the current data stream is switched to the target data stream. It can be seen that before switching the data stream, the present application first detects whether the data stream switching operation can be performed, which improves the probability of successful data stream switching and avoids the adverse consequences caused by failed data stream switching.
[0117] In an embodiment of the present application, after obtaining the target data stream, the network controller may partition the target data stream to determine the data sub-streams included in the target data stream, and then extract features from each data sub-stream to obtain the features corresponding to each data sub-stream. Finally, according to the features corresponding to each data sub-stream, the first stream type feature code corresponding to each data sub-stream is determined. Therefore, the embodiment of the present application provides a method for determining the first stream type feature code, as Figure 3 shown, and the specific steps include:
[0118] Step 301: Partition the target data stream to determine the data sub-streams included in the target data stream, and obtain the data sub-streams sent by the source end.
[0119] In this step, the target data stream includes data sub-streams of multiple coding types. Therefore, the target data stream can be identified and partitioned into data sub-streams of multiple coding types, and these data sub-streams are the data sub-streams sent by the source end.
[0120] For example, the target data stream comes from the live transmission of a large-scale online concert, which includes a data sub-stream a of the singer's singing audio presented in the AAC coding type, a data sub-stream b of the live audience interaction audio transmitted in the Opus coding type, a data sub-stream c of the stage panoramic video output in the H.264 coding type, and a data sub-stream d of the close-up video provided in the H.265 coding type. Therefore, the target data stream can be partitioned to obtain data sub-stream a, data sub-stream b, data sub-stream c, and data sub-stream d, and these data sub-streams are the data sub-streams sent by the source end.
[0121] Step 302: Extract features from the data sub-streams sent by the source end to obtain target features.
[0122] Among them, the features corresponding to data streams of different coding types are different, and there is a one-to-one relationship between the coding type and the features. The above features include information such as coding type, file extension, header information, byte order mark, specific coding identification characters or sequences, etc.
[0123] In this step, technicians can preset feature extraction rules and set them in the network controller. Then, the network controller uses the feature extraction rules to extract features from the data sub-streams sent by the source end to obtain target features.
[0124] Furthermore, other methods can also be used in this step for feature extraction. For example, a pre-trained feature extraction model can be used.
[0125] Step 303: Determine the first stream type feature code of the data sub-streams sent by the source end according to the target features and the pre-created correspondence between features and stream type feature codes.
[0126] In this step, the technician pre - establishes the correspondence between the pre - created features and the flow pattern feature codes and stores them in the network controller. When step 303 needs to be executed, the network controller obtains the pre - stored correspondence between the features and the flow pattern feature codes, compares the target feature with the corresponding features, and determines the flow pattern feature code corresponding to the compared feature as the first flow pattern feature code.
[0127] In the embodiments of the present application, the network controller can, according to the identifier of the destination end, find the flow pattern feature code corresponding to the destination end and use it as the second flow pattern feature code. Therefore, the embodiments of the present application provide a method for determining the second flow pattern code. The method is as Figure 4 shown, and the specific steps include:
[0128] Step 401, obtain the correspondence between the pre - created identifier and the flow pattern feature code.
[0129] In this step, the technician pre - creates the correspondence between the identifier and the flow pattern feature code and stores it in the network controller or other storage devices. When this step needs to be executed, the network controller can obtain the pre - created correspondence between the identifier and the flow pattern feature code in its own storage space or other storage devices.
[0130] Step 402, determine the second flow pattern feature code corresponding to the data stream required by the destination end according to the target identifier and the correspondence.
[0131] In this step, the network controller can compare the target identifier with the identifiers in the correspondence, obtain the flow pattern feature code corresponding to the compared identifier, and determine it as the second flow pattern feature code corresponding to the data stream required by the destination end.
[0132] In the embodiments of the present application, since there is partial or complete overlap between the data stream required by the destination end and the data stream sent by the source end, the switching can be based on these overlapping data streams. That is, if the first flow pattern feature code and the second flow pattern feature code are completely different, it means that the current data stream cannot be switched to the target data stream. If the first flow pattern feature code and the second flow pattern feature code are partially the same or completely the same, it means that the current data stream can be switched to the target data stream. Therefore, the embodiments of the present application provide a data detection method. As Figure 5 shown, the specific steps include:
[0133] Step 501, in the second flow pattern feature code, detect whether there is a third flow pattern feature code that is the same as the first flow pattern feature code.
[0134] In this step, compare the second flow pattern signature with the first flow pattern signature. If there is a matching first flow pattern signature, determine it as the third flow pattern signature. If there is no matching first flow pattern signature, determine that there is no third flow pattern signature identical to the first flow pattern signature.
[0135] Step 502, when there is a third flow pattern signature, determine that the current data stream can be switched to the target data stream.
[0136] In this step, when there is a third flow pattern signature, it indicates that there is partial or complete overlap between the data stream required by the destination end and the data stream sent by the source end. Determine that the current data stream can be switched to the target data stream. Specifically, when the third flow pattern signature is exactly the same as the first flow pattern signature, that is, the first flow pattern signature and the second flow pattern signature are exactly the same, it indicates that the data stream required by the destination end and the data stream sent by the source end completely overlap. When the third flow pattern signature is not exactly the same as the first flow pattern signature, that is, the first flow pattern signature and the second flow pattern signature are not exactly the same, it indicates that the data stream required by the destination end and the data stream sent by the source end partially overlap.
[0137] Step 503, when there is no third flow pattern signature, determine that the current data stream cannot be switched to the target data stream.
[0138] In this step, when there is no third flow pattern signature, it indicates that the data stream required by the destination end and the data stream sent by the source end are completely different. Determine that the current data stream cannot be switched to the target data stream.
[0139] In the embodiments of the present application, after determining the third flow pattern signature, it shows the situation where the current data stream can be switched to the target data stream. However, this only indicates that the switching operation can be performed, but these switching operations may only be for some data streams or may be for all data streams. Therefore, it is necessary to determine the target data stream corresponding to the third flow pattern signature, and then perform the switching according to the target data stream. Therefore, the embodiments of the present application provide a data stream switching method, and this method is as Figure 6 shown, and the specific steps include:
[0140] Step 601, in the target data stream, determine the target data sub-stream corresponding to the third flow pattern signature.
[0141] In this step, the network controller obtains the pre-created correspondence between the flow pattern signature and the data stream, and then determines the corresponding target data sub-stream in the target data stream according to the third flow pattern signature.
[0142] Step 602, switch the current data stream to the target data sub-stream.
[0143] In this step, the network controller may send the relevant data of the target data sub - flow to the forwarding switching matrix so that the forwarding switching matrix can perform switching based on the target data sub - flow.
[0144] In the embodiments of the present application, technicians pre - establish a full - feature - level logic box, as shown in Figure 7 This logic box includes multiple box layers. Each box layer includes an initial feature sequence corresponding to the source end and an initial feature sequence corresponding to the destination end, and each box layer corresponds to a switching instruction. The flow - type feature code indicates the position of the coding type of the corresponding data stream in the initial feature sequence. Therefore, after determining the first flow - type feature code and the second flow - type feature code corresponding to a certain switching instruction, they can be filled into the initial feature sequence corresponding to the source end and the initial feature sequence corresponding to the destination end respectively to obtain the corresponding sequences, and then the third flow - type feature code can be determined according to these sequences. Therefore, the embodiments of the present application provide a method for determining the third flow - type feature code. The method is as described in Figure 8 The specific steps are as follows:
[0145] Step 801: Set the initial feature sequence according to the first feature sequence to obtain the first feature sequence.
[0146] In this step, the network controller finds the position of the first flow - type feature code in the initial feature sequence and sets the corresponding data to a preset value to obtain the first feature sequence.
[0147] For example, the initial feature sequence is 000000. When the first flow - type feature codes are 1 and 4, the first feature sequence is 010010.
[0148] Step 802: Set the initial feature sequence according to the second flow - type feature code to obtain the second feature sequence.
[0149] In this step, the network controller finds the position of the second flow - type feature code in the initial feature sequence and sets the corresponding data to a preset value to obtain the second feature sequence.
[0150] For example, the initial feature sequence is 000000. When the second flow - type feature codes are 2 and 4, the second feature sequence is 001010.
[0151] Step 803: Compare the first feature sequence and the second feature sequence to determine whether there is a target data bit that meets the conditions.
[0152] In this step, the first feature sequence and the second feature sequence are compared to determine the data bits that both correspond to the preset values, and these are determined as the target data bits that meet the conditions. For example, when the first feature sequence is 010010 and the second feature sequence is 001010, the target data bit that meets the conditions is the fifth data bit.
[0153] Step 804, according to whether there are target data bits that meet the conditions, determine whether there is a third flow pattern feature code that is the same as the first flow pattern feature code.
[0154] In this step, when there are target data bits that meet the conditions, according to the position of the target data bit in the initial feature sequence, determine the third flow pattern feature code. For example, if the target data bit that meets the conditions is the fifth data bit, the third flow pattern feature code is 4. When there are no target data bits that meet the conditions, it is determined that there is no third flow pattern feature code that is the same as the first flow pattern feature code.
[0155] In the embodiments of the present application, in order to achieve refined management of the data stream, the flow rate of the data stream can also be monitored in real time. When the flow rate of the data stream is too large, it is determined that the data stream is an abnormal data stream and needs to be controlled. For example, the data stream is discarded. Therefore, the embodiments of the present application provide a data stream control method, as Figure 9 shown, and the specific steps include:
[0156] Step 901, according to the coding type of the target data sub-stream, determine the maximum pipe diameter of the pipe where the target data sub-stream is located.
[0157] In practice, the data stream is transmitted through a pipe, and different coding types of data streams require different maximum pipe diameters. Therefore, technicians can set different maximum pipe diameters for pipes of different coding types according to experience, establish the corresponding relationship between the coding type and the maximum pipe diameter, and store it in the network controller. When this step needs to be executed, obtain the corresponding relationship between the coding type and the maximum pipe diameter, and then compare the coding type of the target data sub-stream with the coding type in the corresponding relationship, and determine the maximum pipe diameter corresponding to the compared coding type as the maximum pipe diameter of the pipe where the target data sub-stream is located.
[0158] Step 902, obtain the current flow rate of the target data sub-stream.
[0159] In this step, the network controller can periodically obtain the bandwidth of the target data sub-stream and calculate the current flow rate of the target data sub-stream according to the bandwidth and time interval of adjacent times. Of course, other methods can also be used to obtain the flow rate of the data stream, and it is not limited here.
[0160] Step 903, when the current flow rate is greater than the maximum pipe diameter, discard the excess part.
[0161] In this step, since the target data sub-stream may include data sent by multiple audio and video terminals, the target data sub-stream can be analyzed, and the traffic exceeding the pipe diameter size can be discarded to prevent other data streams from being affected due to traffic overload.
[0162] In the embodiment of the present application, the above method effectively blocks abnormal traffic and can perform real-time traffic monitoring on the current data stream, significantly enhancing the anti-interference ability, traceability ability, and stability of the entire system in high-load scenarios.
[0163] In the embodiment of the present application, the network controller can also verify the source end identifier and the destination end identifier in the target data stream according to the multicast forwarding routing table and the SDP (Service Description Protocol) table. When the verification is passed, the data stream switching operation is continued, that is, the data stream switching is successful. When the verification fails, the data stream switching operation is not performed, that is, the data stream switching fails. Therefore, the embodiment of the present application provides a data verification method, and the method is as Figure 10 shown, and the specific steps include:
[0164] Step 1001, establish intersection point information according to the source end identifier and the destination end identifier in the target data stream.
[0165] In this step, according to the source end identifier and the destination end identifier in the target data stream, establish the corresponding relationship between the source end identifier and the destination end identifier, and determine it as the intersection point information, specifically as Figure 11 shown.
[0166] Step 1002, verify the intersection point information according to the preset rules to obtain a verification result.
[0167] In this step, the network controller obtains the multicast forwarding routing table and detects whether the intersection point information exists in the multicast forwarding routing table. When it exists in the multicast forwarding routing table, it indicates that the intersection point information is correct and the verification is passed. When it does not exist in the multicast forwarding routing table, it indicates that the intersection point information is incorrect and the verification fails.
[0168] Of course, the network controller can also obtain the SDP table to verify whether the intersection point information is correct, and then obtain the verification result.
[0169] Step 1003, determine whether the current data stream can be switched to the target data stream according to the verification result.
[0170] In this step, when the verification result is that the verification is passed, it is determined that the current data stream can be switched to the target data stream. When the verification result is that the verification fails, it is determined that the current data stream cannot be switched to the target data stream.
[0171] It should be understood that although the steps in the flowchart are sequentially shown according to the indication of the arrows, these steps are not necessarily executed sequentially in the order indicated by the arrows. Unless otherwise clearly stated in this article, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in the figure may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least a part of other steps or sub-steps or stages of other steps.
[0172] Please refer to Figure 12 , an embodiment of the present application provides a data flow switching device, including:
[0173] A receiving unit 1201, configured to receive a switching instruction for instructing to switch the current data flow to a target data flow;
[0174] A first determination unit 1202, configured to determine a target data flow to be switched according to the switching instruction, where the target data flow includes at least one data sub-flow and a target identifier for indicating a destination end;
[0175] A second determination unit 1203, configured to determine a first flow type feature code corresponding to each data sub-flow in the target data flow;
[0176] A third determination unit 1204, configured to determine a second flow type feature code corresponding to the data flow required by the destination end according to the target identifier;
[0177] A fourth determination unit 1205, configured to determine whether the current data flow can be switched to the target data flow according to the first flow type feature code and the second flow type feature code;
[0178] A switching unit 1206, configured to switch the current data flow to the target data flow when the current data flow can be switched to the target data flow.
[0179] Optionally, the second determination unit 1203 is configured to:
[0180] Divide the target data flow to determine the data sub-flows included in the target data flow, and obtain the data sub-flows sent by the source end;
[0181] Extract features from the data sub-flows sent by the source end to obtain target features;
[0182] Determine the first flow pattern feature code of the data sub-stream sent by the source end according to the corresponding relationship between the target feature and the pre-created feature and flow pattern feature code.
[0183] Optionally, the third determination unit 1204 is configured to:
[0184] Obtain the corresponding relationship between the pre-created identifier and the flow pattern feature code;
[0185] Determine the second flow pattern feature code corresponding to the data stream required by the destination end according to the target identifier and the corresponding relationship.
[0186] Optionally, the fourth determination unit 1205 is configured to:
[0187] Detect whether there is a third flow pattern feature code identical to the first flow pattern feature code in the second flow pattern feature code;
[0188] When there is the third flow pattern feature code, determine that the current data stream can be switched to the target data stream;
[0189] When there is no third flow pattern feature code, determine that the current data stream cannot be switched to the target data stream.
[0190] Optionally, the switching unit 1206 is configured to:
[0191] Determine the target data sub-stream corresponding to the third flow pattern feature code in the target data stream;
[0192] Switch the current data stream to the target data sub-stream.
[0193] Optionally, the flow pattern feature code indicates the position of the coding type of the corresponding data stream in the initial feature sequence. The fourth determination unit 1205 is configured to:
[0194] Set the initial feature sequence according to the first flow pattern feature code to obtain a first feature sequence;
[0195] Set the initial feature sequence according to the second flow pattern feature code to obtain a second feature sequence;
[0196] Compare the first feature sequence and the second feature sequence to determine whether there is a target data bit that meets the conditions;
[0197] Determine whether there is a third flow pattern feature code identical to the first flow pattern feature code according to whether there is a target data bit that meets the conditions.
[0198] Optionally, the device further includes a detection unit 1207, and the detection unit 1207 is configured to:
[0199] Determine the maximum pipe diameter of the pipeline where the target data sub - stream is located according to the encoding type of the target data sub - stream;
[0200] Obtain the current flow rate of the target data sub - stream;
[0201] When the current flow rate is greater than the maximum pipe diameter, discard the excess part of the target data sub - stream.
[0202] Optionally, the device further includes a verification unit 1208, and the verification unit 1208 is used for:
[0203] Establish cross - point information according to the source - end identifier and destination - end identifier in the target data stream;
[0204] Verify the cross - point information according to a preset rule to obtain a verification result;
[0205] Determine whether the current data stream can be switched to the target data stream according to the verification result.
[0206] For the specific limitations of the above data - stream switching device, reference can be made to the limitations of the data - stream switching method in the above text, which will not be elaborated here. Each unit in the above carriage event detection device can be implemented in whole or in part through software, hardware, and their combination. The above - mentioned units can be embedded in the processor of the computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to the above - mentioned modules.
[0207] In one embodiment, a computer device is provided, and the internal structure diagram of the computer device can be as Figure 13 shown. The computer device includes a processor, a memory, a network interface, and a database connected through a system bus. Among them, 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, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non - volatile storage medium. The database of the computer device is used to store data. The network interface of the computer device is used to communicate with an external terminal through a network connection. The computer program, when executed by the processor, can implement a data - stream switching method as above. It includes: a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, any step in the above - mentioned data - stream switching method is realized.
[0208] 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, any step in the above - mentioned data - stream switching method can be realized.
[0209] Those skilled in the art should understand that the embodiments of the present application can be provided as a data flow switching method, system, or computer program product. Therefore, the present application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0210] The present application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, as well as the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0211] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including instruction means that implement the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0212] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0213] Although the preferred embodiments of the present application have been described, those skilled in the art can make additional changes and modifications once they know the basic creative concepts. Therefore, the appended claims are intended to be construed to include the preferred embodiments as well as all changes and modifications falling within the scope of the present application.
[0214] Obviously, those skilled in the art can make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalent technologies, this application is also intended to include these modifications and variations.
Claims
1. A data stream switching method, characterized in that, The method includes: Receiving a switching instruction for instructing to switch the current data stream to a target data stream; Determining, according to the switching instruction, the target data stream to be switched, where the target data stream includes at least one data sub-stream and a target identifier for indicating a destination end; Determining a first stream type feature code corresponding to each data sub-stream in the target data stream; Determining a second stream type feature code corresponding to the data stream required by the destination end according to the target identifier; Determining whether the current data stream can be switched to the target data stream according to the first stream type feature code and the second stream type feature code; When the current data stream can be switched to the target data stream, switching the current data stream to the target data stream.
2. The method according to claim 1, characterized in that The determining a first stream type feature code corresponding to each data sub-stream in the target data stream includes: Dividing the target data stream to determine the data sub-streams included in the target data stream, and obtaining the data sub-streams sent by the source end; Performing feature extraction on the data sub-streams sent by the source end to obtain target features; Determining a first stream type feature code of the data sub-streams sent by the source end according to the target features and a pre-created correspondence between features and stream type feature codes.
3. The method according to claim 1, characterized in that, The determining a second stream type feature code corresponding to the data stream required by the destination end according to the target identifier includes: Obtaining a pre-created correspondence between identifiers and stream type feature codes; Determining a second stream type feature code corresponding to the data stream required by the destination end according to the target identifier and the correspondence.
4. The method according to claim 1, characterized in that, The determining whether the current data stream can be switched to the target data stream according to the first stream type feature code and the second stream type feature code includes: Detecting whether there is a third stream type feature code identical to the first stream type feature code in the second stream type feature code; When there is the third stream type feature code, determining that the current data stream can be switched to the target data stream; When there is no third stream type feature code, determining that the current data stream cannot be switched to the target data stream.
5. The method according to claim 4, characterized in that, The stream type feature code indicates the position of the encoding type of the corresponding data stream in the initial feature sequence. The detecting whether there is a third stream type feature code identical to the first stream type feature code in the second stream type feature code includes: Setting the initial feature sequence according to the first stream type feature code to obtain a first feature sequence; Setting the initial feature sequence according to the second stream type feature code to obtain a second feature sequence; Comparing the first feature sequence and the second feature sequence to determine whether there is a target data bit that meets the conditions; Determining whether there is a third stream type feature code identical to the first stream type feature code according to whether there is a target data bit that meets the conditions.
6. The method according to claim 5, wherein The method further includes: Determining the maximum pipe diameter of the pipe where the target data sub-stream is located according to the encoding type of the target data sub-stream; Obtaining the current flow rate of the target data sub-stream; When the current flow rate is greater than the maximum pipe diameter, discarding the excess part of the target data sub-stream.
7. The method according to claim 1, wherein The method further includes: Establish cross - point information according to the source - end identifier and the destination - end identifier in the target data stream; Verify the cross - point information according to a preset rule to obtain a verification result; Determine whether the current data stream can be switched to the target data stream according to the verification result.
8. A data flow switching device, characterized in that It includes: A receiving unit, configured to receive a switching instruction for instructing to switch the current data stream to a target data stream; A first determination unit, configured to determine the target data stream to be switched according to the switching instruction, where the target data stream includes at least one data sub - stream and a target identifier for indicating the destination end; A second determination unit, configured to determine the first flow - type feature code corresponding to each data sub - stream in the target data stream; A third determination unit, configured to determine the second flow - type feature code corresponding to the data stream required by the destination end according to the target identifier; A fourth determination unit, configured to determine whether the current data stream can be switched to the target data stream according to the first flow - type feature code and the second flow - type feature code; A switching unit, configured to switch the current data stream to the target data stream when the current data stream can be switched to the target data stream.
9. A computer device, comprising: A memory and a processor, the memory stores a computer program, characterized in that 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 the processor, the steps of the method according to any one of claims 1 to 7 are implemented.