CN109756488B - Data stream acquisition method, device, equipment and medium - Google Patents

Data stream acquisition method, device, equipment and medium Download PDF

Info

Publication number
CN109756488B
CN109756488B CN201811593075.XA CN201811593075A CN109756488B CN 109756488 B CN109756488 B CN 109756488B CN 201811593075 A CN201811593075 A CN 201811593075A CN 109756488 B CN109756488 B CN 109756488B
Authority
CN
China
Prior art keywords
data stream
access address
transcoding
original
user terminal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811593075.XA
Other languages
Chinese (zh)
Other versions
CN109756488A (en
Inventor
林松正
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Onething Technology Co Ltd
Original Assignee
Shenzhen Onething Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Onething Technology Co Ltd filed Critical Shenzhen Onething Technology Co Ltd
Priority to CN201811593075.XA priority Critical patent/CN109756488B/en
Publication of CN109756488A publication Critical patent/CN109756488A/en
Application granted granted Critical
Publication of CN109756488B publication Critical patent/CN109756488B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a method, a device, equipment and a medium for acquiring data streams, wherein the method comprises the following steps: responding to an access request of a user terminal to target multimedia data, setting the transcoding resource link as an access address, and acquiring a transcoding data stream of the target multimedia data according to the access address; judging whether the acquisition of the coded data stream is abnormal or not; if so, modifying the content of the access address into an original resource link, and acquiring an original data stream of the target multimedia data according to the access address; returning the original data stream to the user terminal; otherwise, the transcoded data stream is returned to the user terminal. The method can provide the original data stream to the user in time under the condition that the transcoded data stream cannot be provided to the user, so that the normal acquisition of the multimedia data by the user is ensured, and the requirement of high timeliness of the streaming media service is relatively met. In addition, the invention also provides a data stream acquisition device, equipment and a medium, and the beneficial effects are as above.

Description

Data stream acquisition method, device, equipment and medium
Technical Field
The present invention relates to the field of data communication, and in particular, to a method, an apparatus, a device, and a medium for acquiring a data stream.
Background
With the development of network technology, the network brings more and more various information to people, the efficiency requirements of users for obtaining network data are gradually increased, and the appearance of streaming media greatly facilitates the work and life of people.
Streaming media refers to a media format that uses streaming transmission technology to continuously play multimedia files including audio, video, etc. in real time on the network, and essentially, continuous multimedia data are compressed and then uploaded to a streaming media server, and then when a user terminal accesses a resource link of target multimedia data, the streaming media server sequentially or real-timely transmits an original data stream of the target multimedia data to the user terminal, and then the user can view and listen in real time while downloading. In order to ensure that each user terminal has a better playing effect or generates less resource overhead due to the difference of playing environments among various user terminals, the original data stream is often dynamically transcoded according to the characteristics of the playing environment of the user terminal to generate a transcoded data stream, and the transcoded data stream is provided to the user terminal for use. However, in the current dynamic transcoding process, abnormal situations such as interruption of dynamic transcoding due to incompatibility between the used transcoding mechanism and the original data stream may occur, and the user terminal cannot normally acquire the transcoded data stream under the abnormal situations, so that the normal acquisition of the multimedia data by the user cannot be ensured, and the requirement of high timeliness of the streaming media service is difficult to meet.
Therefore, it is obvious that providing a data stream acquiring method to ensure that a user acquires multimedia data normally, and further meet the requirement of high timeliness of a streaming media service is a problem to be solved by those skilled in the art.
Disclosure of Invention
The invention aims to provide a data stream acquisition method to ensure that a user can normally acquire multimedia data, thereby meeting the requirement of high timeliness of a streaming media service.
In order to solve the above technical problem, the present invention provides a data stream acquiring method, which is characterized in that the method includes:
responding to an access request of a user terminal to target multimedia data, setting the transcoding resource link as an access address, and acquiring a transcoding data stream of the target multimedia data according to the access address;
judging whether the acquisition of the coded data stream is abnormal or not;
if so, modifying the content of the access address into an original resource link, and acquiring an original data stream of the target multimedia data according to the access address;
returning the original data stream to the user terminal;
otherwise, the transcoded data stream is returned to the user terminal.
Preferably, modifying the content of the access address into the original resource link, and obtaining the original data stream of the target multimedia data according to the access address includes:
and modifying the content of the access address into the original resource link by calling the rewrite request of the Nginx service, and acquiring the original data stream of the target multimedia data according to the access address.
Preferably, before the transcoding resource link is set as the access address, the method further comprises:
judging whether the target multimedia data has a transcoding data stream or not;
if yes, executing the step of setting the transcoding resource link as an access address and acquiring the transcoding data stream of the target multimedia data according to the access address;
otherwise, setting the original resource link as an access address, and acquiring an original data stream of the target multimedia data according to the access address;
a step of returning the original data stream to the user terminal is performed.
Preferably, before modifying the contents of the access address to the original resource link by calling the rewrite request of the Nginx service, the method further comprises:
judging whether other transcoding resource links compatible with the transcoding rate of the user terminal exist or not;
if so, modifying the content of the access address into other transcoding resource links by calling the rewrite request, and acquiring other transcoding data streams of the target multimedia data according to the access address;
returning other transcoded data streams to the user terminal;
otherwise, a step of modifying the contents of the access address to the original resource link by calling the rewrite request of the Nginx service is performed.
Preferably, the obtaining of the transcoded data stream of the target multimedia data according to the access address includes:
acquiring a transcoding data stream in a preset first multimedia server according to the access address;
correspondingly, the step of obtaining the original data stream of the target multimedia data according to the access address comprises the following steps:
and acquiring the original data stream in a preset second multimedia server according to the access address.
Preferably, the target multimedia data includes video live data.
In addition, the invention also provides a data stream acquisition device, which comprises a memory, a processor and a bus, wherein the memory stores a data stream acquisition program which can be transmitted on the bus and run on the processor, and the data stream acquisition program realizes the method when being executed by the processor.
Preferably, the device is a node constituting a CDN network or a blockchain network.
In addition, the present invention also provides a data stream acquiring system, which comprises:
the response setting unit is used for responding to an access request of the user terminal to the target multimedia data, setting the transcoding resource link as an access address, and acquiring a transcoding data stream of the target multimedia data according to the access address;
the exception judging unit is used for judging whether the coded data stream is abnormal or not, if so, the address modifying unit and the original data returning unit are sequentially executed, and if not, the transcoded data returning unit is executed;
the address modification unit is used for modifying the content of the access address into an original resource link and acquiring an original data stream of the target multimedia data according to the access address;
the original data return unit is used for returning the original data stream to the user terminal;
and the transcoding data returning unit is used for returning the transcoding data stream to the user terminal.
Furthermore, the present invention also provides a computer-readable storage medium having a data stream acquisition program stored thereon, the data stream acquisition program being executable by one or more processors to implement the data stream acquisition method as described above.
Furthermore, the present invention also provides a computer program product comprising computer instructions which, when run on a computer, cause the computer to perform the above-mentioned data stream acquisition method.
The data stream obtaining method provided by the invention sets the transcoding resource link as an access address after responding to an access request of a user terminal to target multimedia data, and then obtains the transcoding data stream of the target multimedia data according to the access address, when the process of obtaining the transcoding data stream is abnormal, the content of the access address is modified into the original resource link, and then the original data stream of the multimedia data is obtained according to the original resource link and returned to the user terminal; and when the process of obtaining the transcoding data stream is normal, returning the obtained transcoding data stream to the user terminal. Therefore, the method can provide the original data stream to the user in time under the condition that the transcoded data stream cannot be provided to the user, so that the normal acquisition of the multimedia data by the user is ensured, and the requirement of high timeliness of the streaming media service is relatively met. In addition, the invention also provides a data stream acquisition device, equipment and a medium, and the beneficial effects are as above.
Drawings
In order to illustrate the embodiments of the present invention more clearly, the drawings that are needed in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings can be obtained by those skilled in the art without inventive effort.
Fig. 1 is a flowchart of a data stream acquiring method according to an embodiment of the present invention;
fig. 2 is a flowchart of another data stream acquiring method according to an embodiment of the present invention;
fig. 3 is a flowchart of another data stream acquiring method according to an embodiment of the present invention;
fig. 4 is a topology structure diagram of a scenario embodiment provided in the embodiment of the present invention;
fig. 5 is a structural diagram of a data stream acquiring apparatus according to an embodiment of the present invention;
fig. 6 is a structural diagram of a data stream acquiring system according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims of the present application and in the above-described drawings (if any) are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be noted that the description relating to "first", "second", etc. in the present invention is for descriptive purposes only and is not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In addition, the technical solutions in the embodiments may be combined with each other, but it must be based on the realization of those skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination of the technical solutions should not be considered to exist, and is not within the protection scope of the present invention.
Example one
The invention provides a data stream acquisition method.
Referring to fig. 1, fig. 1 is a flowchart of a data stream acquiring method according to an embodiment of the present invention.
In one embodiment, the method comprises:
and step S10, responding to the access request of the user terminal to the target multimedia data, setting the transcoding resource link as an access address, and acquiring the transcoding data stream of the target multimedia data according to the access address.
It should be noted that the user terminal in this step is an access initiator for the target multimedia data, and the execution main body of this step may be a multimedia data server that stores the multimedia data in advance and can directly provide the corresponding target multimedia data to the user terminal, or an agent server that replaces the user terminal to access the target multimedia data to the corresponding multimedia data server and return the target multimedia data to the user terminal, which is specifically determined according to the actual needs of the user and the specific communication topology scenario.
In addition, the transcoded data stream in this step is a data stream obtained by performing corresponding coding conversion on an original data stream, the original data stream mentioned in the subsequent step is the most basic multimedia data stream, the original data stream can be played by a user terminal having any playing environment, but because the original data stream lacks corresponding coding optimization, a large overhead is often required in the transmission or playing process, and then the original data stream generated in real time is dynamically coded by a corresponding coding mechanism according to the difference of the playing environments of the user terminal to generate a transcoded data stream, and then the transcoded data stream is provided for the user terminal by default to reduce the overall resource overhead. The original data stream and the transcoded data stream are both generated in real time and have corresponding resource links, so that a user can obtain the data stream of a corresponding type according to the specific resource links, which is well known to those skilled in the art and will not be described in detail herein.
A step S11 of determining whether or not there is an abnormality in the acquisition of the coded data stream, and if so, executing steps S12 and S13 in sequence; otherwise, step S14 is executed.
And step S12, modifying the content of the access address into the original resource link, and acquiring the original data stream of the target multimedia data according to the access address.
Step S13, the original data stream is returned to the user terminal.
And step S14, returning the transcoded data stream to the user terminal.
It can be understood that, since the transcoded data stream is a data stream type generated in real time by dynamically encoding an original data stream, there may be an abnormal situation that the transcoded data stream is interrupted or a code disorder is generated due to incompatibility of a transcoding mechanism and the original data stream or a transcoding error, and further the transcoded data stream cannot be normally provided to the user terminal, in order to ensure that the multimedia data can be reliably provided to the user terminal under the above abnormal situation, the method determines an obtaining process of the transcoded data stream, modifies an access address of the multimedia data into an original resource link when there is an abnormality, and further obtains the original data stream of the target multimedia data according to the access address, and since the original data stream has universality for various playing environments of the user terminal, under the situation that the transcoded data stream cannot be normally obtained, the user terminal is ensured to play the target multimedia data stably. It should be noted that, determining whether the obtaining of the transcoding data stream is abnormal may specifically be determining whether the data stream obtained by the transcoding resource link cannot be analyzed, that is, if the obtained data stream cannot be analyzed by the user terminal or is analyzed incorrectly, determining that the obtaining of the transcoding data stream is abnormal; or, it may be determined whether the corresponding transcoded data stream cannot be acquired through the transcoding resource link, that is, if the data stream cannot be acquired in the multimedia server through the transcoding resource link, it is determined that the acquisition of the transcoded data stream is abnormal. In addition, the transcoding resource link and the original resource link in the method can be specifically URL resource links; in the method, "return the original data stream to the user terminal" and "return the transcoded data stream to the user terminal" both refer to transmitting the original data stream and the transcoded data stream to the user terminal based on the communication relationship established between the original data stream and the user terminal, and since how to perform data communication between devices is not the focus of the method and is a content known by those skilled in the art, it is not described herein again.
The data stream obtaining method provided by the invention sets the transcoding resource link as an access address after responding to an access request of a user terminal to target multimedia data, and then obtains the transcoding data stream of the target multimedia data according to the access address, when the process of obtaining the transcoding data stream is abnormal, the content of the access address is modified into the original resource link, and then the original data stream of the multimedia data is obtained according to the original resource link and returned to the user terminal; and when the process of obtaining the transcoding data stream is normal, returning the obtained transcoding data stream to the user terminal. Therefore, the method can provide the original data stream to the user in time under the condition that the transcoded data stream cannot be provided to the user, so that the normal acquisition of the multimedia data by the user is ensured, and the requirement of high timeliness of the streaming media service is relatively met.
Example two
Referring to fig. 2, fig. 2 is a flowchart of another data stream acquiring method according to an embodiment of the present invention.
As shown in fig. 2, as a preferred embodiment, step S12 includes:
and step S20, modifying the content of the access address into the original resource link by calling the rewrite request of the Nginx service, and acquiring the original data stream of the target multimedia data according to the access address.
It should be noted that, in an actual application scenario, the number of the user terminals is often large, and further the number of the access requests initiated by each user terminal is relatively large, and therefore may lead to a relatively large working pressure of the server device in processing the access request, the present embodiment is to perform the transcoding operation when the transcoded data stream is abnormal, the read request provided by the Nginx service is used to modify the access address to the original resource address, and then the original data flow of the target multimedia data is obtained through the modified access address, because the Nginx service has higher concurrent response capability compared with other network proxy services, the access request initiated by each user terminal can be processed more efficiently, thereby ensuring the overall efficiency and stability of the server device when responding to the access request of the user terminal. In a specific implementation, a preferred execution main body of the present embodiment may be a proxy server running a Nginx service, and after responding to an access request of each user terminal, the proxy server replaces each user terminal to access a multimedia data server storing multimedia data, and returns a data stream of the accessed target multimedia data to the responding user terminal.
In addition, as a preferred embodiment, before setting the transcoding resource link as the access address, the method further includes:
judging whether the target multimedia data has a transcoding data stream or not;
if yes, executing the step of setting the transcoding resource link as an access address and acquiring the transcoding data stream of the target multimedia data according to the access address;
otherwise, setting the original resource link as an access address, and acquiring an original data stream of the target multimedia data according to the access address;
a step of returning the original data stream to the user terminal is performed.
It should be noted that, in practical applications, there may be a case where target multimedia data accessed by a user terminal does not have a corresponding transcoding mechanism, and therefore, there is only an original data stream but no corresponding transcoding data stream, in this case, in order to relatively reduce the time overhead required by the user terminal to acquire the multimedia data, in the present embodiment, when an access request of the user terminal is acquired, it is determined in advance whether the target multimedia data has a transcoding data stream, and if not, an original resource link is directly set as an access address, and then the original data stream of the target multimedia data is acquired according to the access address and returned to the user terminal, so that the data stream acquisition efficiency of the user terminal is improved.
Referring to fig. 3, fig. 3 is a flowchart of another data stream acquiring method according to an embodiment of the present invention.
As shown in fig. 3, as a preferred embodiment, before step S20, the method further includes:
step S30, judging whether other transcoding resource links compatible with the transcoding rate of the user terminal exist, if so, executing step S31 and step S32 in sequence; otherwise, step S20 is executed.
Step S31, the content of the access address is modified into other transcoding resource links by calling the rewrite request, and other transcoding data streams of the target multimedia data are obtained according to the access address;
and step S32, returning other transcoded data streams to the user terminal.
It should be noted that, in this embodiment, in practical applications, the target multimedia data may have data streams with various code rates obtained by transcoding the original data stream, therefore, when it is determined that there is an abnormality in the acquisition of the transcoded data stream, the present embodiment further determines whether there is another transcoding resource link compatible with the transcoding rate of the user terminal, where the another transcoding resource link referred to herein corresponds to another transcoded data stream except the transcoded data stream obtained based on the transcoding of the original data stream, and when there is another transcoding resource link compatible with the transcoding rate of the user terminal, the content of the access address is modified to other transcoding resource links by invoking the rewrite request, and acquiring other transcoding data streams of the target multimedia data according to the access address, and then returning the other transcoding data streams to the user terminal. The method and the system can ensure that when the transcoding data is abnormal, transcoding optimized data streams are continuously provided for the user terminal, and relatively reduce the overall resource overhead when the user acquires the target multimedia data.
Furthermore, as a preferred embodiment, the obtaining of the transcoded data stream of the target multimedia data according to the access address includes:
acquiring a transcoding data stream in a preset first multimedia server according to the access address;
correspondingly, the step of obtaining the original data stream of the target multimedia data according to the access address comprises the following steps:
and acquiring the original data stream in a preset second multimedia server according to the access address.
It should be noted that, in the present embodiment, it is intended to obtain the transcoded data stream and the original data stream in different multimedia servers, and therefore, in the present embodiment, a plurality of multimedia servers are present by default to provide the target multimedia data for the user terminal together, and the transcoded data stream and the original data stream of the target multimedia data are obtained in different multimedia servers respectively, so that it can be ensured that each multimedia server provides only one type of data stream to the outside, the working stability of each multimedia server is relatively improved, and the overall reliability when the user terminal obtains the target multimedia data can be ensured.
Further, in addition to the above-described series of embodiments, as a preferred embodiment, the target multimedia data includes live video data.
In the field of live video broadcast, the requirement of the user terminal on the real-time performance of acquiring the video content is higher, so that the target multimedia data is limited to live video data in the embodiment, that is, the method is applied to the acquisition of the video data in live video broadcast, and the real-time performance and the stability of live video broadcast can be ensured.
EXAMPLE III
Based on the content of the foregoing embodiment, the present invention further provides a scene embodiment in a specific application scenario, please refer to fig. 4 for a device topology relationship of the specific scene, and fig. 4 is a topology structure diagram of the scene embodiment provided in the embodiment of the present invention.
Based on the topology structure diagram shown in fig. 4, the main interaction flow of this embodiment is as follows:
1. a user terminal initiates a live streaming request based on a GET request to a proxy server running with a Nginx service, wherein the live streaming request comprises a transcoding resource link in a URL form;
2. the Nginx service in the proxy server transmits the transcoding resource link in the form of the URL to the rewrite module, and the rewrite module judges whether to adjust or not;
3, rewriting the URL transcoding resource link with or without adjustment to the Nginx service;
and 4, the Nginx service sends the URL transcoding resource link returned by the re-write module to the direct broadcast server to be used as an access address to access the transcoding data stream of the live data, if the direct broadcast server does not respond or returns state information that the transcoding data stream does not exist, the Nginx service sends the URL transcoding resource link to the re-write module to be adjusted to a corresponding URL original resource link, and then the Nginx service requests the live broadcast server through the URL original resource link again to broadcast the original data stream of the data and returns the original data stream of the data to the user terminal.
Example four
In the above, the embodiment of the data stream acquiring method is described in detail, and the present invention further provides a data stream acquiring device corresponding to the method.
Fig. 5 is a structural diagram of a data stream acquiring apparatus according to an embodiment of the present invention.
As shown in fig. 5, the data stream acquiring apparatus 1 provided by the present invention includes a memory 11, a processor 12 and a bus 13, wherein the memory 11 stores a data stream acquiring program that can be transmitted on the bus 13 and run on the processor 12, and the data stream acquiring program implements the data stream acquiring method when executed by the processor 12.
The data stream acquiring device provided by the invention sets the transcoding resource link as an access address after responding to an access request of a user terminal to target multimedia data, and then acquires the transcoding data stream of the target multimedia data according to the access address; and when the process of obtaining the transcoding data stream is normal, returning the obtained transcoding data stream to the user terminal. Therefore, when the transcoded data stream of the multimedia data acquired through the transcoded resource link is abnormal, the device acquires the original data stream which can basically ensure the normal use of the user terminal by modifying the transcoded resource link into the original resource link, and then returns the original data stream to the user terminal.
In this embodiment, the data stream acquiring apparatus 1 may be a PC (personal computer), or may be a smartphone, a tablet computer, a palmtop computer, a portable computer, an intelligent router, an ore machine, or a network storage device terminal device.
The apparatus 1 may be a node constituting a CDN network or a blockchain network.
The memory 11 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, and the like. The memory 11 may in some embodiments be an internal storage unit of the data stream acquiring apparatus 1, such as a hard disk of the data stream acquiring apparatus 1. The memory 11 may also be an external storage device of the data stream acquiring apparatus 1 in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like equipped on the data stream acquiring apparatus 1. Further, the memory 11 may also include both an internal storage unit and an external storage device of the data stream acquisition apparatus 1. The memory 11 may be used not only to store application software installed in the data stream acquisition apparatus 1 and various types of data, such as a code of a data stream acquisition program, but also to temporarily store data that has been output or is to be output.
The processor 12 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor or other data Processing chip in some embodiments, and is used for executing program codes stored in the memory 11 or Processing data, such as executing a data stream acquiring program.
The bus 13 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 5, but this is not intended to represent only one bus or type of bus.
Further, the data stream acquiring apparatus may further include a network interface, and the network interface may optionally include a wired interface and/or a wireless interface (such as a WI-FI interface, a bluetooth interface, etc.), which is generally used to establish a communication connection between the apparatus 1 and other electronic devices.
Optionally, the apparatus 1 may further comprise a user interface, which may comprise a Display (Display), an input unit such as a Keyboard (Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable for displaying information processed in the data stream acquisition device 1 and for displaying a visual user interface.
EXAMPLE five
In addition, the present invention further provides a data stream acquiring system, and fig. 6 is a structural diagram of the data stream acquiring system provided in the embodiment of the present invention.
As shown in fig. 6, the data stream acquiring system provided in the embodiment of the present invention includes:
and the response setting unit 20 is configured to respond to an access request of the user terminal for the target multimedia data, set the transcoding resource link as an access address, and obtain a transcoding data stream of the target multimedia data according to the access address.
And the abnormity judging unit 21 is used for judging whether abnormity exists in the acquisition of the transcoding data stream, if so, the address modifying unit 22 and the original data returning unit 23 are sequentially executed, and otherwise, the transcoding data returning unit 24 is executed.
And the address modification unit 22 is used for modifying the content of the access address into the original resource link and acquiring the original data stream of the target multimedia data according to the access address.
And an original data returning unit 23, configured to return the original data stream to the user terminal.
And a transcoded data returning unit 24, configured to return the transcoded data stream to the user terminal.
The data stream acquiring system provided by the invention sets the transcoding resource link as an access address after responding to an access request of a user terminal to target multimedia data, and then acquires the transcoding data stream of the target multimedia data according to the access address, when the process of acquiring the transcoding data stream is abnormal, the content of the access address is modified into the original resource link, and then the original data stream of the multimedia data is acquired according to the original resource link and returned to the user terminal; and when the process of obtaining the transcoding data stream is normal, returning the obtained transcoding data stream to the user terminal. Therefore, when the transcoded data stream of the multimedia data acquired through the transcoded resource link is abnormal, the system acquires the original data stream which can basically ensure normal use of the user terminal by modifying the transcoded resource link into the original resource link, and then returns the original data stream to the user terminal.
Furthermore, the present invention also provides a computer-readable storage medium having a data stream acquisition program stored thereon, the data stream acquisition program being executable by one or more processors to implement the data stream acquisition method as described above.
The computer-readable storage medium provided by the invention sets the transcoding resource link as an access address after responding to an access request of a user terminal to target multimedia data, and then obtains the transcoding data stream of the target multimedia data according to the access address, when the process of obtaining the transcoding data stream is abnormal, the content of the access address is modified into the original resource link, and then the original data stream of the multimedia data is obtained according to the original resource link and returned to the user terminal; and when the process of obtaining the transcoding data stream is normal, returning the obtained transcoding data stream to the user terminal. Therefore, when the transcoded data stream of the multimedia data is obtained through the transcoded resource link and is abnormal, the computer readable storage medium obtains the original data stream which can basically ensure the normal use of the user terminal through modifying the transcoded resource link into the original resource link, and then returns the original data stream to the user terminal.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product.
The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions according to the embodiments of the present invention are generated in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can store or a data storage device including one or more available media integrated servers, data centers, and the like. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical functional division, and in actual implementation, there may be other divisions, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a hardware form, and can also be realized in a software functional unit form.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and the like.
It should be noted that the above-mentioned numbers of the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments. And the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, apparatus, article, or method that includes the element.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the present specification and drawings, or used directly or indirectly in other related fields, are included in the scope of the present invention.

Claims (8)

1. A method for data stream acquisition, the method comprising:
responding to an access request of a user terminal to target multimedia data, setting a transcoding resource link as an access address, and acquiring a transcoding data stream of the target multimedia data according to the access address;
judging whether the acquisition of the transcoding data stream is abnormal or not;
if so, modifying the content of the access address into an original resource link, and acquiring an original data stream of the target multimedia data according to the access address;
returning the original data stream to the user terminal;
otherwise, returning the transcoded data stream to the user terminal;
the modifying the content of the access address into an original resource link and acquiring the original data stream of the target multimedia data according to the access address comprises:
modifying the content of the access address into the original resource link by calling a rewrite request of a Nginx service, and acquiring an original data stream of the target multimedia data according to the access address;
before the modifying the contents of the access address to the original resource link by the rewrite request invoking the Nginx service, the method further comprises:
judging whether other transcoding resource links compatible with the transcoding rate of the user terminal exist or not;
if so, modifying the content of the access address into the link of other transcoding resources by calling the rewrite request, and acquiring other transcoding data streams of the target multimedia data according to the access address;
returning the other transcoded data stream to the user terminal;
otherwise, the step of modifying the content of the access address to the original resource link by calling the rewrite request of the Nginx service is performed.
2. The method of claim 1, wherein prior to the setting the transcoding resource link as the access address, the method further comprises:
judging whether the target multimedia data has the transcoding data stream or not;
if yes, executing the step of setting the transcoding resource link as an access address and acquiring the transcoding data stream of the target multimedia data according to the access address;
otherwise, setting the original resource link as the access address, and acquiring the original data stream of the target multimedia data according to the access address;
and executing the step of returning the original data stream to the user terminal.
3. The method of claim 1, wherein the obtaining the transcoded data stream of the target multimedia data according to the access address comprises:
acquiring the transcoded data stream in a preset first multimedia server according to the access address;
correspondingly, the obtaining the original data stream of the target multimedia data according to the access address includes:
and acquiring the original data stream in a preset second multimedia server according to the access address.
4. The method of any of claims 1 to 3, wherein the target multimedia data comprises video live data.
5. A data stream acquisition apparatus comprising a memory, a processor and a bus, the memory having stored thereon a data stream acquisition program transmittable on the bus and executable on the processor, the data stream acquisition program, when executed by the processor, implementing the method according to any one of claims 1 to 4.
6. The apparatus of claim 5, wherein the apparatus is a node constituting a CDN network or a blockchain network.
7. A data stream acquisition system, the system comprising:
the response setting unit is used for responding to an access request of a user terminal to target multimedia data, setting the transcoding resource link as an access address, and acquiring the transcoding data stream of the target multimedia data according to the access address;
the abnormity judgment unit is used for judging whether the transcoded data stream is abnormal or not, if so, the address modification unit and the original data return unit are sequentially executed, and if not, the transcoded data return unit is executed;
the address modification unit is used for judging whether other transcoding resource links compatible with the transcoding rate of the user terminal exist or not; if so, modifying the content of the access address into other transcoding resource links by calling the rewrite request, and acquiring other transcoding data streams of the target multimedia data according to the access address; returning other transcoded data streams to the user terminal; otherwise, modifying the content of the access address into an original resource link by calling the rewrite request of the Nginx service, and acquiring an original data stream of the target multimedia data according to the access address;
the original data returning unit is used for returning the original data stream to the user terminal;
and the transcoded data returning unit is used for returning the transcoded data stream to the user terminal.
8. A computer-readable storage medium having stored thereon a data stream acquisition program executable by one or more processors to implement the data stream acquisition method of any one of claims 1 to 4.
CN201811593075.XA 2018-12-25 2018-12-25 Data stream acquisition method, device, equipment and medium Active CN109756488B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811593075.XA CN109756488B (en) 2018-12-25 2018-12-25 Data stream acquisition method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811593075.XA CN109756488B (en) 2018-12-25 2018-12-25 Data stream acquisition method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN109756488A CN109756488A (en) 2019-05-14
CN109756488B true CN109756488B (en) 2021-09-24

Family

ID=66403284

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811593075.XA Active CN109756488B (en) 2018-12-25 2018-12-25 Data stream acquisition method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN109756488B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113596467B (en) * 2020-04-30 2024-03-12 北京达佳互联信息技术有限公司 Transcoding service detection method and device, electronic equipment and storage medium
CN113473183B (en) * 2021-06-29 2023-05-05 华夏城视网络电视股份有限公司 Dynamic and static media stream batch processing method applied to fusion media

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101778104A (en) * 2009-12-29 2010-07-14 常州中流电子科技有限公司 System and method for playing stream media by using self-adaption bandwidth
CN103379362A (en) * 2012-04-24 2013-10-30 腾讯科技(深圳)有限公司 Video-on-demand method and system
CA2804741A1 (en) * 2013-01-21 2014-07-21 Disternet Technology, Inc. Media server
CN105407381A (en) * 2015-10-30 2016-03-16 北京奇艺世纪科技有限公司 Video program play method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100689489B1 (en) * 2004-12-07 2007-03-02 삼성전자주식회사 Transcoding method for seamless video display

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101778104A (en) * 2009-12-29 2010-07-14 常州中流电子科技有限公司 System and method for playing stream media by using self-adaption bandwidth
CN103379362A (en) * 2012-04-24 2013-10-30 腾讯科技(深圳)有限公司 Video-on-demand method and system
CA2804741A1 (en) * 2013-01-21 2014-07-21 Disternet Technology, Inc. Media server
CN105407381A (en) * 2015-10-30 2016-03-16 北京奇艺世纪科技有限公司 Video program play method and device

Also Published As

Publication number Publication date
CN109756488A (en) 2019-05-14

Similar Documents

Publication Publication Date Title
US11032140B2 (en) Using a template to update a stack of resources
US20140280859A1 (en) Sharing control system and method for network resources download information
EP4210053A1 (en) Application program control method and apparatus, electronic device, and storage medium
US10581993B2 (en) Method for forwarding traffic in application on mobile intelligent terminal
JP2015515660A (en) Multiple media devices accessing cloud computing service storage via a gateway server or service
US8656443B2 (en) Method and system for providing dynamic time slice encoding for complete internet anywhere
CN109756488B (en) Data stream acquisition method, device, equipment and medium
WO2021189257A1 (en) Malicious process detection method and apparatus, electronic device, and storage medium
CN104349177A (en) Method for turning to play multimedia file under desktop cloud, virtual machine and system
WO2017080167A1 (en) Video pushing method and system for third party
WO2015176648A1 (en) Method and device for transmitting data in intelligent terminal to television terminal
TW200841675A (en) Dispatching client requests to appropriate server-side methods
US20160269446A1 (en) Template representation of security resources
CN110336888B (en) Server distribution method, device, system and medium
US10565158B2 (en) Multi-device synchronization for immersive experiences
CN116261021B (en) Video stream playing method and device, electronic equipment and storage medium
CN103975301A (en) Event service for local client applications through local server
US9077768B2 (en) Method and system for providing digital contents in a network environment
WO2015081716A1 (en) Method, system, and related device for providing application service
CN115174248B (en) Control method and device for network access
US10482397B2 (en) Managing identifiers
CN115022725A (en) Video playing method and device
CN103440134A (en) Webkit kernel-based storage resource service local extension method
EP1130873A2 (en) A method of setting up data communication with a communication means and furthermore program modules and means therefor
CN113194277B (en) Method, device and storage medium for multi-screen video of conference terminal

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant