WO2019196577A1 - Streaming media playback method, server, client and computer device - Google Patents

Streaming media playback method, server, client and computer device Download PDF

Info

Publication number
WO2019196577A1
WO2019196577A1 PCT/CN2019/077226 CN2019077226W WO2019196577A1 WO 2019196577 A1 WO2019196577 A1 WO 2019196577A1 CN 2019077226 W CN2019077226 W CN 2019077226W WO 2019196577 A1 WO2019196577 A1 WO 2019196577A1
Authority
WO
WIPO (PCT)
Prior art keywords
streaming media
file
playback
client
server
Prior art date
Application number
PCT/CN2019/077226
Other languages
French (fr)
Chinese (zh)
Inventor
许赫赫
Original Assignee
北京大米科技有限公司
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
Priority claimed from CN201810311833.8A external-priority patent/CN108600777B/en
Priority claimed from CN201810312559.6A external-priority patent/CN108737372B/en
Application filed by 北京大米科技有限公司 filed Critical 北京大米科技有限公司
Publication of WO2019196577A1 publication Critical patent/WO2019196577A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/231Content storage operation, e.g. caching movies for short term storage, replicating data over plural servers, prioritizing data for deletion

Definitions

  • the present invention relates to the field of online education, and more particularly to a streaming media playback method, a server, a client, and a computer device.
  • the current course playback page saves the courseware for teachers and students, as well as multiple audio and video files.
  • the playback page needs to load multiple files at the same time, and the logical relationship between multiple files is complicated, which easily leads to playback of the page.
  • the speed of entering and dragging is slow, the sound and picture are not synchronized, and the dragging feeling is strong.
  • the bandwidth requirement is high, and the playback page needs to rely on FLASH and content distribution for the audio and video loading of teachers and students.
  • the decoding and transmission of third-party software such as the Content Delivery Network (CDN), the upgrade of the third-party software is prone to incompatibility problems, and the playback page cannot be played.
  • CDN Content Delivery Network
  • an object of the present invention is to provide a streaming media playback method, which directly loads a streaming media file requesting playback into a playback page, which simplifies playback logic of the entire playback system and reduces third-party software.
  • the dependency optimizes the streaming loading process of the playback page and improves the user experience.
  • Another object of the present invention is to provide a computer device. It is still another object of the present invention to provide a readable medium.
  • the embodiment of the present invention discloses a streaming media playback method, which is applied to a streaming media playback server, where the streaming media playback server includes an information forwarding module, an application processing module, and a plurality of service processing modules, and the method includes:
  • the method further comprises:
  • generating the playback page data according to the page generation instruction and sending the playback page data to the client, so that the client generates the playback page includes:
  • the method further comprises:
  • Each service processing module sends a reply instruction to the application processing module according to the received status query instruction
  • the application processing module stops transmitting the streaming media playback request to the processing module.
  • the streaming media file includes an audio and video file
  • the storage address of the corresponding streaming media file is extracted from the database and sent to the client, so that the client obtains the streaming media file and loads the playback page to the playback page, including:
  • the plurality of service processing modules query the storage address of the audio and video file in the database and send the storage address of the audio and video file to the client based on the audio and video file request sent by the client, so that the client
  • the storage address of the audio and video file is obtained from the corresponding CDN edge node and the audio and video files synchronized from the cloud storage server are loaded and loaded to the playback page.
  • the streaming media file includes a signaling file
  • the storage address of the corresponding streaming media file is extracted from the database and sent to the client, so that the client obtains the streaming media file and loads the playback page to the playback page, including:
  • the multiple service processing modules query the storage address of the signaling file in the database and send the storage address of the signaling file to the client based on the signaling file request sent by the client, so that the client obtains the cloud storage.
  • the multiple service processing modules query the storage address of the signaling file in the database based on the signaling file request sent by the client, including:
  • the plurality of service processing modules query, according to the signaling file request sent by the client, the course type of the signaling file requested to be played back in the database, and acquire the signaling file in the database according to the course type. Storage address.
  • the course type is one-on-one, one-to-many or many-to-one.
  • the method further comprises:
  • the streaming media playback server further includes a message queue module, a plurality of data cache modules, and a plurality of video transcoding modules;
  • Transcoding the original media file transmitted by the client to obtain the streaming media file includes:
  • the streaming media upload request Acquiring, by the plurality of service processing modules, the streaming media upload request, and extracting an original media file from the client according to the streaming media upload request, parsing and serializing the original media file to obtain a raw data file;
  • the streaming media file includes an audio and video file and a signaling file
  • the streaming media file is stored and the storage address of the streaming media file is returned to the plurality of service processing modules, so that the service processing module
  • the storage address is stored in the database and includes:
  • the streaming media file is stored in the cloud storage server by the plurality of video transcoding modules, and the audio and video files in the streaming media file are synchronized to the CDN edge node, and the storage address of the audio and video files in the CDN edge node is
  • the storage address of the signaling file in the cloud storage server is transmitted to the service processing module, so that the service processing module further stores the storage address of the audio and video file and the signaling file in the database.
  • Embodiments of the present invention disclose, in a second aspect, a streaming media playback method, including
  • sending a page generation instruction to the streaming media playback server to obtain playback page data to further form a playback page comprises:
  • the streaming media file comprises an audio and video file
  • the streaming media file includes a signaling file
  • the sending a signaling file request to the streaming media playback server to obtain the storage address of the signaling file that is queried by the streaming media playback server in the database includes:
  • the course type is one-on-one, one-to-many or many-to-one.
  • the method further comprises:
  • the original media file is sent to the streaming playback server.
  • Embodiments of the present invention disclose, in a third aspect, a streaming media playback server, including
  • An information forwarding module configured to receive a streaming media playback command sent by the client, and forward the streaming media playback instruction to the application processing module;
  • An application processing module configured to authenticate the legality of the streaming media playback instruction, and output a legal streaming media playback instruction
  • a plurality of service processing modules configured to receive the legal streaming media playback instruction, search for related information of the streaming media file requested to be played back in the database, and respond to the related information of the streaming media file in the database, to the The client sends a streaming media playback address to cause the client to form a playback page;
  • the plurality of service processing modules are further configured to extract a storage address of the corresponding streaming media file from the database and send the storage address to the client, so that the client obtains the streaming media file and loads the playback media file.
  • the application processing module is further configured to receive a page generation instruction sent by the client according to the streaming media playback address, generate playback page data, and send the playback page data to the client, so that the The client generates a playback page.
  • the application processing module is further configured to receive the page generation instruction of the client, generate HTML5 page data, and send the HTML5 page data to the client, so that the client forms an HTML5 playback page.
  • the application processing module is further configured to periodically send a status query instruction to each service processing module;
  • Each service processing module is configured to send a reply instruction to the application processing module according to the received status query instruction
  • the application processing module is further configured to stop sending the streaming media playback request to the service processing module in response to the service processing module not sending back the reply instruction or sending back an error instruction within a specified time.
  • the streaming media file comprises an audio and video file
  • the plurality of service processing modules are configured to query, according to the audio and video file request sent by the client, the storage address of the audio and video file in a database, and send the storage address of the audio and video file to the client, so that the client
  • the storage address of the audio and video file is obtained from the corresponding CDN edge node and the audio and video file synchronized from the cloud storage server is loaded and loaded to the playback page.
  • the streaming media file includes a signaling file
  • the multiple service processing modules are configured to query, according to a signaling file request sent by the client, a storage address of the signaling file in a database, and send the storage address of the signaling file to the client, so that the client obtains A signaling file in the cloud storage server and loading the signaling file to the playback page.
  • the plurality of service processing modules are configured to query, according to a signaling file request sent by the client, a course type of the signaling file requested to be played back in the database, and acquire the database in the database according to the course type.
  • the storage address of the signaling file is configured to query, according to a signaling file request sent by the client, a course type of the signaling file requested to be played back in the database, and acquire the database in the database according to the course type.
  • the storage address of the signaling file is configured to query, according to a signaling file request sent by the client, a course type of the signaling file requested to be played back in the database, and acquire the database in the database according to the course type.
  • the course type is one-on-one, one-to-many or many-to-one.
  • the server is further configured to transcode the original media file transmitted by the client to obtain the streaming media file.
  • the server further comprises:
  • a message queue module configured to receive a streaming media upload request of the client
  • the plurality of service processing modules are further configured to obtain the streaming media upload request, and extract the original media file from the client according to the streaming media upload request, parse and serialize the original media file to obtain the original data file;
  • a plurality of data caching modules configured to receive and cache the original data file transmitted by the service processing module
  • a plurality of video transcoding modules configured to sequentially extract the original data file from the data cache module and deserialize the original media file, and transcode the original media file to form the streaming media file, and store Deriving the media file and returning the storage address of the streaming media file to the plurality of service processing modules, so that the service processing module stores the storage address in a database.
  • the streaming media file includes an audio and video file and a signaling file
  • the plurality of video transcoding modules are configured to store the streaming media file in a cloud storage server and synchronize the audio and video files in the streaming media file to a CDN edge node, and store the audio and video files in the CDN edge node. And storing, by the service processing module, the storage address of the signaling file in the cloud storage server, so that the service processing module further stores the storage address of the audio and video file and the signaling file in a database.
  • An embodiment of the present invention discloses a client in a fourth aspect, including
  • a playback request module configured to send a streaming media playback instruction to the streaming media playback server to obtain a streaming media playback address
  • a page generating module configured to send a page generating instruction to the streaming media playback server to obtain playback page data, further forming a playback page;
  • a data loading module configured to send a streaming media loading instruction to the streaming media playback server to obtain a storage address of the streaming media file, to further acquire the streaming media file to be loaded into the playback page according to the storage address of the streaming media file.
  • the page generating module is further configured to send a page generation instruction to the streaming media playback server to acquire the HTML5 page data generated by the streaming media playback server and send back the data to further form an HTML5 page.
  • the streaming media file comprises an audio and video file
  • the data loading module is configured to send an audio and video file request to the streaming media playback server to obtain an audio and video storage address of the audio and video file queried by the streaming media playback server in the database;
  • the data loading module is configured to search for a corresponding CDN edge node according to the audio and video storage address, and acquire an audio and video file synchronized from the cloud storage server from the CDN edge node and load the file into the playback page.
  • the streaming media file includes a signaling file
  • the data loading module is configured to send a signaling file request to the streaming media playback server to obtain a storage address of the signaling file that is queried by the streaming media playback server in the database;
  • the data loading module is configured to acquire a signaling file in the cloud storage server according to the storage address of the signaling file and load the signaling file to the playback page.
  • the data loading module is further configured to send a signaling file request to the streaming media playback server, so that the streaming media playback server queries the database for the course type of the streaming media file requested for playback, and according to the course type Obtaining a storage address of the signaling file in the database.
  • the course type is one-on-one, one-to-many or many-to-one.
  • the method further comprises:
  • transcoding request module configured to send a streaming media upload request to the streaming media playback server
  • the transcoding request module is further configured to send the original media file to the streaming media playback server.
  • the streaming media playback method of the present invention acquires the streaming media file by using the streaming media file storage address, and directly loads the obtained streaming media file to the playback page, thereby displaying to the user through the playback page, which is not restricted by the third-party software upgrade, and realizes the cross
  • FIG. 1 is a schematic structural diagram of a streaming media playback server according to a specific embodiment of the present invention
  • FIG. 2 is a schematic structural diagram of another streaming media playback server in a specific embodiment of the present invention.
  • FIG. 3 is a schematic structural diagram of a client in a specific embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of another client in a specific embodiment of the present invention.
  • FIG. 5 is a flow chart showing a specific embodiment of a streaming media playback method according to the present invention.
  • FIG. 6 is a flow chart showing another embodiment of a streaming media playback method according to the present invention.
  • FIG. 7 shows a schematic structural diagram of a computer device suitable for use in a terminal device or server for implementing an embodiment of the present invention.
  • Online education is a method of content dissemination and rapid learning through the application of information technology and internet technology.
  • Internet technology remote real-time online teaching, real-time interaction between teachers and students, a good user experience makes online education an increasingly common form of education.
  • the system needs to save multiple files such as audio and video of the teacher and students, and the courseware of the class.
  • the audio and video of the teacher and the student are saved separately, and are saved according to the equipment of the teacher and the student.
  • the format of audio and video may not be uniform (for example, the video may be in FLV or MP4 format).
  • the audio and video and the courseware of the teacher and the student need to be sequentially loaded to the playback page, and the playback page is for multiple formats.
  • Most of the video files do not support the direct loading of video. It is necessary to rely on third-party software (such as FLASH) to load and play the teaching video.
  • third-party software such as FLASH
  • playing video with third-party software will cause the video to load slowly.
  • the third-party software The upgrade may be inconvenient for the user to use, and may also cause the video file to be unplayable.
  • CDN edge nodes are usually used to pull audio and video data, and the upgrade of the cache system such as CDN may also cause damage to audio and video files during transmission, resulting in inability to play audio and video.
  • the playback page needs to load multiple files such as audio and video and courseware and control the running of multiple files in the back end.
  • the processing logic is complicated when the user drags or jumps. The above various problems will cause the playback page to enter and drag. The moving speed is slow, the sensation is strong, and even the playback page is unavailable, and the user experience is poor.
  • a streaming media playback server can receive a streaming media playback command sent by the client 10, and query the related information of the streaming media file to be played back, and then return to the streaming media playback address, based on the client.
  • the page generation instruction of 10 returns the playback page data, so that the client 10 forms a playback page, and further searches the storage address of the streaming media file to return to the client 10, so that the client 10 acquires the streaming media file according to the storage address. Loaded to the playback page to show the user.
  • the streaming media playback server includes an information forwarding module 20, an application processing module 21, a plurality of service processing modules 22, and a database 23.
  • the database 23 stores related information and a storage address of the streaming media file.
  • the information forwarding module 20 can receive the streaming media playback instruction sent by the client 10 and transmit the streaming media playback instruction to the application processing module 21.
  • the information forwarding module 20 can use a four-layer load balancer to receive the streaming media playback command sent by the client 10 through the IP+ port, and transmit the streaming media playback instruction to the application processing module 21.
  • the client 10 can be a display terminal that can interact with a user, such as a desktop computer, a notebook, a smart phone, and a tablet.
  • the application processing module 21 may receive the streaming media playback instruction forwarded by the information forwarding module 20 to authenticate the legality of the streaming media playback instruction.
  • the streaming media playback instruction is legal
  • the streaming media playback instruction is output to the plurality of service processing modules 22, and when the streaming media playback instruction is illegal, it belongs to an illegal access, directly returns an error prompt, and the application processing module 21 can identify
  • the user of the client 10 is legal, only allows legitimate playback requests, prevents illegal requests, and protects user privacy.
  • the application processing module 21 can select a seven-layer load balancer, and the seven-layer load balancer includes an application programming interface (API) to authenticate whether the streaming media playback instruction is legal.
  • API application programming interface
  • the plurality of service processing modules 22 may receive the legal streaming media playback instruction, and search the database 23 for related information of the streaming media file requested to be played back.
  • search the database 23 for related information of the streaming media file requested to be played back.
  • return The streaming media plays back the address, so that the client 10 forms a playback page, further extracts the storage address of the corresponding streaming media file from the database 23 and returns it to the client 10, so that the client 10 obtains the streaming media file and loads it into the office.
  • the playback page may receive the legal streaming media playback instruction, and search the database 23 for related information of the streaming media file requested to be played back.
  • the plurality of service processing modules 22 after receiving the streaming media playback instruction, the plurality of service processing modules 22 first query the database 23 for the presence of the requested streaming media file, and if so, return a streaming media playback address; the client 10, based on the received streaming media playback address, sending a page generation instruction to the application processing module 21, and the application processing module 21 generates playback page data based on the page generation instruction, so that the client 10 forms a playback page to display to the user.
  • the storage address of the streaming media file is obtained in the database 23, so that the client 10 further obtains the streaming media file according to the storage address of the streaming media file, and loads the streaming media file to the playback page. Show and provide interactive features to users.
  • the streaming media file can be obtained from a data storage server such as a cloud storage space or a CDN edge node 40.
  • the application processing module 21 receives the page generation instruction of the client 10, generates HTML5 page data and sends it back to the client 10 to form an HTML5 page, and the HTML5 page can support loading of the streaming media file in a format such as MP4. Can reduce dependence on third-party software.
  • the application processing module 21 is further configured to periodically send a status query instruction to each of the service processing modules 22, and each of the service processing modules 22 processes the status query command and respectively processes the status query instruction.
  • the module 21 sends back a reply command, and if one of the service processing modules 22 does not send back the reply command or sends back an error command within a specified time, it is determined that the service processing module 22 is faulty, and the application processing module 21 stops The failed service processing module 22 issues the streaming media playback request. Therefore, when one or more of the clusters of the service processing module 22 fails, the system can automatically detect the faulty service processing module 22, and no longer send a playback request to the faulty service processing module 22 to ensure normal operation of the system.
  • the cluster of the service processing module 22 including the plurality of service processing modules 22 can implement dynamic capacity expansion, and the application processing module 21 can be disconnected from one or more of the clusters of the service processing modules 22, so that the faulty service processing module 22
  • the service processing module 22 is automatically degraded from the cluster, and the application processing module 21 can also dynamically access more service processing modules 22 to ensure the number of service processing modules 22 in the cluster and improve system processing. performance.
  • the streaming media file includes an audio and video file
  • the plurality of service processing modules 22 query the database 23 for the sound of the audio and video file based on the audio and video file request sent by the client 10.
  • the video storage address returns the audio and video storage address to the client 10, so that the client 10 searches for the corresponding CDN edge node 40 according to the streaming media file storage address, and acquires the audio and video file from the CDN edge node 40.
  • File data In this embodiment, by synchronizing the audio and video files on the cloud storage server 30 through the CDN edge node 40, the time for acquiring the audio and video files can be shorter, and the loading speed of the playback page is improved.
  • the streaming media file may further include a signaling file, and the plurality of service processing modules 22 query the signaling file in the cloud storage server 30 based on the signaling file request sent by the client 10.
  • the data file and the file data of the signaling file are returned to the client 10.
  • the signaling file of the embodiment includes the courseware used in the online course and the operation of the courseware by the teacher and the student.
  • the file size of the signaling file is small, and can be directly obtained from the cloud storage server 30, and in this embodiment, the audio and video
  • the file and signaling files are respectively obtained from the CDN edge node 40 and the cloud storage server 30, and simultaneous acquisition of multiple files is realized, which further speeds up the opening and loading speed of the playback page.
  • the streaming media file is divided into two parts: audio and video files and signaling files.
  • audio and video files and signaling files can be loaded simultaneously, front-end signaling files are displayed, and back-end control audio and video files are played. Both parts are static. Accelerated, and the audio and video files are unified into a file format that can be directly loaded by the playback page.
  • the selected audio and video frames can be quickly located, thereby implementing simple logic processing of the playback page and seconds. Open, second drag effect, and can be cross-platform compatible and used.
  • the control of the streaming media file in the playback page is preferably implemented by a JAVASCRIPT script.
  • the plurality of service processing modules 22 after receiving the signaling file request sent by the client 10, the plurality of service processing modules 22 first query the database 23 for the course type of the streaming media file requested for playback, according to the course.
  • the type queries the data file of the signaling file in the cloud storage server 30 and acquires the file data of the signaling file corresponding to the course type on the cloud storage server 30.
  • the layout of the playback page is further adjusted according to the course type by acquiring the course type to load the audio and video files and the signaling file.
  • the course type may be a one-to-one lecture, a one-to-many lecture, or a many-to-one lecture, and the like, and the present invention is not limited thereto.
  • the streaming media playback server further transcodes the original media file transmitted by the client 10 to obtain the streaming media file.
  • the streaming media playback server can first transcode the streaming media files to form a streaming media file to unify the streaming media file format, integrate audio and video files, and integrate the audio and video files of the teacher or student into one file without logical control of the page.
  • the streaming media playback server in this embodiment can simultaneously implement transcoding and playback of streaming media files, implement centralized service processing, and simplify and normalize the entire process of streaming media playback, thereby reducing the functional requirements on the client. Realize the user's cross-platform, extremely fast and low-latency playback, greatly improving the user experience.
  • the streaming media playback server may further include a message queue module 24, a plurality of data cache modules 25, and a plurality of video transcoding modules 26.
  • the message queue module 24 can receive the media upload request of the client 10, and queue the received multiple media upload requests.
  • the plurality of service processing modules 22 are further configured to obtain and extract an original media file from the client 10 according to the streaming media upload request, parse and serialize the original media file to obtain a raw data file.
  • the plurality of service processing modules 22 may respectively extract the media upload request from the message queue module 24, serialize the course related information of the online course and the original media files (audio and video files of the teacher and the student, and the signaling file). Get raw data files, such as raw data files that can form JSON statements for easy transfer.
  • the plurality of data caching modules 25 can receive and cache the original data files transmitted by the service processing module 22.
  • the plurality of data cache modules 25 provide a temporary storage space for the original data files formed after the serialization, and are sequentially allocated to different video transcoding modules 26 according to the processing capabilities of the plurality of video transcoding modules 26, thereby dynamically optimizing the streaming media. Transcoding process.
  • the plurality of video transcoding modules 26 may sequentially extract the original data file from the data cache module 25 and deserialize the original media file, and transcode the original media file to form the streaming media file.
  • the streaming media file is stored and the storage address of the streaming media file is returned to the plurality of service processing modules 22 to cause the service processing module 22 to store the storage address in the database 23.
  • the streaming media file includes an audiovisual file and a signaling file.
  • the plurality of video transcoding modules 26 store the streaming media file in the cloud storage server 30 and synchronize the audio and video files in the streaming media file to the CDN edge node 40, and the audio and video files in the CDN edge node 40
  • the storage address and the storage address of the signaling file in the cloud storage server 30 are transmitted to the service processing module 22, so that the service processing module 22 further stores the storage address of the audio and video file and the signaling file in the database 23.
  • the client 10 includes a playback request module 11, a page generation module 12, and a data loading module 13.
  • the playback requesting module 11 is configured to send a streaming media playback instruction to the streaming media playback server, so that the streaming media playback server queries the related information of the streaming media file to be played back and returns to the streaming media playback address.
  • the page generating module 12 is configured to send a page generation instruction to the streaming media playback server, so that the streaming media playback server returns the playback page data based on the page generation instruction of the client 10 to further form a playback page.
  • the page generation module may further send a page generation instruction to the streaming playback server to cause the streaming playback server to generate HTML5 page data and send it back to form an HTML5 page.
  • the data loading module 13 is configured to send a streaming media loading instruction to the streaming media playback server, so that the streaming media playback server searches for a storage address of the streaming media file and returns to further obtain the flow according to the storage address of the streaming media file.
  • the media file is loaded onto the playback page and presented to the user.
  • the streaming media file in the present invention can be directly loaded on the playback page.
  • the streaming media file directly loaded by the playback page can be obtained, so that the entire playback process is not subject to the third party.
  • the limitation of software upgrade realizes playback of streaming media files across terminals and anytime and anywhere, which simplifies the playback logic of the entire playback system, improves the loading speed of streaming media, and realizes interactive functions such as second opening and second dragging, thereby improving user experience.
  • the streaming media file includes an audio and video file
  • the data loading module may send an audio and video file request to the streaming media playback server, so that the streaming media playback server queries the audio and video file in the database.
  • the audio and video storage address returns the audio and video storage address;
  • the data loading module is configured to search to the corresponding CDN edge node according to the streaming media file storage address, and obtain synchronization from the cloud storage server from the CDN edge node. Audio and video files are loaded to the playback page.
  • the CDN edge node 40 synchronizes the audio and video files on the cloud storage server 30, so that the time for acquiring the audio and video files is shorter, and the loading speed of the playback page is improved.
  • the streaming media file may further include a signaling file
  • the data loading module may send a signaling file request to the streaming media playback server to cause the streaming media playback server to query the signaling in the database.
  • the storage address of the file is returned, and the data loading module is configured to acquire a signaling file in the cloud storage server according to the storage address of the signaling file and load the signaling file to the playback page.
  • the signaling file includes the courseware used in the online course and the operation of the courseware by the teacher and the student. Since the file size of the signaling file is small, the file can be directly obtained from the cloud storage server 30, the audio and video file and The signaling files are respectively obtained from the CDN edge node 40 and the cloud storage server 30, and the simultaneous acquisition of multiple files is realized, which further speeds up the opening and loading speed of the playback page.
  • the streaming media file is divided into two parts: audio and video files and signaling files. When implemented, audio and video files and signaling files can be loaded simultaneously, front-end signaling files are displayed, and back-end control audio and video files are played. Both parts are static.
  • the audio and video files are unified into a file format that can be directly loaded by the playback page.
  • the selected audio and video frames can be quickly located, thereby implementing simple logic processing of the playback page and seconds.
  • the control of the streaming media file in the playback page is preferably implemented by a JAVASCRIPT script.
  • the data loading module when acquiring the storage address of the streaming media file, sends a signaling file request to the streaming media playback server, so that the streaming media playback server queries the database for streaming media requesting playback.
  • the course type of the file, and the storage address of the signaling file in the database is obtained according to the course type.
  • the layout of the playback page is further adjusted according to the course type by acquiring the course type to load the audio and video files and the signaling file.
  • the course type may be a one-to-one lecture, a one-to-many lecture, or a many-to-one lecture, and the like, and the present invention is not limited thereto.
  • the client may also include a transcoding request module 14.
  • the transcoding request module 14 is configured to send a streaming media upload request to the streaming media playback server, so that the message queue module 24 of the streaming media server receives the streaming media upload request, and the multiple service processing modules 22 acquire and according to the streaming
  • the media upload request extracts the original media file from the client, parses and serializes the original media file to obtain a raw data file, and the plurality of data cache modules 25 receive and cache the original data file transmitted by the service processing module 22.
  • the plurality of video transcoding modules 26 sequentially extract the original data file from the data cache module 25 and deserialize the original media file, transcode the original media file to form the streaming media file, and store the original
  • the streaming media file is returned to the storage address of the streaming media file to the plurality of service processing modules 22, so that the service processing module 22 stores the storage address in the database 23.
  • a method for implementing streaming media playback using the streaming media playback server comprising:
  • the storage address of the streaming media file is stored in the database 23, and the streaming media playback command sent by the client is received by the information forwarding module 20, and the streaming media playback command is received by the application processing module 21 to authenticate the streaming media playback command. Legitimate, outputting a legal streaming playback command, receiving the legal streaming playback command through the plurality of service processing modules 22, and searching the database 23 for the related information of the streaming media file requested for playback, when the database 23 exists When the related information of the streaming media file is used, the application processing module 21 returns the playback page data based on the page generation instruction of the client, so that the client forms a playback page, and further extracts the storage address of the corresponding streaming media file from the database 23. And returning to the client, so that the client obtains the streaming media file and loads it to the playback page.
  • the application processing module 21 periodically sends a status query instruction to each of the service processing modules 22; after receiving the status query instruction, each of the service processing modules 22 respectively processes the application processing module. 21 sends back a reply command; if one of the service processing modules 22 does not send back the reply command or sends back an error command within a specified time, it is determined that the service processing module 22 is faulty, and the application processing module 21 stops the fault.
  • the service processing module 22 issues the streaming media playback request.
  • the application processing module 21 can receive the page generation instruction of the client, generate HTML5 page data and send it back to the client to form an HTML5 playback page on the client.
  • the streaming media file may include an audio and video file
  • the plurality of service processing modules 22 may be queried in the database 23 for the audio and video file based on the audio and video file request sent by the client. And storing the address and returning the storage address of the audio and video file to the client, so that the client obtains the audio and video file synchronized from the cloud storage server 30 from the corresponding CDN edge node 40 according to the storage address of the audio and video file. Loaded to the playback page.
  • the streaming media file may further include a signaling file
  • the plurality of service processing modules 22 may be configured to query the signaling file in the database 23 based on the signaling file request sent by the client.
  • the storage address returns the storage address of the signaling file to the client, so that the client acquires the signaling file in the cloud storage server 30 and loads the signaling file to the playback page.
  • the plurality of service processing modules 22 may further be queried in the database 23 for the streaming media file requesting playback based on the signaling file request sent by the client.
  • the course type, and the storage address of the signaling file in the database 23 is obtained according to the course type.
  • the types of courses are one-to-one, one-to-many or many-to-one.
  • the method may further include the step of transcoding the original media file transmitted by the client to obtain the streaming media file.
  • the method of transcoding the original media file to obtain the streaming media file may include receiving, by the message queue module 24, a media upload request of the client; acquiring, by the plurality of service processing modules 22, and according to the stream
  • the media upload request extracts the original media file from the client, parses and serializes the original media file to obtain the original data file, and receives and caches the original data file transmitted by the service processing module 22 through the plurality of data cache modules 25;
  • the original data file is sequentially extracted from the data buffer module 25 by the plurality of video transcoding modules 26 and deserialized to obtain the original media file, and the original media file is transcoded to form the streaming media file, and the storage device
  • the streaming media file is returned to the storage address of the streaming media file to the plurality of service processing modules 22, so that the service processing module 22 stores the storage address in the database 23.
  • the streaming media file may include an audiovisual file and a signaling file.
  • the streaming media file is stored in the cloud storage server 30 by the plurality of video transcoding modules 26, and the audio and video files in the streaming media file are synchronized to the CDN edge node 40, and the audio and video files in the CDN edge node 40 are
  • the storage address and the storage address of the signaling file in the cloud storage server 30 are transmitted to the service processing module 22, so that the service processing module 22 further stores the storage addresses of the audio and video files and the signaling file in the database 23.
  • a method of implementing streaming media playback based on the client is also disclosed.
  • the method includes: sending, by the playback request module 11, a streaming media playback instruction to the streaming media playback server, so that the streaming media playback server queries the related information of the streaming media file to be played back and returns to the streaming media playback address;
  • the streaming media playback server sends a page generation instruction, so that the streaming media playback server returns the playback page data based on the page generation instruction of the client, further forms a playback page; and sends a streaming media loading instruction to the streaming media playback server through the data loading module 13 to And causing the streaming media playback server to search for the storage address of the streaming media file and returning to further obtain the streaming media file to be loaded into the playback page according to the storage address of the streaming media file, and display the content to the user.
  • the page generation module 12 may send a page generation instruction to the streaming media playback method to cause the streaming media playback method to generate HTML5 page data and send it back to form an HTML5 page.
  • the streaming media file may include an audio and video file
  • the audio and video file request may be sent to the streaming media playback server by the data loading module 13 to cause the streaming media playback server to query the database 23 for the The audio and video storage address of the audio and video file is returned and the audio and video storage address is returned.
  • the data loading module 13 further searches for the corresponding CDN edge node 40 according to the streaming media file storage address, and acquires the audio and video file synchronized from the cloud storage server 30 from the CDN edge node 40 and loads it into the office. The playback page.
  • the streaming media file may further include a signaling file
  • the signaling file request may be sent to the streaming media playback method by the data loading module 13 to enable streaming media playback.
  • the server queries the storage address of the signaling file in the database 23 and returns the storage address of the signaling file; the data loading module 13 acquires the signaling file in the cloud storage server 30 according to the storage address of the signaling file and The signaling file is loaded to the playback page, and the signaling file request is further sent by the data loading module 13 to the streaming media playback method, so that the streaming media playback server queries the database 23 for the streaming media file requested for playback.
  • the course type, and the storage address of the signaling file in the database 23 is obtained according to the course type. Among them, the types of courses are one-to-one lectures, one-to-many lectures, or many-to-one lectures, and the like.
  • the streaming request module 14 can also send a streaming upload request to the streaming media playback server, so that the message queue module 24 of the streaming media server receives the streaming media upload request, and the multiple service processing modules 22 Acquiring and extracting the original media file from the streaming media playback method according to the streaming media uploading request, parsing and serializing the original media file to obtain a raw data file, and the plurality of data caching modules 25 receive and cache the service processing module.
  • the original data file transmitted; the plurality of video transcoding modules 26 sequentially extract the original data file from the data cache module 25 and deserialize the original media file, and transcode the original media file to form
  • the streaming media file stores the streaming media file and returns a storage address of the streaming media file to the plurality of service processing modules 22, so that the service processing module 22 stores the storage address in the database 23.
  • some embodiments of the present invention provide a computer device including a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the program as described above The method executed by the client, or the method executed by the server as described above when the processor executes the program.
  • FIG. 7 a block diagram of a computer device 700 suitable for use in implementing a terminal device or server of an embodiment of the present application is shown.
  • computer device 700 includes a central processing unit (CPU) 701 that can be loaded into a program in random access memory (RAM) 703 according to a program stored in read only memory (ROM) 702 or from storage portion 708. And perform all kinds of proper work and processing.
  • RAM random access memory
  • ROM read only memory
  • RAM 703 various programs and data required for the operation of the system 700 are also stored.
  • the CPU 701, the ROM 702, and the RAM 703 are connected to each other through a bus 704.
  • An input/output (I/O) interface 705 is also coupled to bus 704.
  • the following components are connected to the I/O interface 705: an input portion 706 including a keyboard, a mouse, etc.; an output portion 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), and the like, and a speaker; a storage portion 708 including a hard disk or the like And a communication portion 709 including a network interface card such as a LAN card, a modem, or the like.
  • the communication section 709 performs communication processing via a network such as the Internet.
  • Driver 710 is also coupled to I/O interface 706 as needed.
  • a removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory or the like, is mounted on the drive 710 as needed so that a computer program read therefrom is installed as the storage portion 708 as needed.
  • an embodiment of the invention includes a computer program product comprising a computer program tangibly embodied on a machine readable medium, the computer program comprising program code for executing the method illustrated in the flowchart.
  • the computer program can be downloaded and installed from the network via communication portion 709, and/or installed from removable media 711.
  • each block of the flowchart or block diagrams can represent a module, a program segment, or a portion of code that includes one or more logic for implementing the specified.
  • Functional executable instructions can also be noted that in some alternative implementations, the functions noted in the blocks may also be transmitted in a different order than that illustrated in the drawings. For example, two successively represented blocks may in fact be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functionality involved.
  • each block of the block diagrams and/or flowcharts, and combinations of blocks in the block diagrams and/or flowcharts can be implemented in a dedicated hardware-based system that performs the specified function or operation. Or it can be implemented by a combination of dedicated hardware and computer instructions.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

Disclosed in the present invention is a streaming media playback method, comprising: receiving, by means of an information forwarding module, streaming media playback instructions sent by a client; receiving, by means of an application processing module, the streaming media playback instructions, authenticating the validities of the streaming media playback instructions, and outputting valid streaming media playback instructions; receiving the valid streaming media playback instructions by means of a plurality of service processing modules, searching a database for relevant information of streaming media files requested to be played back, returning streaming media playback address when the relevant information of the streaming media files exists in the database, so that the client forms playback pages, further extracting from the database the storage address of the corresponding streaming media files, and returning same to the client, so that the client acquires the streaming media files and loads same to the playback pages. The present invention reduces the logical complexity of playback of a plurality of streaming media files, reduces the lag and errors of the playback pages, and improves the response speed and interaction experience of the streaming media playback pages.

Description

一种流媒体回放方法、服务器、客户端及计算机设备Streaming media playback method, server, client and computer device
本申请要求了2018年4月9日提交的、申请号为201810312559.6、发明名称为“一种流媒体回放方法、计算机设备及可读介质”以及2018年4月9日提交的、申请号为201810311833.8、发明名称为“一种流媒体回放服务器、客户端”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the application number of 201101812559.6, the invention name is "a streaming media playback method, computer equipment and readable medium" submitted on April 9, 2018, and submitted on April 9, 2018, the application number is 201810311833.8 The title of the invention is the priority of the Chinese patent application entitled "A Streaming Media Playback Server, Client", the entire contents of which are incorporated herein by reference.
技术领域Technical field
本发明涉及在线教育领域,更具体地,涉及一种流媒体回放方法、服务器、客户端及计算机设备。The present invention relates to the field of online education, and more particularly to a streaming media playback method, a server, a client, and a computer device.
背景技术Background technique
近年来,随着在线教育行业的兴起,老师和学生的远距离网络教学成为趋势,为了便于家长及在线教育机构对网络教学的课程情况进行监督和评价,通常会保存网络教学的视频等媒体文件并向家长或在线教育机构相关部门提供回放功能,使家长可以随时随地观看老师和学生的上课情况。In recent years, with the rise of the online education industry, long-distance network teaching by teachers and students has become a trend. In order to facilitate parents and online educational institutions to supervise and evaluate the course of online teaching, media files such as videos for online teaching are usually saved. And provide playback functions to parents or relevant departments of online education institutions, so that parents can watch the teacher and students' classes at any time and any place.
然而,目前的课程回放页面分别保存老师和学生上课的课件以及多个音、视频文件,在回放时,回放页面需同时加载多个文件,且多个文件间的逻辑关系复杂,易导致回放页面进入和拖动速度慢、音画不同步和拖动卡顿感较强,播放的时候对于瞬间的带宽要求高,且回放页面对于老师和学生的音、视频的加载需要依赖于FLASH和内容分发网络(Content Delivery Network,CDN)等第三方软件的解码和传输,第三方软件的升级易产生不兼容问题,导致回放页面无法播放。However, the current course playback page saves the courseware for teachers and students, as well as multiple audio and video files. During playback, the playback page needs to load multiple files at the same time, and the logical relationship between multiple files is complicated, which easily leads to playback of the page. The speed of entering and dragging is slow, the sound and picture are not synchronized, and the dragging feeling is strong. When playing, the bandwidth requirement is high, and the playback page needs to rely on FLASH and content distribution for the audio and video loading of teachers and students. The decoding and transmission of third-party software such as the Content Delivery Network (CDN), the upgrade of the third-party software is prone to incompatibility problems, and the playback page cannot be played.
发明内容Summary of the invention
为了解决以上问题至少之一,本发明的一个目的在于提供一种流媒体回放方法,将请求回放的流媒体文件直接加载至回放页面,简化了整个回放***的回放逻辑,降低了对第三方软件的依赖,优化了回放页面的流媒体加载过程,提高了用户体验。本发明的另一个目的在于提供一种计算机设备。本发明的再一个目的在于提供一种可读介质。In order to solve at least one of the above problems, an object of the present invention is to provide a streaming media playback method, which directly loads a streaming media file requesting playback into a playback page, which simplifies playback logic of the entire playback system and reduces third-party software. The dependency optimizes the streaming loading process of the playback page and improves the user experience. Another object of the present invention is to provide a computer device. It is still another object of the present invention to provide a readable medium.
为达到上述目的,本发明采用下述技术方案:In order to achieve the above object, the present invention adopts the following technical solutions:
本发明实施例在第一方面公开了一种流媒体回放方法,应用于流媒体回放服务器,所述流媒体回放服务器包括信息转发模块、应用处理模块和多个业务处理模块,所述方法包括:The embodiment of the present invention discloses a streaming media playback method, which is applied to a streaming media playback server, where the streaming media playback server includes an information forwarding module, an application processing module, and a plurality of service processing modules, and the method includes:
通过信息转发模块接收客户端发送的流媒体回放指令并将所述流媒体回放指令发送至应用处理模块;Receiving, by the information forwarding module, a streaming media playback instruction sent by the client, and sending the streaming media playback instruction to the application processing module;
通过应用处理模块鉴权所述流媒体回放指令的合法性,输出合法的流媒体回放指令;And authenticating the legality of the streaming media playback instruction by using an application processing module, and outputting a legal streaming media playback instruction;
通过多个业务处理模块接收所述合法的流媒体回放指令,在数据库中查找请求回放的流媒体文件的相关信息;Receiving, by the plurality of service processing modules, the legal streaming media playback instruction, and searching, in the database, related information of the streaming media file requested to be played back;
响应于数据库中存在所述流媒体文件的相关信息,向所述客户端发送流媒体回放地址,以使所述客户端形成回放页面;Sending a streaming media playback address to the client in response to the presence of the related information of the streaming media file in the database, so that the client forms a playback page;
从所述数据库中提取对应的流媒体文件的存储地址并发送给客户端,以使客户端获取流媒体文件并加载至所述回放页面。Extracting a storage address of the corresponding streaming media file from the database and transmitting the storage address to the client, so that the client obtains the streaming media file and loads the playback media page.
优选地,所述方法进一步包括:Preferably, the method further comprises:
通过应用处理模块接收所述客户端根据所述流媒体回放地址发出的页面生成指令;Receiving, by the application processing module, a page generation instruction sent by the client according to the streaming media playback address;
根据所述页面生成指令生成回放页面数据并将所述回放页面数据发送给所述客户端,以使所述客户端生成回放页面。Generating playback page data according to the page generation instruction and transmitting the playback page data to the client, so that the client generates a playback page.
优选地,根据所述页面生成指令生成回放页面数据并将所述回放页面数据发送给所述客户端,以使所述客户端生成回放页面包括:Preferably, generating the playback page data according to the page generation instruction and sending the playback page data to the client, so that the client generates the playback page includes:
根据所述页面生成指令生成HTML5页面数据并将所述HTML5页面数据发送给所述客户端,以在客户端形成HTML5回放页面。Generating HTML5 page data according to the page generation instruction and transmitting the HTML5 page data to the client to form an HTML5 playback page on the client.
优选地,所述方法进一步包括:Preferably, the method further comprises:
通过所述应用处理模块定时向每个业务处理模块发送状态查询指令;Sending a status query instruction to each service processing module periodically by the application processing module;
每个业务处理模块根据接收的所述状态查询指令向所述应用处理模块发回一个回复指令;Each service processing module sends a reply instruction to the application processing module according to the received status query instruction;
响应于所述业务处理模块未在指定时间内发回所述回复指令或发回错误指令,所述应用处理模块停止向该处理模块发送所述流媒体回放请求。In response to the service processing module not sending back the reply command or sending back an error command within a specified time, the application processing module stops transmitting the streaming media playback request to the processing module.
优选地,所述流媒体文件包括音视频文件,从所述数据库中提取对应的流媒体文件的存储地址并发送给客户端,以使客户端获取流媒体文件并加载至所述回放页面包 括:Preferably, the streaming media file includes an audio and video file, and the storage address of the corresponding streaming media file is extracted from the database and sent to the client, so that the client obtains the streaming media file and loads the playback page to the playback page, including:
所述多个业务处理模块基于客户端发送的音视频文件请求,在数据库中查询所述音视频文件的存储地址并将该音视频文件的存储地址发送给客户端,以使客户端根据所述音视频文件的存储地址从对应的CDN边缘节点中获取自云存储服务器同步的所述音视频文件并加载至所述回放页面。The plurality of service processing modules query the storage address of the audio and video file in the database and send the storage address of the audio and video file to the client based on the audio and video file request sent by the client, so that the client The storage address of the audio and video file is obtained from the corresponding CDN edge node and the audio and video files synchronized from the cloud storage server are loaded and loaded to the playback page.
优选地,所述流媒体文件包括信令文件,从所述数据库中提取对应的流媒体文件的存储地址并发送给客户端,以使客户端获取流媒体文件并加载至所述回放页面包括:Preferably, the streaming media file includes a signaling file, and the storage address of the corresponding streaming media file is extracted from the database and sent to the client, so that the client obtains the streaming media file and loads the playback page to the playback page, including:
所述多个业务处理模块基于客户端发送的信令文件请求,在数据库中查询所述信令文件的存储地址并将该信令文件的存储地址发送给客户端,以使客户端获取云存储服务器中的信令文件并将该信令文件加载至所述回放页面。The multiple service processing modules query the storage address of the signaling file in the database and send the storage address of the signaling file to the client based on the signaling file request sent by the client, so that the client obtains the cloud storage. A signaling file in the server and loading the signaling file to the playback page.
优选地,所述多个业务处理模块基于客户端发送的信令文件请求,在数据库中查询所述信令文件的存储地址包括:Preferably, the multiple service processing modules query the storage address of the signaling file in the database based on the signaling file request sent by the client, including:
所述多个业务处理模块基于客户端发送的信令文件请求,在所述数据库中查询请求回放的信令文件的课程类型,并根据所述课程类型获取所述数据库中所述信令文件的存储地址。And the plurality of service processing modules query, according to the signaling file request sent by the client, the course type of the signaling file requested to be played back in the database, and acquire the signaling file in the database according to the course type. Storage address.
优选地,所述课程类型为一对一授课、一对多授课或多对一授课。Preferably, the course type is one-on-one, one-to-many or many-to-one.
优选地,所述方法进一步包括:Preferably, the method further comprises:
对客户端传输的原始媒体文件进行转码以获取所述流媒体文件。Transcoding the original media file transmitted by the client to obtain the streaming media file.
优选地,所述流媒体回放服务器还包括消息队列模块、多个数据缓存模块和多个视频转码模块;Preferably, the streaming media playback server further includes a message queue module, a plurality of data cache modules, and a plurality of video transcoding modules;
对客户端传输的原始媒体文件进行转码以获取所述流媒体文件包括:Transcoding the original media file transmitted by the client to obtain the streaming media file includes:
通过消息队列模块接收客户端的流媒体上传请求;Receiving a streaming media upload request of the client through the message queue module;
通过所述多个业务处理模块获取所述流媒体上传请求,并根据所述流媒体上传请求从客户端中提取原始媒体文件,解析并序列化所述原始媒体文件得到原始数据文件;Acquiring, by the plurality of service processing modules, the streaming media upload request, and extracting an original media file from the client according to the streaming media upload request, parsing and serializing the original media file to obtain a raw data file;
通过多个数据缓存模块接收并缓存所述业务处理模块传输的所述原始数据文件;Receiving and buffering, by the plurality of data cache modules, the original data file transmitted by the service processing module;
通过多个视频转码模块从所述数据缓存模块依次提取所述原始数据文件并反序列化得到所述原始媒体文件,将所述原始媒体文件转码形成所述流媒体文件,存储所述流媒体文件并返回所述流媒体文件的存储地址至所述多个业务处理模块,以使业务处理模块将所述存储地址存储于数据库中。Extracting the original data file from the data cache module by a plurality of video transcoding modules and deserializing the original media file, transcoding the original media file to form the streaming media file, and storing the stream And returning the storage address of the streaming media file to the plurality of service processing modules, so that the service processing module stores the storage address in a database.
优选地,所述流媒体文件包括音视频文件和信令文件,存储所述流媒体文件并 返回所述流媒体文件的存储地址至所述多个业务处理模块,以使业务处理模块将所述存储地址存储于数据库中包括:Preferably, the streaming media file includes an audio and video file and a signaling file, and the streaming media file is stored and the storage address of the streaming media file is returned to the plurality of service processing modules, so that the service processing module The storage address is stored in the database and includes:
通过所述多个视频转码模块将所述流媒体文件存储于云存储服务器并将流媒体文件中的音视频文件同步至CDN边缘节点上,将CDN边缘节点中的音视频文件的存储地址以及云存储服务器中的信令文件的存储地址传输至业务处理模块,以使业务处理模块进一步将音视频文件和信令文件的存储地址存储于数据库中。The streaming media file is stored in the cloud storage server by the plurality of video transcoding modules, and the audio and video files in the streaming media file are synchronized to the CDN edge node, and the storage address of the audio and video files in the CDN edge node is The storage address of the signaling file in the cloud storage server is transmitted to the service processing module, so that the service processing module further stores the storage address of the audio and video file and the signaling file in the database.
本发明实施例在第二方面公开了一种流媒体回放方法,包括Embodiments of the present invention disclose, in a second aspect, a streaming media playback method, including
向流媒体回放服务器发送流媒体回放指令,以获取流媒体回放地址;Sending a streaming media playback instruction to the streaming media playback server to obtain a streaming media playback address;
向流媒体回放服务器发送页面生成指令,以获取回放页面数据,以进一步形成回放页面;Sending a page generation instruction to the streaming media playback server to obtain playback page data to further form a playback page;
向流媒体回放服务器发送流媒体加载指令,以获取流媒体文件的存储地址,以进一步根据所述流媒体文件的存储地址获取所述流媒体文件加载至所述回放页面。Sending a streaming media load instruction to the streaming media playback server to obtain a storage address of the streaming media file, to further acquire the streaming media file to be loaded into the playback page according to the storage address of the streaming media file.
优选地,向流媒体回放服务器发送页面生成指令,以获取回放页面数据,以进一步形成回放页面包括:Preferably, sending a page generation instruction to the streaming media playback server to obtain playback page data to further form a playback page comprises:
向流媒体回放服务器发送页面生成指令,以获取流媒体回放服务器生成的HTML5页面数据,以进一步形成HTML5页面。Sending a page generation instruction to the streaming media playback server to obtain HTML5 page data generated by the streaming media playback server to further form an HTML5 page.
优选地,所述流媒体文件包括音视频文件;Preferably, the streaming media file comprises an audio and video file;
向流媒体回放服务器发送流媒体加载指令,以获取流媒体文件的存储地址,以进一步根据所述流媒体文件的存储地址获取所述流媒体文件加载至所述回放页面包括:Sending a streaming media load instruction to the streaming media playback server to obtain a storage address of the streaming media file, to further obtain the streaming media file to be loaded into the playback page according to the storage address of the streaming media file, including:
向流媒体回放服务器发送音视频文件请求,以获取流媒体回放服务器在数据库中查询的所述音视频文件的音视频存储地址;Sending an audio and video file request to the streaming media playback server to obtain an audio and video storage address of the audio and video file queried by the streaming media playback server in the database;
根据所述音视频存储地址查找至对应的CDN边缘节点,并从所述CDN边缘节点中获取自云存储服务器同步的音视频文件并加载至所述回放页面。And searching for the corresponding CDN edge node according to the audio and video storage address, and acquiring an audio and video file synchronized from the cloud storage server from the CDN edge node and loading to the playback page.
优选地,所述流媒体文件包括信令文件;Preferably, the streaming media file includes a signaling file;
向流媒体回放服务器发送流媒体加载指令,以获取流媒体文件的存储地址,以进一步根据所述流媒体文件的存储地址获取所述流媒体文件加载至所述回放页面包括:Sending a streaming media load instruction to the streaming media playback server to obtain a storage address of the streaming media file, to further obtain the streaming media file to be loaded into the playback page according to the storage address of the streaming media file, including:
向流媒体回放服务器发送信令文件请求,以获取流媒体回放服务器在数据库中查询的所述信令文件的存储地址;Sending a signaling file request to the streaming media playback server to obtain a storage address of the signaling file queried by the streaming media playback server in the database;
根据所述信令文件的存储地址获取云存储服务器中的信令文件并将该信令文件加载至所述回放页面。Acquiring a signaling file in the cloud storage server according to the storage address of the signaling file and loading the signaling file to the playback page.
优选地,向流媒体回放服务器发送信令文件请求,以获取流媒体回放服务器在数据库中查询的所述信令文件的存储地址包括:Preferably, the sending a signaling file request to the streaming media playback server to obtain the storage address of the signaling file that is queried by the streaming media playback server in the database includes:
向流媒体回放服务器发送信令文件请求,以使流媒体回放服务器在所述数据库中查询请求回放的流媒体文件的课程类型,并根据所述课程类型获取所述数据库中所述信令文件的存储地址。Sending a signaling file request to the streaming media playback server, so that the streaming media playback server queries the database for the course type of the streaming media file requested for playback, and acquires the signaling file in the database according to the course type. Storage address.
优选地,所述课程类型为一对一授课、一对多授课或多对一授课。Preferably, the course type is one-on-one, one-to-many or many-to-one.
优选地,所述方法进一步包括:Preferably, the method further comprises:
向流媒体回放服务器发送流媒体上传请求;Sending a streaming media upload request to the streaming media playback server;
向所述流媒体回放服务器发送原始媒体文件。The original media file is sent to the streaming playback server.
本发明实施例在第三方面公开了一种流媒体回放服务器,包括Embodiments of the present invention disclose, in a third aspect, a streaming media playback server, including
数据库,存储有流媒体文件的相关信息和存储地址;a database storing related information and a storage address of the streaming media file;
信息转发模块,用于接收客户端发送的流媒体回放指令并将所述流媒体回放指令转发至应用处理模块;An information forwarding module, configured to receive a streaming media playback command sent by the client, and forward the streaming media playback instruction to the application processing module;
应用处理模块,用于鉴权所述流媒体回放指令的合法性,输出合法的流媒体回放指令;An application processing module, configured to authenticate the legality of the streaming media playback instruction, and output a legal streaming media playback instruction;
多个业务处理模块,用于接收所述合法的流媒体回放指令,在数据库中查找请求回放的流媒体文件的相关信息,并响应于数据库中存在所述流媒体文件的相关信息,向所述客户端发送流媒体回放地址,以使所述客户端形成回放页面;a plurality of service processing modules, configured to receive the legal streaming media playback instruction, search for related information of the streaming media file requested to be played back in the database, and respond to the related information of the streaming media file in the database, to the The client sends a streaming media playback address to cause the client to form a playback page;
所述多个业务处理模块进一步用于从所述数据库中提取对应的流媒体文件的存储地址并发送给所述客户端,以使所述客户端获取流媒体文件并加载至所述回放页面。The plurality of service processing modules are further configured to extract a storage address of the corresponding streaming media file from the database and send the storage address to the client, so that the client obtains the streaming media file and loads the playback media file.
优选地,所述应用处理模块进一步用于接收所述客户端根据所述流媒体回放地址发出的页面生成指令,生成回放页面数据并将所述回放页面数据发送给所述客户端,以使所述客户端生成回放页面。Preferably, the application processing module is further configured to receive a page generation instruction sent by the client according to the streaming media playback address, generate playback page data, and send the playback page data to the client, so that the The client generates a playback page.
优选地,所述应用处理模块进一步用于接收客户端的所述页面生成指令,生成HTML5页面数据并将所述HTML5页面数据发送给所述客户端,以使客户端形成HTML5回放页面。Preferably, the application processing module is further configured to receive the page generation instruction of the client, generate HTML5 page data, and send the HTML5 page data to the client, so that the client forms an HTML5 playback page.
优选地,所述应用处理模块进一步用于定时向每个业务处理模块发送状态查询指令;Preferably, the application processing module is further configured to periodically send a status query instruction to each service processing module;
每个业务处理模块用于根据接收的所述状态查询指令向所述应用处理模块发回一个回复指令;Each service processing module is configured to send a reply instruction to the application processing module according to the received status query instruction;
其中,所述应用处理模块进一步被配置为响应于所述业务处理模块未在指定时间内发回所述回复指令或发回错误指令,停止向该业务处理模块发送所述流媒体回放请求。The application processing module is further configured to stop sending the streaming media playback request to the service processing module in response to the service processing module not sending back the reply instruction or sending back an error instruction within a specified time.
优选地,所述流媒体文件包括音视频文件;Preferably, the streaming media file comprises an audio and video file;
所述多个业务处理模块用于基于客户端发送的音视频文件请求,在数据库中查询所述音视频文件的存储地址并将该音视频文件的存储地址发送给客户端,以使客户端根据所述音视频文件的存储地址从对应的CDN边缘节点中获取自云存储服务器同步的所述音视频文件并加载至所述回放页面。The plurality of service processing modules are configured to query, according to the audio and video file request sent by the client, the storage address of the audio and video file in a database, and send the storage address of the audio and video file to the client, so that the client The storage address of the audio and video file is obtained from the corresponding CDN edge node and the audio and video file synchronized from the cloud storage server is loaded and loaded to the playback page.
优选地,所述流媒体文件包括信令文件;Preferably, the streaming media file includes a signaling file;
所述多个业务处理模块用于基于客户端发送的信令文件请求,在数据库中查询所述信令文件的存储地址并将该信令文件的存储地址发送给客户端,以使客户端获取云存储服务器中的信令文件并将该信令文件加载至所述回放页面。The multiple service processing modules are configured to query, according to a signaling file request sent by the client, a storage address of the signaling file in a database, and send the storage address of the signaling file to the client, so that the client obtains A signaling file in the cloud storage server and loading the signaling file to the playback page.
优选地,所述多个业务处理模块用于基于客户端发送的信令文件请求,在所述数据库中查询请求回放的信令文件的课程类型,并根据所述课程类型获取所述数据库中所述信令文件的存储地址。Preferably, the plurality of service processing modules are configured to query, according to a signaling file request sent by the client, a course type of the signaling file requested to be played back in the database, and acquire the database in the database according to the course type. The storage address of the signaling file.
优选地,所述课程类型为一对一授课、一对多授课或多对一授课。Preferably, the course type is one-on-one, one-to-many or many-to-one.
优选地,所述服务器进一步用于对客户端传输的原始媒体文件进行转码得到所述流媒体文件。Preferably, the server is further configured to transcode the original media file transmitted by the client to obtain the streaming media file.
优选地,所述服务器进一步包括:Preferably, the server further comprises:
消息队列模块,用于接收客户端的流媒体上传请求;a message queue module, configured to receive a streaming media upload request of the client;
所述多个业务处理模块进一步用于获取所述流媒体上传请求,并根据所述流媒体上传请求从客户端中提取原始媒体文件,解析并序列化所述原始媒体文件得到原始数据文件;The plurality of service processing modules are further configured to obtain the streaming media upload request, and extract the original media file from the client according to the streaming media upload request, parse and serialize the original media file to obtain the original data file;
多个数据缓存模块,用于接收并缓存所述业务处理模块传输的所述原始数据文件;a plurality of data caching modules, configured to receive and cache the original data file transmitted by the service processing module;
多个视频转码模块,用于从所述数据缓存模块依次提取所述原始数据文件并反序列化得到所述原始媒体文件,将所述原始媒体文件转码形成所述流媒体文件,存储所述流媒体文件并返回所述流媒体文件的存储地址至所述多个业务处理模块,以使业务处理模块将所述存储地址存储于数据库中。a plurality of video transcoding modules, configured to sequentially extract the original data file from the data cache module and deserialize the original media file, and transcode the original media file to form the streaming media file, and store Deriving the media file and returning the storage address of the streaming media file to the plurality of service processing modules, so that the service processing module stores the storage address in a database.
优选地,所述流媒体文件包括音视频文件和信令文件;Preferably, the streaming media file includes an audio and video file and a signaling file;
所述多个视频转码模块用于将所述流媒体文件存储于云存储服务器并将流媒体文件中的音视频文件同步至CDN边缘节点上,将CDN边缘节点中的音视频文件的存储地址以及云存储服务器中的信令文件的存储地址传输至所述业务处理模块,以使所述业务处理模块进一步将音视频文件和信令文件的存储地址存储于数据库中。The plurality of video transcoding modules are configured to store the streaming media file in a cloud storage server and synchronize the audio and video files in the streaming media file to a CDN edge node, and store the audio and video files in the CDN edge node. And storing, by the service processing module, the storage address of the signaling file in the cloud storage server, so that the service processing module further stores the storage address of the audio and video file and the signaling file in a database.
本发明实施例在第四方面公开了一种客户端,包括An embodiment of the present invention discloses a client in a fourth aspect, including
回放请求模块,用于向流媒体回放服务器发送流媒体回放指令,以获取流媒体回放地址;a playback request module, configured to send a streaming media playback instruction to the streaming media playback server to obtain a streaming media playback address;
页面生成模块,用于向流媒体回放服务器发送页面生成指令,以获取回放页面数据,进一步形成回放页面;a page generating module, configured to send a page generating instruction to the streaming media playback server to obtain playback page data, further forming a playback page;
数据加载模块,用于向流媒体回放服务器发送流媒体加载指令,以获取流媒体文件的存储地址,以进一步根据所述流媒体文件的存储地址获取所述流媒体文件加载至所述回放页面。And a data loading module, configured to send a streaming media loading instruction to the streaming media playback server to obtain a storage address of the streaming media file, to further acquire the streaming media file to be loaded into the playback page according to the storage address of the streaming media file.
优选地,所述页面生成模块进一步用于向流媒体回放服务器发送页面生成指令,以获取流媒体回放服务器生成的HTML5页面数据并发回,以进一步形成HTML5页面。Preferably, the page generating module is further configured to send a page generation instruction to the streaming media playback server to acquire the HTML5 page data generated by the streaming media playback server and send back the data to further form an HTML5 page.
优选地,所述流媒体文件包括音视频文件;Preferably, the streaming media file comprises an audio and video file;
所述数据加载模块用于向流媒体回放服务器发送音视频文件请求,以获取流媒体回放服务器在数据库中查询的所述音视频文件的音视频存储地址;The data loading module is configured to send an audio and video file request to the streaming media playback server to obtain an audio and video storage address of the audio and video file queried by the streaming media playback server in the database;
所述数据加载模块用于根据所述音视频存储地址查找至对应的CDN边缘节点,并从所述CDN边缘节点中获取自云存储服务器同步的音视频文件并加载至所述回放页面。The data loading module is configured to search for a corresponding CDN edge node according to the audio and video storage address, and acquire an audio and video file synchronized from the cloud storage server from the CDN edge node and load the file into the playback page.
优选地,所述流媒体文件包括信令文件;Preferably, the streaming media file includes a signaling file;
所述数据加载模块用于向流媒体回放服务器发送信令文件请求,以获取流媒体回放服务器在数据库中查询的所述信令文件的存储地址;The data loading module is configured to send a signaling file request to the streaming media playback server to obtain a storage address of the signaling file that is queried by the streaming media playback server in the database;
所述数据加载模块用于根据信令文件的存储地址获取云存储服务器中的信令文件并将该信令文件加载至所述回放页面。The data loading module is configured to acquire a signaling file in the cloud storage server according to the storage address of the signaling file and load the signaling file to the playback page.
优选地,所述数据加载模块进一步用于向流媒体回放服务器发送信令文件请求,以使流媒体回放服务器在所述数据库中查询请求回放的流媒体文件的课程类型,并根据所述课程类型获取所述数据库中所述信令文件的存储地址。Preferably, the data loading module is further configured to send a signaling file request to the streaming media playback server, so that the streaming media playback server queries the database for the course type of the streaming media file requested for playback, and according to the course type Obtaining a storage address of the signaling file in the database.
优选地,所述课程类型为一对一授课、一对多授课或多对一授课。Preferably, the course type is one-on-one, one-to-many or many-to-one.
优选地,进一步包括:Preferably, the method further comprises:
转码请求模块,用于向流媒体回放服务器发送流媒体上传请求;a transcoding request module, configured to send a streaming media upload request to the streaming media playback server;
其中,转码请求模块进一步用于向所述流媒体回放服务器发送原始媒体文件。The transcoding request module is further configured to send the original media file to the streaming media playback server.
本发明的有益效果如下:The beneficial effects of the present invention are as follows:
本发明的流媒体回放方法通过流媒体文件存储地址获取流媒体文件,并将获取的流媒体文件直接加载至回放页面,从而通过回放页面向用户展示,不受第三方软件升级的限制,实现跨终端、随时随地的流媒体文件回放,简化了整个回放***的回放逻辑,流媒体加载速度快,实现秒开、秒拖等交互功能,提高用户体验效果。The streaming media playback method of the present invention acquires the streaming media file by using the streaming media file storage address, and directly loads the obtained streaming media file to the playback page, thereby displaying to the user through the playback page, which is not restricted by the third-party software upgrade, and realizes the cross The playback of the streaming media files of the terminal and anytime and anywhere simplifies the playback logic of the entire playback system, and the loading speed of the streaming media is fast, and the interactive functions such as second opening and second dragging are realized to improve the user experience.
附图说明DRAWINGS
下面结合附图对本发明的具体实施方式作进一步详细的说明。The specific embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
下面结合附图对本发明的具体实施方式作进一步详细的说明。The specific embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
图1示出本发明具体实施例中一种流媒体回放服务器的结构示意图;1 is a schematic structural diagram of a streaming media playback server according to a specific embodiment of the present invention;
图2示出本发明具体实施例中另一种流媒体回放服务器的结构示意图;2 is a schematic structural diagram of another streaming media playback server in a specific embodiment of the present invention;
图3示出本发明具体实施例中一种客户端的结构示意图;3 is a schematic structural diagram of a client in a specific embodiment of the present invention;
图4示出本发明具体实施例中另一种客户端的结构示意图;4 is a schematic structural diagram of another client in a specific embodiment of the present invention;
图5示出本发明一种流媒体回放方法一个具体实施例的流程图;FIG. 5 is a flow chart showing a specific embodiment of a streaming media playback method according to the present invention; FIG.
图6示出本发明一种流媒体回放方法另一个具体实施例的流程图;6 is a flow chart showing another embodiment of a streaming media playback method according to the present invention;
图7示出适用于用来实现本发明实施例的终端设备或服务器的计算机设备的结构示意图。FIG. 7 shows a schematic structural diagram of a computer device suitable for use in a terminal device or server for implementing an embodiment of the present invention.
具体实施方式detailed description
为了更清楚地说明本发明,下面结合优选实施例和附图对本发明做进一步的说明。附图中相似的部件以相同的附图标记进行表示。本领域技术人员应当理解,下面所具体描述的内容是说明性的而非限制性的,不应以此限制本发明的保护范围。In order to explain the present invention more clearly, the present invention will be further described in conjunction with the preferred embodiments and the accompanying drawings. Similar components in the drawings are denoted by the same reference numerals. It should be understood by those skilled in the art that the following detailed description is intended to be illustrative and not restrictive.
在线教育是通过应用信息科技和互联网技术进行内容传播和快速学习的方法。随着互联网技术的发展,远程实时的在线授课,老师与学生之间可以实时的互动,良好的用户体验使在线教育成为越来越普通的教育形式。Online education is a method of content dissemination and rapid learning through the application of information technology and internet technology. With the development of Internet technology, remote real-time online teaching, real-time interaction between teachers and students, a good user experience makes online education an increasingly common form of education.
为了便于用户及在线教育机构对在线授课的课程情况进行回顾和评价,通常会保存网络教学的相关视频和课件等文件并向用户或在线教育机构相关部门提供回放 功能,对于幼儿教育,也可使家长可以随时随地观看老师和学生的上课情况。In order to facilitate users and online educational institutions to review and evaluate the courses taught online, it usually saves relevant videos and courseware files for online teaching and provides playback functions to users or relevant departments of online educational institutions. Parents can watch the classes of teachers and students anytime, anywhere.
但是,目前的网络课程结束后,***需保存老师和学生的上课音频、视频和上课的课件等多个文件,老师和学生的音频和视频单独保存,且根据老师端和学生端的设备不同,保存的音视频的格式可能不统一(例如视频可以是FLV或MP4等格式),在向用户展示回放页面时,需要将老师和学生的音视频和课件依次加载至回放页面,回放页面对于多种格式的视频文件,大多不支持视频的直接加载,需要依赖于第三方软件(例如FLASH)加载播放教学视频,一方面,采用第三方软件播放视频会导致视频加载慢,另一方面,第三方软件的升级会对用户使用造成不便,也可能会导致视频文件无法播放。而对于音视频的获取,通常会采用CDN边缘节点拉取音视频数据,而CDN等缓存***的升级也可能导致音视频文件在传输过程中的损坏,导致音视频无法播放。此外,回放页面需要加载音视频以及课件等多个文件并后端控制多个文件的运行,在用户进行拖拽或跳转时处理逻辑复杂,以上的各种问题会导致回放页面出现进入和拖动速度慢、卡顿感较强,更甚至会导致回放页面的不可用,用户体验效果差。However, after the current online course is over, the system needs to save multiple files such as audio and video of the teacher and students, and the courseware of the class. The audio and video of the teacher and the student are saved separately, and are saved according to the equipment of the teacher and the student. The format of audio and video may not be uniform (for example, the video may be in FLV or MP4 format). When displaying the playback page to the user, the audio and video and the courseware of the teacher and the student need to be sequentially loaded to the playback page, and the playback page is for multiple formats. Most of the video files do not support the direct loading of video. It is necessary to rely on third-party software (such as FLASH) to load and play the teaching video. On the one hand, playing video with third-party software will cause the video to load slowly. On the other hand, the third-party software The upgrade may be inconvenient for the user to use, and may also cause the video file to be unplayable. For the acquisition of audio and video, CDN edge nodes are usually used to pull audio and video data, and the upgrade of the cache system such as CDN may also cause damage to audio and video files during transmission, resulting in inability to play audio and video. In addition, the playback page needs to load multiple files such as audio and video and courseware and control the running of multiple files in the back end. The processing logic is complicated when the user drags or jumps. The above various problems will cause the playback page to enter and drag. The moving speed is slow, the sensation is strong, and even the playback page is unavailable, and the user experience is poor.
如图1所示,公开了一种流媒体回放服务器,该服务器可接收客户端10发送的流媒体回放指令,查询到待回放的流媒体文件的相关信息后返回流媒体回放地址,基于客户端10的页面生成指令返回回放页面数据,以使客户端10形成回放页面,并进一步查找流媒体文件的存储地址返回客户端10,以使客户端10根据所述存储地址获取所述流媒体文件,加载至所述回放页面,向用户展示。As shown in FIG. 1 , a streaming media playback server is disclosed. The server can receive a streaming media playback command sent by the client 10, and query the related information of the streaming media file to be played back, and then return to the streaming media playback address, based on the client. The page generation instruction of 10 returns the playback page data, so that the client 10 forms a playback page, and further searches the storage address of the streaming media file to return to the client 10, so that the client 10 acquires the streaming media file according to the storage address. Loaded to the playback page to show the user.
所述流媒体回放服务器包括信息转发模块20、应用处理模块21、多个业务处理模块22以及数据库23。其中,数据库23中存储有流媒体文件的相关信息和存储地址。The streaming media playback server includes an information forwarding module 20, an application processing module 21, a plurality of service processing modules 22, and a database 23. The database 23 stores related information and a storage address of the streaming media file.
所述信息转发模块20可接收客户端10发送的流媒体回放指令并将该流媒体回放指令传输至应用处理模块21。优选地,所述信息转发模块20可选用四层负载均衡器,通过IP+端口可接收到客户端10发送的流媒体回放指令,并将所述流媒体回放指令传输至应用处理模块21。The information forwarding module 20 can receive the streaming media playback instruction sent by the client 10 and transmit the streaming media playback instruction to the application processing module 21. Preferably, the information forwarding module 20 can use a four-layer load balancer to receive the streaming media playback command sent by the client 10 through the IP+ port, and transmit the streaming media playback instruction to the application processing module 21.
其中,客户端10可以为例如台式电脑、笔记本、智能手机和平板电脑等可以与用户交互的显示终端。The client 10 can be a display terminal that can interact with a user, such as a desktop computer, a notebook, a smart phone, and a tablet.
所述应用处理模块21可接收所述信息转发模块20转发的所述流媒体回放指令,鉴权所述流媒体回放指令的合法性。当所述流媒体回放指令合法时,输出所述流媒体回放指令至多个业务处理模块22,当所述流媒体回放指令不合法时,属于非法访问, 直接返回错误提示,应用处理模块21可鉴别客户端10的用户合法性,只允许合法的回放请求,防止非法请求,并保护用户隐私。The application processing module 21 may receive the streaming media playback instruction forwarded by the information forwarding module 20 to authenticate the legality of the streaming media playback instruction. When the streaming media playback instruction is legal, the streaming media playback instruction is output to the plurality of service processing modules 22, and when the streaming media playback instruction is illegal, it belongs to an illegal access, directly returns an error prompt, and the application processing module 21 can identify The user of the client 10 is legal, only allows legitimate playback requests, prevents illegal requests, and protects user privacy.
优选地,所述应用处理模块21可选用七层负载均衡器,所述七层负载均衡器包括应用程序接口(Application Programming Interface,API),以鉴权所述流媒体回放指令是否合法。Preferably, the application processing module 21 can select a seven-layer load balancer, and the seven-layer load balancer includes an application programming interface (API) to authenticate whether the streaming media playback instruction is legal.
所述多个业务处理模块22可接收所述合法的流媒体回放指令,在数据库23中查找请求回放的流媒体文件的相关信息,当数据库23中存在所述流媒体文件的相关信息时,返回流媒体回放地址,以使客户端10形成回放页面,进一步从所述数据库23中提取对应的流媒体文件的存储地址并返回给客户端10,以使客户端10获取流媒体文件并加载至所述回放页面。The plurality of service processing modules 22 may receive the legal streaming media playback instruction, and search the database 23 for related information of the streaming media file requested to be played back. When the related information of the streaming media file exists in the database 23, return The streaming media plays back the address, so that the client 10 forms a playback page, further extracts the storage address of the corresponding streaming media file from the database 23 and returns it to the client 10, so that the client 10 obtains the streaming media file and loads it into the office. The playback page.
在一个优选实施例中,所述多个业务处理模块22接收到流媒体回放指令后,首先在数据库23中查询请求的流媒体文件是否存在,若存在,则返回一个流媒体回放地址;客户端10基于接收的所述流媒体回放地址向所述应用处理模块21发送页面生成指令,应用处理模块21基于所述页面生成指令,生成回放页面数据,以使客户端10形成回放页面向用户展示,同时基于客户端10的媒体加载指令,在数据库23中获取所述流媒体文件的存储地址,以使客户端10进一步根据流媒体文件的存储地址获取流媒体文件,并加载至所述回放页面,向用户展示并提供交互功能。优选地,可从云存储空间或CDN边缘节点40等数据存储服务器中获取所述流媒体文件。In a preferred embodiment, after receiving the streaming media playback instruction, the plurality of service processing modules 22 first query the database 23 for the presence of the requested streaming media file, and if so, return a streaming media playback address; the client 10, based on the received streaming media playback address, sending a page generation instruction to the application processing module 21, and the application processing module 21 generates playback page data based on the page generation instruction, so that the client 10 forms a playback page to display to the user. At the same time, based on the media loading instruction of the client 10, the storage address of the streaming media file is obtained in the database 23, so that the client 10 further obtains the streaming media file according to the storage address of the streaming media file, and loads the streaming media file to the playback page. Show and provide interactive features to users. Preferably, the streaming media file can be obtained from a data storage server such as a cloud storage space or a CDN edge node 40.
在优选实施例中,所述应用处理模块21接收客户端10的页面生成指令,生成HTML5页面数据并发回所述客户端10,形成HTML5页面,HTML5页面可支持MP4等格式的流媒体文件的加载,可降低对第三方软件的依赖性。In a preferred embodiment, the application processing module 21 receives the page generation instruction of the client 10, generates HTML5 page data and sends it back to the client 10 to form an HTML5 page, and the HTML5 page can support loading of the streaming media file in a format such as MP4. Can reduce dependence on third-party software.
在另一个实施例中,所述应用处理模块21进一步还可用于定时向每个业务处理模块22发送状态查询指令,每个业务处理模块22接收所述状态查询指令后,分别向所述应用处理模块21发回一个回复指令,若其中一个业务处理模块22未在指定时间内发回所述回复指令或发回错误指令,则判定该业务处理模块22故障,所述应用处理模块21停止向该故障的业务处理模块22发出所述流媒体回放请求。从而当业务处理模块22集群中的一个或多个出现故障时,***可自动检测出现故障的业务处理模块22,不再向故障的业务处理模块22发送回放请求,保证***的正常运作。由此,包括多个业务处理模块22的业务处理模块22集群可以实现动态扩容,所述应用处理模块21可与业务处理模块22集群中的一个或多个断开,使故障的业务处理模块22 从集群中下掉,使业务处理模块22自动降级,同时,也所述应用处理模块21也可动态地接入更多的业务处理模块22,保证集群中业务处理模块22的数量,提高***处理性能。In another embodiment, the application processing module 21 is further configured to periodically send a status query instruction to each of the service processing modules 22, and each of the service processing modules 22 processes the status query command and respectively processes the status query instruction. The module 21 sends back a reply command, and if one of the service processing modules 22 does not send back the reply command or sends back an error command within a specified time, it is determined that the service processing module 22 is faulty, and the application processing module 21 stops The failed service processing module 22 issues the streaming media playback request. Therefore, when one or more of the clusters of the service processing module 22 fails, the system can automatically detect the faulty service processing module 22, and no longer send a playback request to the faulty service processing module 22 to ensure normal operation of the system. Thus, the cluster of the service processing module 22 including the plurality of service processing modules 22 can implement dynamic capacity expansion, and the application processing module 21 can be disconnected from one or more of the clusters of the service processing modules 22, so that the faulty service processing module 22 The service processing module 22 is automatically degraded from the cluster, and the application processing module 21 can also dynamically access more service processing modules 22 to ensure the number of service processing modules 22 in the cluster and improve system processing. performance.
在一个优选实施例中,所述流媒体文件包括音视频文件,所述多个业务处理模块22基于客户端10发送的音视频文件请求,在所述数据库23中查询所述音视频文件的音视频存储地址并将该音视频存储地址返回客户端10,以使客户端10根据所述流媒体文件存储地址查找至对应的CDN边缘节点40,并从所述CDN边缘节点40中获取音视频文件的文件数据。本实施例中,通过CDN边缘节点40同步云存储服务器30上的音视频文件,可使获取音视频文件时间更短,提高回放页面的加载速度。In a preferred embodiment, the streaming media file includes an audio and video file, and the plurality of service processing modules 22 query the database 23 for the sound of the audio and video file based on the audio and video file request sent by the client 10. The video storage address returns the audio and video storage address to the client 10, so that the client 10 searches for the corresponding CDN edge node 40 according to the streaming media file storage address, and acquires the audio and video file from the CDN edge node 40. File data. In this embodiment, by synchronizing the audio and video files on the cloud storage server 30 through the CDN edge node 40, the time for acquiring the audio and video files can be shorter, and the loading speed of the playback page is improved.
在另一个实施例中,所述流媒体文件还可包括信令文件,所述多个业务处理模块22基于客户端10发送的信令文件请求,在云存储服务器30中查询所述信令文件的数据文件并将该信令文件的文件数据返回客户端10。本实施例的信令文件包括在线课程中使用的课件以及老师及学生对课件的操作,由于信令文件的文件大小较小,可直接从云存储服务器30获取,同时本实施例中,音视频文件和信令文件分别从CDN边缘节点40和云存储服务器30获取,实现了多个文件的同时获取,进一步加快了回放页面的打开和加载速度。In another embodiment, the streaming media file may further include a signaling file, and the plurality of service processing modules 22 query the signaling file in the cloud storage server 30 based on the signaling file request sent by the client 10. The data file and the file data of the signaling file are returned to the client 10. The signaling file of the embodiment includes the courseware used in the online course and the operation of the courseware by the teacher and the student. The file size of the signaling file is small, and can be directly obtained from the cloud storage server 30, and in this embodiment, the audio and video The file and signaling files are respectively obtained from the CDN edge node 40 and the cloud storage server 30, and simultaneous acquisition of multiple files is realized, which further speeds up the opening and loading speed of the playback page.
将流媒体文件分为音视频文件和信令文件两部分,在实现时,音视频文件和信令文件可分别同时加载,前端信令文件展示,后端控制音视频文件播放,两部分全部静态化加速,且音视频文件统一为回放页面可直接加载的文件形式,当提供拖拽、定点观看业务时,可以迅速地定位到选定的音视频帧,从而实现回放页面的简单逻辑处理以及秒开、秒拖的效果,并可以做到跨平台的兼容和使用。其中,对回放页面中流媒体文件的控制优选地可通过JAVASCRIPT脚本实现。The streaming media file is divided into two parts: audio and video files and signaling files. When implemented, audio and video files and signaling files can be loaded simultaneously, front-end signaling files are displayed, and back-end control audio and video files are played. Both parts are static. Accelerated, and the audio and video files are unified into a file format that can be directly loaded by the playback page. When providing drag and drop and fixed-point viewing services, the selected audio and video frames can be quickly located, thereby implementing simple logic processing of the playback page and seconds. Open, second drag effect, and can be cross-platform compatible and used. Wherein, the control of the streaming media file in the playback page is preferably implemented by a JAVASCRIPT script.
在另一个实施例中,所述多个业务处理模块22接收到客户端10发送的信令文件请求之后,首先在所述数据库23中查询请求回放的流媒体文件的课程类型,根据所述课程类型在云存储服务器30中查询所述信令文件的数据文件并获取所述云存储服务器30上与所述课程类型对应的所述信令文件的文件数据。通过获取课程类型进一步根据所述课程类型调整回放页面的布局,以加载音视频文件和信令文件。In another embodiment, after receiving the signaling file request sent by the client 10, the plurality of service processing modules 22 first query the database 23 for the course type of the streaming media file requested for playback, according to the course. The type queries the data file of the signaling file in the cloud storage server 30 and acquires the file data of the signaling file corresponding to the course type on the cloud storage server 30. The layout of the playback page is further adjusted according to the course type by acquiring the course type to load the audio and video files and the signaling file.
其中,所述课程类型可为一对一授课、一对多授课或多对一授课等多种课程类型,本发明对此并不作限制。The course type may be a one-to-one lecture, a one-to-many lecture, or a many-to-one lecture, and the like, and the present invention is not limited thereto.
如图2所示,在另一个优选实施例中,流媒体回放服务器进一步可对客户端10 传输的原始媒体文件进行转码得到所述流媒体文件。流媒体回放服务器可首先对流媒体文件进行转码形成流媒体文件,以统一流媒体文件格式,整合音频和视频文件,将老师或学生的音频和视频文件整合在一个文件中,无需页面进行逻辑控制,防止出现音画不同步现象,优选地,可将音频和视频文件整合为回放页面支持的媒体形式,可直接播放,无需依赖第三方软件,提高回放页面加载速度。本实施例中的流媒体回放服务器可同时实现流媒体文件的转码和回放,实现集中的业务处理,使流媒体回放的整个过程简单化、归一化,降低了对客户端的功能需求,可实现用户的跨平台、极速低延迟的回放,极大提高了用户体验。As shown in FIG. 2, in another preferred embodiment, the streaming media playback server further transcodes the original media file transmitted by the client 10 to obtain the streaming media file. The streaming media playback server can first transcode the streaming media files to form a streaming media file to unify the streaming media file format, integrate audio and video files, and integrate the audio and video files of the teacher or student into one file without logical control of the page. To prevent the phenomenon of audio and video unsynchronization, it is preferable to integrate the audio and video files into a media form supported by the playback page, which can be directly played without relying on third-party software to improve the playback speed of the playback page. The streaming media playback server in this embodiment can simultaneously implement transcoding and playback of streaming media files, implement centralized service processing, and simplify and normalize the entire process of streaming media playback, thereby reducing the functional requirements on the client. Realize the user's cross-platform, extremely fast and low-latency playback, greatly improving the user experience.
在一个优选实施方式中,流媒体回放服务器可进一步包括消息队列模块24、多个数据缓存模块25和多个视频转码模块26。In a preferred embodiment, the streaming media playback server may further include a message queue module 24, a plurality of data cache modules 25, and a plurality of video transcoding modules 26.
所述消息队列模块24可接收客户端10的媒体上传请求,将接收的多个媒体上传请求列队化。The message queue module 24 can receive the media upload request of the client 10, and queue the received multiple media upload requests.
所述多个业务处理模块22进一步可用于获取并根据所述流媒体上传请求从客户端10中提取原始媒体文件,解析并序列化所述原始媒体文件得到原始数据文件。可选的,多个业务处理模块22可分别从消息队列模块24提取媒体上传请求,将在线课程的课程相关信息以及原始媒体文件(老师和学生的音频和视频文件以及信令文件)进行序列化得到原始数据文件,例如可形成JSON语句的原始数据文件,以便于传输。The plurality of service processing modules 22 are further configured to obtain and extract an original media file from the client 10 according to the streaming media upload request, parse and serialize the original media file to obtain a raw data file. Optionally, the plurality of service processing modules 22 may respectively extract the media upload request from the message queue module 24, serialize the course related information of the online course and the original media files (audio and video files of the teacher and the student, and the signaling file). Get raw data files, such as raw data files that can form JSON statements for easy transfer.
所述多个数据缓存模块25可接收并缓存所述业务处理模块22传输的所述原始数据文件。多个数据缓存模块25为序列化后的形成的原始数据文件提供了暂时的存储空间,根据多个视频转码模块26的处理能力依次分配至不同的视频转码模块26,动态优化了流媒体转码过程。The plurality of data caching modules 25 can receive and cache the original data files transmitted by the service processing module 22. The plurality of data cache modules 25 provide a temporary storage space for the original data files formed after the serialization, and are sequentially allocated to different video transcoding modules 26 according to the processing capabilities of the plurality of video transcoding modules 26, thereby dynamically optimizing the streaming media. Transcoding process.
所述多个视频转码模块26可从所述数据缓存模块25依次提取所述原始数据文件并反序列化得到所述原始媒体文件,将所述原始媒体文件转码形成所述流媒体文件,存储所述流媒体文件并返回所述流媒体文件的存储地址至所述多个业务处理模块22,以使业务处理模块22将所述存储地址存储于数据库23中。The plurality of video transcoding modules 26 may sequentially extract the original data file from the data cache module 25 and deserialize the original media file, and transcode the original media file to form the streaming media file. The streaming media file is stored and the storage address of the streaming media file is returned to the plurality of service processing modules 22 to cause the service processing module 22 to store the storage address in the database 23.
在一个优选实施例中,所述流媒体文件包括音视频文件和信令文件。所述多个视频转码模块26将所述流媒体文件存储于云存储服务器30并将流媒体文件中的音视频文件同步至CDN边缘节点40上,将CDN边缘节点40中的音视频文件的存储地址以及云存储服务器30中的信令文件的存储地址传输至业务处理模块22,以使业务处理 模块22进一步将音视频文件和信令文件的存储地址存储于数据库23中。In a preferred embodiment, the streaming media file includes an audiovisual file and a signaling file. The plurality of video transcoding modules 26 store the streaming media file in the cloud storage server 30 and synchronize the audio and video files in the streaming media file to the CDN edge node 40, and the audio and video files in the CDN edge node 40 The storage address and the storage address of the signaling file in the cloud storage server 30 are transmitted to the service processing module 22, so that the service processing module 22 further stores the storage address of the audio and video file and the signaling file in the database 23.
如图3所示,公开了一种客户端。该客户端10包括回放请求模块11、页面生成模块12和数据加载模块13。As shown in Figure 3, a client is disclosed. The client 10 includes a playback request module 11, a page generation module 12, and a data loading module 13.
所述回放请求模块11用于向流媒体回放服务器发送流媒体回放指令,以使流媒体回放服务器查询到待回放的流媒体文件的相关信息后返回流媒体回放地址。The playback requesting module 11 is configured to send a streaming media playback instruction to the streaming media playback server, so that the streaming media playback server queries the related information of the streaming media file to be played back and returns to the streaming media playback address.
所述页面生成模块12用于向流媒体回放服务器发送页面生成指令,以使所述流媒体回放服务器基于客户端10的页面生成指令返回回放页面数据,进一步形成回放页面。在优选地实施方式中,所述页面生成模块进一步可向流媒体回放服务器发送页面生成指令,以使流媒体回放服务器生成HTML5页面数据并发回,形成HTML5页面。The page generating module 12 is configured to send a page generation instruction to the streaming media playback server, so that the streaming media playback server returns the playback page data based on the page generation instruction of the client 10 to further form a playback page. In a preferred embodiment, the page generation module may further send a page generation instruction to the streaming playback server to cause the streaming playback server to generate HTML5 page data and send it back to form an HTML5 page.
所述数据加载模块13用于向流媒体回放服务器发送流媒体加载指令,以使流媒体回放服务器查找流媒体文件的存储地址并返回,以进一步根据所述流媒体文件的存储地址获取所述流媒体文件加载至所述回放页面,向用户展示。The data loading module 13 is configured to send a streaming media loading instruction to the streaming media playback server, so that the streaming media playback server searches for a storage address of the streaming media file and returns to further obtain the flow according to the storage address of the streaming media file. The media file is loaded onto the playback page and presented to the user.
本发明中的流媒体文件可以直接在回放页面上加载,通过设置回放页面并将所有需要回放的文件通过转码得到该回放页面可直接加载的流媒体文件,以使整个回放过程可不受第三方软件升级的限制,实现跨终端、随时随地的流媒体文件回放,简化了整个回放***的回放逻辑,提高流媒体加载速度,实现秒开、秒拖等交互功能,提高用户体验效果。The streaming media file in the present invention can be directly loaded on the playback page. By setting the playback page and transcoding all the files that need to be played back, the streaming media file directly loaded by the playback page can be obtained, so that the entire playback process is not subject to the third party. The limitation of software upgrade realizes playback of streaming media files across terminals and anytime and anywhere, which simplifies the playback logic of the entire playback system, improves the loading speed of streaming media, and realizes interactive functions such as second opening and second dragging, thereby improving user experience.
在一个优选实施例中,所述流媒体文件包括音视频文件,所述数据加载模块可向流媒体回放服务器发送音视频文件请求,以使流媒体回放服务器在数据库中查询所述音视频文件的音视频存储地址并将该音视频存储地址返回;所述数据加载模块用于根据所述流媒体文件存储地址查找至对应的CDN边缘节点,并从所述CDN边缘节点中获取自云存储服务器同步的音视频文件并加载至所述回放页面。CDN边缘节点40同步云存储服务器30上的音视频文件,可使获取音视频文件时间更短,提高回放页面的加载速度。In a preferred embodiment, the streaming media file includes an audio and video file, and the data loading module may send an audio and video file request to the streaming media playback server, so that the streaming media playback server queries the audio and video file in the database. The audio and video storage address returns the audio and video storage address; the data loading module is configured to search to the corresponding CDN edge node according to the streaming media file storage address, and obtain synchronization from the cloud storage server from the CDN edge node. Audio and video files are loaded to the playback page. The CDN edge node 40 synchronizes the audio and video files on the cloud storage server 30, so that the time for acquiring the audio and video files is shorter, and the loading speed of the playback page is improved.
在另一个实施例中,所述流媒体文件还可包括信令文件,所述数据加载模块可向流媒体回放服务器发送信令文件请求,以使流媒体回放服务器在数据库中查询所述信令文件的存储地址并将该信令文件的存储地址返回,所述数据加载模块用于根据信令文件的存储地址获取云存储服务器中的信令文件并将该信令文件加载至所述回放页面。In another embodiment, the streaming media file may further include a signaling file, and the data loading module may send a signaling file request to the streaming media playback server to cause the streaming media playback server to query the signaling in the database. The storage address of the file is returned, and the data loading module is configured to acquire a signaling file in the cloud storage server according to the storage address of the signaling file and load the signaling file to the playback page. .
其中,在具体实施例中,信令文件包括在线课程中使用的课件以及老师及学生对课件的操作,由于信令文件的文件大小较小,可直接从云存储服务器30获取,音视频文件和信令文件分别从CDN边缘节点40和云存储服务器30获取,实现了多个文件的同时获取,进一步加快了回放页面的打开和加载速度。将流媒体文件分为音视频文件和信令文件两部分,在实现时,音视频文件和信令文件可分别同时加载,前端信令文件展示,后端控制音视频文件播放,两部分全部静态化加速,且音视频文件统一为回放页面可直接加载的文件形式,当提供拖拽、定点观看业务时,可以迅速地定位到选定的音视频帧,从而实现回放页面的简单逻辑处理以及秒开、秒拖的效果,并可以做到跨平台的兼容和使用。其中,对回放页面中流媒体文件的控制优选地可通过JAVASCRIPT脚本实现。Wherein, in a specific embodiment, the signaling file includes the courseware used in the online course and the operation of the courseware by the teacher and the student. Since the file size of the signaling file is small, the file can be directly obtained from the cloud storage server 30, the audio and video file and The signaling files are respectively obtained from the CDN edge node 40 and the cloud storage server 30, and the simultaneous acquisition of multiple files is realized, which further speeds up the opening and loading speed of the playback page. The streaming media file is divided into two parts: audio and video files and signaling files. When implemented, audio and video files and signaling files can be loaded simultaneously, front-end signaling files are displayed, and back-end control audio and video files are played. Both parts are static. Accelerated, and the audio and video files are unified into a file format that can be directly loaded by the playback page. When providing drag and drop and fixed-point viewing services, the selected audio and video frames can be quickly located, thereby implementing simple logic processing of the playback page and seconds. Open, second drag effect, and can be cross-platform compatible and used. Wherein, the control of the streaming media file in the playback page is preferably implemented by a JAVASCRIPT script.
在另一个实施例中,在获取流媒体文件的存储地址时,所述数据加载模块向流媒体回放服务器发送信令文件请求,以使流媒体回放服务器在所述数据库中查询请求回放的流媒体文件的课程类型,并根据所述课程类型获取所述数据库中所述信令文件的存储地址。通过获取课程类型进一步根据所述课程类型调整回放页面的布局,以加载音视频文件和信令文件。In another embodiment, when acquiring the storage address of the streaming media file, the data loading module sends a signaling file request to the streaming media playback server, so that the streaming media playback server queries the database for streaming media requesting playback. The course type of the file, and the storage address of the signaling file in the database is obtained according to the course type. The layout of the playback page is further adjusted according to the course type by acquiring the course type to load the audio and video files and the signaling file.
其中,所述课程类型可为一对一授课、一对多授课或多对一授课等多种课程类型,本发明对此并不作限制。The course type may be a one-to-one lecture, a one-to-many lecture, or a many-to-one lecture, and the like, and the present invention is not limited thereto.
如图4所示,在一个优选实施例中,所述客户端还可包括转码请求模块14。As shown in FIG. 4, in a preferred embodiment, the client may also include a transcoding request module 14.
所述转码请求模块14用于向流媒体回放服务器发送流媒体上传请求,以使所述流媒体服务器的消息队列模块24接收流媒体上传请求,多个业务处理模块22获取并根据所述流媒体上传请求从所述客户端中提取原始媒体文件,解析并序列化所述原始媒体文件得到原始数据文件,多个数据缓存模块25接收并缓存所述业务处理模块22传输的所述原始数据文件;多个视频转码模块26从所述数据缓存模块25依次提取所述原始数据文件并反序列化得到所述原始媒体文件,将所述原始媒体文件转码形成所述流媒体文件,存储所述流媒体文件并返回所述流媒体文件的存储地址至所述多个业务处理模块22,以使业务处理模块22将所述存储地址存储于数据库23中。The transcoding request module 14 is configured to send a streaming media upload request to the streaming media playback server, so that the message queue module 24 of the streaming media server receives the streaming media upload request, and the multiple service processing modules 22 acquire and according to the streaming The media upload request extracts the original media file from the client, parses and serializes the original media file to obtain a raw data file, and the plurality of data cache modules 25 receive and cache the original data file transmitted by the service processing module 22. The plurality of video transcoding modules 26 sequentially extract the original data file from the data cache module 25 and deserialize the original media file, transcode the original media file to form the streaming media file, and store the original The streaming media file is returned to the storage address of the streaming media file to the plurality of service processing modules 22, so that the service processing module 22 stores the storage address in the database 23.
如图5所示,根据本发明的一个方面,公开了一种采用上述流媒体回放服务器实现流媒体回放的方法,所述方法包括:As shown in FIG. 5, in accordance with an aspect of the present invention, a method for implementing streaming media playback using the streaming media playback server is disclosed, the method comprising:
通过数据库23存储所述流媒体文件的存储地址,通过信息转发模块20接收客户端发送的流媒体回放指令,通过应用处理模块21接收所述流媒体回放指令,鉴权所 述流媒体回放指令的合法性,输出合法的流媒体回放指令,通过多个业务处理模块22接收所述合法的流媒体回放指令,在数据库23中查找请求回放的流媒体文件的相关信息,当数据库23中存在所述流媒体文件的相关信息时,以使所述应用处理模块21基于客户端的页面生成指令返回回放页面数据,使客户端形成回放页面,进一步从所述数据库23中提取对应的流媒体文件的存储地址并返回给客户端,以使客户端获取流媒体文件并加载至所述回放页面。The storage address of the streaming media file is stored in the database 23, and the streaming media playback command sent by the client is received by the information forwarding module 20, and the streaming media playback command is received by the application processing module 21 to authenticate the streaming media playback command. Legitimate, outputting a legal streaming playback command, receiving the legal streaming playback command through the plurality of service processing modules 22, and searching the database 23 for the related information of the streaming media file requested for playback, when the database 23 exists When the related information of the streaming media file is used, the application processing module 21 returns the playback page data based on the page generation instruction of the client, so that the client forms a playback page, and further extracts the storage address of the corresponding streaming media file from the database 23. And returning to the client, so that the client obtains the streaming media file and loads it to the playback page.
在一些可选实施例中,还通过所述应用处理模块21定时向每个业务处理模块22发送状态查询指令;每个业务处理模块22接收所述状态查询指令后,分别向所述应用处理模块21发回一个回复指令;若其中一个业务处理模块22未在指定时间内发回所述回复指令或发回错误指令,则判定该业务处理模块22故障,所述应用处理模块21停止向该故障的业务处理模块22发出所述流媒体回放请求。In some optional embodiments, the application processing module 21 periodically sends a status query instruction to each of the service processing modules 22; after receiving the status query instruction, each of the service processing modules 22 respectively processes the application processing module. 21 sends back a reply command; if one of the service processing modules 22 does not send back the reply command or sends back an error command within a specified time, it is determined that the service processing module 22 is faulty, and the application processing module 21 stops the fault. The service processing module 22 issues the streaming media playback request.
在所述服务器查找并返回流媒体回放地址后,可通过所述应用处理模块21接收客户端的页面生成指令,生成HTML5页面数据并发回所述客户端,以在客户端形成HTML5回放页面。After the server finds and returns the streaming media playback address, the application processing module 21 can receive the page generation instruction of the client, generate HTML5 page data and send it back to the client to form an HTML5 playback page on the client.
在一些可选实施例中,所述流媒体文件可包括音视频文件,可使所述多个业务处理模块22基于客户端发送的音视频文件请求,在数据库23中查询所述音视频文件的存储地址并将该音视频文件的存储地址返回客户端,以使客户端根据所述音视频文件的存储地址从对应的CDN边缘节点40中获取自云存储服务器30同步的所述音视频文件并加载至所述回放页面。In some optional embodiments, the streaming media file may include an audio and video file, and the plurality of service processing modules 22 may be queried in the database 23 for the audio and video file based on the audio and video file request sent by the client. And storing the address and returning the storage address of the audio and video file to the client, so that the client obtains the audio and video file synchronized from the cloud storage server 30 from the corresponding CDN edge node 40 according to the storage address of the audio and video file. Loaded to the playback page.
在一些可选实施例中,所述流媒体文件还可包括信令文件,可使所述多个业务处理模块22基于客户端发送的信令文件请求,在数据库23中查询所述信令文件的存储地址并将该信令文件的存储地址返回客户端,以使客户端获取云存储服务器30中的信令文件并将该信令文件加载至所述回放页面。In some optional embodiments, the streaming media file may further include a signaling file, and the plurality of service processing modules 22 may be configured to query the signaling file in the database 23 based on the signaling file request sent by the client. The storage address returns the storage address of the signaling file to the client, so that the client acquires the signaling file in the cloud storage server 30 and loads the signaling file to the playback page.
在一些可选实施例中,在获取信令文件时,可进一步使所述多个业务处理模块22基于客户端发送的信令文件请求,在所述数据库23中查询请求回放的流媒体文件的课程类型,并根据所述课程类型获取所述数据库23中所述信令文件的存储地址。所述课程类型为一对一授课、一对多授课或多对一授课等多种课程类型。In some optional embodiments, when acquiring the signaling file, the plurality of service processing modules 22 may further be queried in the database 23 for the streaming media file requesting playback based on the signaling file request sent by the client. The course type, and the storage address of the signaling file in the database 23 is obtained according to the course type. The types of courses are one-to-one, one-to-many or many-to-one.
如图6所示,在一个优选实施例中,所述方法进一步可包括对客户端传输的原始媒体文件进行转码得到所述流媒体文件的步骤。As shown in FIG. 6, in a preferred embodiment, the method may further include the step of transcoding the original media file transmitted by the client to obtain the streaming media file.
在一个优选实施例中,将原始媒体文件进行转码得到所述流媒体文件方法可包 括通过消息队列模块24接收客户端的媒体上传请求;通过所述多个业务处理模块22获取并根据所述流媒体上传请求从客户端中提取原始媒体文件,解析并序列化所述原始媒体文件得到原始数据文件;通过多个数据缓存模块25接收并缓存所述业务处理模块22传输的所述原始数据文件;通过多个视频转码模块26从所述数据缓存模块25依次提取所述原始数据文件并反序列化得到所述原始媒体文件,将所述原始媒体文件转码形成所述流媒体文件,存储所述流媒体文件并返回所述流媒体文件的存储地址至所述多个业务处理模块22,以使业务处理模块22将所述存储地址存储于数据库23中。In a preferred embodiment, the method of transcoding the original media file to obtain the streaming media file may include receiving, by the message queue module 24, a media upload request of the client; acquiring, by the plurality of service processing modules 22, and according to the stream The media upload request extracts the original media file from the client, parses and serializes the original media file to obtain the original data file, and receives and caches the original data file transmitted by the service processing module 22 through the plurality of data cache modules 25; The original data file is sequentially extracted from the data buffer module 25 by the plurality of video transcoding modules 26 and deserialized to obtain the original media file, and the original media file is transcoded to form the streaming media file, and the storage device The streaming media file is returned to the storage address of the streaming media file to the plurality of service processing modules 22, so that the service processing module 22 stores the storage address in the database 23.
在另一个实施例中,所述流媒体文件可包括音视频文件和信令文件。通过所述多个视频转码模块26将所述流媒体文件存储于云存储服务器30并将流媒体文件中的音视频文件同步至CDN边缘节点40上,将CDN边缘节点40中的音视频文件的存储地址以及云存储服务器30中的信令文件的存储地址传输至业务处理模块22,以使业务处理模块22进一步将音视频文件和信令文件的存储地址存储于数据库23中。In another embodiment, the streaming media file may include an audiovisual file and a signaling file. The streaming media file is stored in the cloud storage server 30 by the plurality of video transcoding modules 26, and the audio and video files in the streaming media file are synchronized to the CDN edge node 40, and the audio and video files in the CDN edge node 40 are The storage address and the storage address of the signaling file in the cloud storage server 30 are transmitted to the service processing module 22, so that the service processing module 22 further stores the storage addresses of the audio and video files and the signaling file in the database 23.
基于相同原理,根据本发明的另一方面,还公开了一种基于所述客户端实现流媒体回放的方法。Based on the same principle, in accordance with another aspect of the present invention, a method of implementing streaming media playback based on the client is also disclosed.
所述方法包括通过回放请求模块11向流媒体回放服务器发送流媒体回放指令,以使流媒体回放服务器查询到待回放的流媒体文件的相关信息后返回流媒体回放地址;通过页面生成模块12向流媒体回放服务器发送页面生成指令,以使所述流媒体回放服务器基于客户端的页面生成指令返回回放页面数据,进一步形成回放页面;通过数据加载模块13向流媒体回放服务器发送流媒体加载指令,以使流媒体回放服务器查找流媒体文件的存储地址并返回,以进一步根据所述流媒体文件的存储地址获取所述流媒体文件加载至所述回放页面,向用户展示。The method includes: sending, by the playback request module 11, a streaming media playback instruction to the streaming media playback server, so that the streaming media playback server queries the related information of the streaming media file to be played back and returns to the streaming media playback address; The streaming media playback server sends a page generation instruction, so that the streaming media playback server returns the playback page data based on the page generation instruction of the client, further forms a playback page; and sends a streaming media loading instruction to the streaming media playback server through the data loading module 13 to And causing the streaming media playback server to search for the storage address of the streaming media file and returning to further obtain the streaming media file to be loaded into the playback page according to the storage address of the streaming media file, and display the content to the user.
在一个优选实施例中,可通过所述页面生成模块12向流媒体回放方法发送页面生成指令,以使流媒体回放方法生成HTML5页面数据并发回,形成HTML5页面。In a preferred embodiment, the page generation module 12 may send a page generation instruction to the streaming media playback method to cause the streaming media playback method to generate HTML5 page data and send it back to form an HTML5 page.
在另一个实施例中,所述流媒体文件可包括音视频文件,可通过所述数据加载模块13向流媒体回放服务器发送音视频文件请求,以使流媒体回放服务器在数据库23中查询所述音视频文件的音视频存储地址并将该音视频存储地址返回。并进一步通过所述数据加载模块13根据所述流媒体文件存储地址查找至对应的CDN边缘节点40,并从所述CDN边缘节点40中获取自云存储服务器30同步的音视频文件并加载至所述回放页面。In another embodiment, the streaming media file may include an audio and video file, and the audio and video file request may be sent to the streaming media playback server by the data loading module 13 to cause the streaming media playback server to query the database 23 for the The audio and video storage address of the audio and video file is returned and the audio and video storage address is returned. And the data loading module 13 further searches for the corresponding CDN edge node 40 according to the streaming media file storage address, and acquires the audio and video file synchronized from the cloud storage server 30 from the CDN edge node 40 and loads it into the office. The playback page.
在另一个实施例中,所述流媒体文件还可包括信令文件,在获取流媒体文件时, 可通过所述数据加载模块13向流媒体回放方法发送信令文件请求,以使流媒体回放服务器在数据库23中查询所述信令文件的存储地址并将该信令文件的存储地址返回;所述数据加载模块13根据信令文件的存储地址获取云存储服务器30中的信令文件并将该信令文件加载至所述回放页面,并进一步通过所述数据加载模块13向流媒体回放方法发送信令文件请求,以使流媒体回放服务器在所述数据库23中查询请求回放的流媒体文件的课程类型,并根据所述课程类型获取所述数据库23中所述信令文件的存储地址。其中,所述课程类型为一对一授课、一对多授课或多对一授课等多种课程类型。In another embodiment, the streaming media file may further include a signaling file, and when the streaming media file is acquired, the signaling file request may be sent to the streaming media playback method by the data loading module 13 to enable streaming media playback. The server queries the storage address of the signaling file in the database 23 and returns the storage address of the signaling file; the data loading module 13 acquires the signaling file in the cloud storage server 30 according to the storage address of the signaling file and The signaling file is loaded to the playback page, and the signaling file request is further sent by the data loading module 13 to the streaming media playback method, so that the streaming media playback server queries the database 23 for the streaming media file requested for playback. The course type, and the storage address of the signaling file in the database 23 is obtained according to the course type. Among them, the types of courses are one-to-one lectures, one-to-many lectures, or many-to-one lectures, and the like.
在另一个实施例中,还可通过转码请求模块14向流媒体回放服务器发送流媒体上传请求,以使所述流媒体服务器的消息队列模块24接收流媒体上传请求,多个业务处理模块22获取并根据所述流媒体上传请求从所述流媒体回放方法中提取原始媒体文件,解析并序列化所述原始媒体文件得到原始数据文件,多个数据缓存模块25接收并缓存所述业务处理模块22传输的所述原始数据文件;多个视频转码模块26从所述数据缓存模块25依次提取所述原始数据文件并反序列化得到所述原始媒体文件,将所述原始媒体文件转码形成所述流媒体文件,存储所述流媒体文件并返回所述流媒体文件的存储地址至所述多个业务处理模块22,以使业务处理模块22将所述存储地址存储于数据库23中。In another embodiment, the streaming request module 14 can also send a streaming upload request to the streaming media playback server, so that the message queue module 24 of the streaming media server receives the streaming media upload request, and the multiple service processing modules 22 Acquiring and extracting the original media file from the streaming media playback method according to the streaming media uploading request, parsing and serializing the original media file to obtain a raw data file, and the plurality of data caching modules 25 receive and cache the service processing module. 22, the original data file transmitted; the plurality of video transcoding modules 26 sequentially extract the original data file from the data cache module 25 and deserialize the original media file, and transcode the original media file to form The streaming media file stores the streaming media file and returns a storage address of the streaming media file to the plurality of service processing modules 22, so that the service processing module 22 stores the storage address in the database 23.
进一步的,本发明的一些具体实施例提供一种计算机设备,包括存储器、处理器以及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现如上所述的由客户端执行的方法,或者,所述处理器执行所述程序时实现如上所述的由服务器执行的方法。Further, some embodiments of the present invention provide a computer device including a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the program as described above The method executed by the client, or the method executed by the server as described above when the processor executes the program.
下面参考图7,其示出了适于用来实现本申请实施例的终端设备或服务器的计算机设备700的结构示意图。Referring now to Figure 7, a block diagram of a computer device 700 suitable for use in implementing a terminal device or server of an embodiment of the present application is shown.
如图7所示,计算机设备700包括中央处理单元(CPU)701,其可以根据存储在只读存储器(ROM)702中的程序或者从存储部分708加载到随机访问存储器(RAM)703中的程序而执行各种适当的工作和处理。在RAM703中,还存储有***700操作所需的各种程序和数据。CPU701、ROM702、以及RAM703通过总线704彼此相连。输入/输出(I/O)接口705也连接至总线704。As shown in FIG. 7, computer device 700 includes a central processing unit (CPU) 701 that can be loaded into a program in random access memory (RAM) 703 according to a program stored in read only memory (ROM) 702 or from storage portion 708. And perform all kinds of proper work and processing. In the RAM 703, various programs and data required for the operation of the system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other through a bus 704. An input/output (I/O) interface 705 is also coupled to bus 704.
以下部件连接至I/O接口705:包括键盘、鼠标等的输入部分706;包括诸如阴极射线管(CRT)、液晶显示器(LCD)等以及扬声器等的输出部分707;包括硬盘 等的存储部分708;以及包括诸如LAN卡,调制解调器等的网络接口卡的通信部分709。通信部分709经由诸如因特网的网络执行通信处理。驱动器710也根据需要连接至I/O接口706。可拆卸介质711,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器710上,以便于从其上读出的计算机程序根据需要被安装如存储部分708。The following components are connected to the I/O interface 705: an input portion 706 including a keyboard, a mouse, etc.; an output portion 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), and the like, and a speaker; a storage portion 708 including a hard disk or the like And a communication portion 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the Internet. Driver 710 is also coupled to I/O interface 706 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory or the like, is mounted on the drive 710 as needed so that a computer program read therefrom is installed as the storage portion 708 as needed.
特别地,根据本发明的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本发明的实施例包括一种计算机程序产品,其包括有形地包含在机器可读介质上的计算机程序,所述计算机程序包括用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分709从网络上被下载和安装,和/或从可拆卸介质711被安装。In particular, the processes described above with reference to the flowcharts may be implemented as a computer software program in accordance with an embodiment of the present invention. For example, an embodiment of the invention includes a computer program product comprising a computer program tangibly embodied on a machine readable medium, the computer program comprising program code for executing the method illustrated in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network via communication portion 709, and/or installed from removable media 711.
附图中的流程图和框图,图示了按照本发明各种实施例的***、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,所述模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发送。例如两个接连地表示的方框实际上可以基本并行地执行,他们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的***来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality and operation of possible implementations of systems, methods and computer program products in accordance with various embodiments of the invention. In this regard, each block of the flowchart or block diagrams can represent a module, a program segment, or a portion of code that includes one or more logic for implementing the specified. Functional executable instructions. It should also be noted that in some alternative implementations, the functions noted in the blocks may also be transmitted in a different order than that illustrated in the drawings. For example, two successively represented blocks may in fact be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functionality involved. It is also noted that each block of the block diagrams and/or flowcharts, and combinations of blocks in the block diagrams and/or flowcharts, can be implemented in a dedicated hardware-based system that performs the specified function or operation. Or it can be implemented by a combination of dedicated hardware and computer instructions.
显然,本发明的上述实施例仅仅是为清楚地说明本发明所作的举例,而并非是对本发明的实施方式的限定,对于所属领域的普通技术人员来说,在上述说明的基础上还可以做出其它不同形式的变化或变动,这里无法对所有的实施方式予以穷举,凡是属于本发明的技术方案所引伸出的显而易见的变化或变动仍处于本发明的保护范围之列。It is apparent that the above-described embodiments of the present invention are merely illustrative of the present invention and are not intended to limit the embodiments of the present invention, and those skilled in the art can also make the above description. It is to be understood that various changes and modifications may be made without departing from the spirit and scope of the invention.

Claims (36)

  1. 一种流媒体回放方法,应用于流媒体回放服务器,所述流媒体回放服务器包括信息转发模块、应用处理模块和多个业务处理模块,其特征在于,包括:A streaming media playback method is applied to a streaming media playback server, where the streaming media playback server includes an information forwarding module, an application processing module, and a plurality of service processing modules, and the method includes:
    通过信息转发模块接收客户端发送的流媒体回放指令并将所述流媒体回放指令发送至应用处理模块;Receiving, by the information forwarding module, a streaming media playback instruction sent by the client, and sending the streaming media playback instruction to the application processing module;
    通过应用处理模块鉴权所述流媒体回放指令的合法性,输出合法的流媒体回放指令;And authenticating the legality of the streaming media playback instruction by using an application processing module, and outputting a legal streaming media playback instruction;
    通过多个业务处理模块接收所述合法的流媒体回放指令,在数据库中查找请求回放的流媒体文件的相关信息;Receiving, by the plurality of service processing modules, the legal streaming media playback instruction, and searching, in the database, related information of the streaming media file requested to be played back;
    响应于数据库中存在所述流媒体文件的相关信息,向所述客户端发送流媒体回放地址,以使所述客户端形成回放页面;Sending a streaming media playback address to the client in response to the presence of the related information of the streaming media file in the database, so that the client forms a playback page;
    从所述数据库中提取对应的流媒体文件的存储地址并发送给客户端,以使客户端获取流媒体文件并加载至所述回放页面。Extracting a storage address of the corresponding streaming media file from the database and transmitting the storage address to the client, so that the client obtains the streaming media file and loads the playback media page.
  2. 根据权利要求1所述的流媒体回放方法,其特征在于,所述方法进一步包括:The streaming media playback method according to claim 1, wherein the method further comprises:
    通过应用处理模块接收所述客户端根据所述流媒体回放地址发出的页面生成指令;Receiving, by the application processing module, a page generation instruction sent by the client according to the streaming media playback address;
    根据所述页面生成指令生成回放页面数据并将所述回放页面数据发送给所述客户端,以使所述客户端生成回放页面。Generating playback page data according to the page generation instruction and transmitting the playback page data to the client, so that the client generates a playback page.
  3. 根据权利要求2所述的流媒体回放方法,其特征在于,根据所述页面生成指令生成回放页面数据并将所述回放页面数据发送给所述客户端,以使所述客户端生成回放页面包括:The streaming media playback method according to claim 2, wherein the playback page data is generated according to the page generation instruction and the playback page data is sent to the client, so that the client generates a playback page including :
    根据所述页面生成指令生成HTML5页面数据并将所述HTML5页面数据发送给所述客户端,以在客户端形成HTML5回放页面。Generating HTML5 page data according to the page generation instruction and transmitting the HTML5 page data to the client to form an HTML5 playback page on the client.
  4. 根据权利要求1所述的流媒体回放方法,其特征在于,所述方法进一步包括:The streaming media playback method according to claim 1, wherein the method further comprises:
    通过所述应用处理模块定时向每个业务处理模块发送状态查询指令;Sending a status query instruction to each service processing module periodically by the application processing module;
    每个业务处理模块根据接收的所述状态查询指令向所述应用处理模块发回一个回复指令;Each service processing module sends a reply instruction to the application processing module according to the received status query instruction;
    响应于所述业务处理模块未在指定时间内发回所述回复指令或发回错误指令,所述应用处理模块停止向该处理模块发送所述流媒体回放请求。In response to the service processing module not sending back the reply command or sending back an error command within a specified time, the application processing module stops transmitting the streaming media playback request to the processing module.
  5. 根据权利要求1所述的流媒体回放方法,其特征在于,所述流媒体文件包括音视频文件,从所述数据库中提取对应的流媒体文件的存储地址并发送给客户端,以使客户端获取流媒体文件并加载至所述回放页面包括:The streaming media playback method according to claim 1, wherein the streaming media file comprises an audio and video file, and a storage address of the corresponding streaming media file is extracted from the database and sent to the client, so that the client Obtaining a streaming media file and loading to the playback page includes:
    所述多个业务处理模块基于客户端发送的音视频文件请求,在数据库中查询所述音视频文件的存储地址并将该音视频文件的存储地址发送给客户端,以使客户端根据所述音视频文件的存储地址从对应的CDN边缘节点中获取自云存储服务器同步的所述音视频文件并加载至所述回放页面。The plurality of service processing modules query the storage address of the audio and video file in the database and send the storage address of the audio and video file to the client based on the audio and video file request sent by the client, so that the client The storage address of the audio and video file is obtained from the corresponding CDN edge node and the audio and video files synchronized from the cloud storage server are loaded and loaded to the playback page.
  6. 根据权利要求1或5所述的流媒体回放方法,其特征在于,所述流媒体文件包括信令文件,从所述数据库中提取对应的流媒体文件的存储地址并发送给客户端,以使客户端获取流媒体文件并加载至所述回放页面包括:The streaming media playback method according to claim 1 or 5, wherein the streaming media file comprises a signaling file, and a storage address of the corresponding streaming media file is extracted from the database and sent to the client, so that The client acquiring the streaming media file and loading to the playback page includes:
    所述多个业务处理模块基于客户端发送的信令文件请求,在数据库中查询所述信令文件的存储地址并将该信令文件的存储地址发送给客户端,以使客户端获取云存储服务器中的信令文件并将该信令文件加载至所述回放页面。The multiple service processing modules query the storage address of the signaling file in the database and send the storage address of the signaling file to the client based on the signaling file request sent by the client, so that the client obtains the cloud storage. A signaling file in the server and loading the signaling file to the playback page.
  7. 根据权利要求6所述的流媒体回放方法,其特征在于,所述多个业务处理模块基于客户端发送的信令文件请求,在数据库中查询所述信令文件的存储地址包括:The streaming media playback method according to claim 6, wherein the plurality of service processing modules query the storage address of the signaling file in the database based on the signaling file request sent by the client, including:
    所述多个业务处理模块基于客户端发送的信令文件请求,在所述数据库中查询请求回放的信令文件的课程类型,并根据所述课程类型获取所述数据库中所述信令文件的存储地址。And the plurality of service processing modules query, according to the signaling file request sent by the client, the course type of the signaling file requested to be played back in the database, and acquire the signaling file in the database according to the course type. Storage address.
  8. 根据权利要求7所述的流媒体回放方法,其特征在于,所述课程类型为一对一授课、一对多授课或多对一授课。The streaming media playback method according to claim 7, wherein the course type is one-to-one lecture, one-to-many lecture, or many-to-one lecture.
  9. 根据权利要求1所述的流媒体回放方法,其特征在于,所述方法进一步包括:The streaming media playback method according to claim 1, wherein the method further comprises:
    对客户端传输的原始媒体文件进行转码以获取所述流媒体文件。Transcoding the original media file transmitted by the client to obtain the streaming media file.
  10. 根据权利要求9所述的流媒体回放方法,其特征在于,所述流媒体回放服务器还包括消息队列模块、多个数据缓存模块和多个视频转码模块;The streaming media playback method according to claim 9, wherein the streaming media playback server further comprises a message queue module, a plurality of data cache modules, and a plurality of video transcoding modules;
    对客户端传输的原始媒体文件进行转码以获取所述流媒体文件包括:Transcoding the original media file transmitted by the client to obtain the streaming media file includes:
    通过消息队列模块接收客户端的流媒体上传请求;Receiving a streaming media upload request of the client through the message queue module;
    通过所述多个业务处理模块获取所述流媒体上传请求,并根据所述流媒体上传请求从客户端中提取原始媒体文件,解析并序列化所述原始媒体文件得到原始数据文件;Acquiring, by the plurality of service processing modules, the streaming media upload request, and extracting an original media file from the client according to the streaming media upload request, parsing and serializing the original media file to obtain a raw data file;
    通过多个数据缓存模块接收并缓存所述业务处理模块传输的所述原始数据文件;Receiving and buffering, by the plurality of data cache modules, the original data file transmitted by the service processing module;
    通过多个视频转码模块从所述数据缓存模块依次提取所述原始数据文件并反序 列化得到所述原始媒体文件,将所述原始媒体文件转码形成所述流媒体文件,存储所述流媒体文件并返回所述流媒体文件的存储地址至所述多个业务处理模块,以使业务处理模块将所述存储地址存储于数据库中。Extracting the original data file from the data cache module by a plurality of video transcoding modules and deserializing the original media file, transcoding the original media file to form the streaming media file, and storing the stream And returning the storage address of the streaming media file to the plurality of service processing modules, so that the service processing module stores the storage address in a database.
  11. 根据权利要求10所述的流媒体回放方法,其特征在于,所述流媒体文件包括音视频文件和信令文件,存储所述流媒体文件并返回所述流媒体文件的存储地址至所述多个业务处理模块,以使业务处理模块将所述存储地址存储于数据库中包括:The streaming media playback method according to claim 10, wherein the streaming media file comprises an audio and video file and a signaling file, the streaming media file is stored, and the storage address of the streaming media file is returned to the plurality of The service processing module, so that the service processing module stores the storage address in the database, including:
    通过所述多个视频转码模块将所述流媒体文件存储于云存储服务器并将流媒体文件中的音视频文件同步至CDN边缘节点上,将CDN边缘节点中的音视频文件的存储地址以及云存储服务器中的信令文件的存储地址传输至业务处理模块,以使业务处理模块进一步将音视频文件和信令文件的存储地址存储于数据库中。The streaming media file is stored in the cloud storage server by the plurality of video transcoding modules, and the audio and video files in the streaming media file are synchronized to the CDN edge node, and the storage address of the audio and video files in the CDN edge node is The storage address of the signaling file in the cloud storage server is transmitted to the service processing module, so that the service processing module further stores the storage address of the audio and video file and the signaling file in the database.
  12. 一种流媒体回放方法,其特征在于,包括A streaming media playback method, characterized in that it comprises
    向流媒体回放服务器发送流媒体回放指令,以获取流媒体回放地址;Sending a streaming media playback instruction to the streaming media playback server to obtain a streaming media playback address;
    向流媒体回放服务器发送页面生成指令,以获取回放页面数据,以进一步形成回放页面;Sending a page generation instruction to the streaming media playback server to obtain playback page data to further form a playback page;
    向流媒体回放服务器发送流媒体加载指令,以获取流媒体文件的存储地址,以进一步根据所述流媒体文件的存储地址获取所述流媒体文件加载至所述回放页面。Sending a streaming media load instruction to the streaming media playback server to obtain a storage address of the streaming media file, to further acquire the streaming media file to be loaded into the playback page according to the storage address of the streaming media file.
  13. 根据权利要求12所述的流媒体回放方法,其特征在于,向流媒体回放服务器发送页面生成指令,以获取回放页面数据,以进一步形成回放页面包括:The streaming media playback method according to claim 12, wherein the sending the page generation instruction to the streaming media playback server to obtain the playback page data to further form the playback page comprises:
    向流媒体回放服务器发送页面生成指令,以获取流媒体回放服务器生成的HTML5页面数据,以进一步形成HTML5页面。Sending a page generation instruction to the streaming media playback server to obtain HTML5 page data generated by the streaming media playback server to further form an HTML5 page.
  14. 根据权利要求12所述的流媒体回放方法,其特征在于,所述流媒体文件包括音视频文件;The streaming media playback method according to claim 12, wherein the streaming media file comprises an audio and video file;
    向流媒体回放服务器发送流媒体加载指令,以获取流媒体文件的存储地址,以进一步根据所述流媒体文件的存储地址获取所述流媒体文件加载至所述回放页面包括:Sending a streaming media load instruction to the streaming media playback server to obtain a storage address of the streaming media file, to further obtain the streaming media file to be loaded into the playback page according to the storage address of the streaming media file, including:
    向流媒体回放服务器发送音视频文件请求,以获取流媒体回放服务器在数据库中查询的所述音视频文件的音视频存储地址;Sending an audio and video file request to the streaming media playback server to obtain an audio and video storage address of the audio and video file queried by the streaming media playback server in the database;
    根据所述音视频存储地址查找至对应的CDN边缘节点,并从所述CDN边缘节点中获取自云存储服务器同步的音视频文件并加载至所述回放页面。And searching for the corresponding CDN edge node according to the audio and video storage address, and acquiring an audio and video file synchronized from the cloud storage server from the CDN edge node and loading to the playback page.
  15. 根据权利要求12或14所述的流媒体回放方法,其特征在于,所述流媒体 文件包括信令文件;The streaming media playback method according to claim 12 or 14, wherein the streaming media file comprises a signaling file;
    向流媒体回放服务器发送流媒体加载指令,以获取流媒体文件的存储地址,以进一步根据所述流媒体文件的存储地址获取所述流媒体文件加载至所述回放页面包括:Sending a streaming media load instruction to the streaming media playback server to obtain a storage address of the streaming media file, to further obtain the streaming media file to be loaded into the playback page according to the storage address of the streaming media file, including:
    向流媒体回放服务器发送信令文件请求,以获取流媒体回放服务器在数据库中查询的所述信令文件的存储地址;Sending a signaling file request to the streaming media playback server to obtain a storage address of the signaling file queried by the streaming media playback server in the database;
    根据所述信令文件的存储地址获取云存储服务器中的信令文件并将该信令文件加载至所述回放页面。Acquiring a signaling file in the cloud storage server according to the storage address of the signaling file and loading the signaling file to the playback page.
  16. 根据权利要求15所述的流媒体回放方法,其特征在于,向流媒体回放服务器发送信令文件请求,以获取流媒体回放服务器在数据库中查询的所述信令文件的存储地址包括:The streaming media playback method according to claim 15, wherein the sending a signaling file request to the streaming media playback server to obtain the storage address of the signaling file queried by the streaming media playback server in the database comprises:
    向流媒体回放服务器发送信令文件请求,以使流媒体回放服务器在所述数据库中查询请求回放的流媒体文件的课程类型,并根据所述课程类型获取所述数据库中所述信令文件的存储地址。Sending a signaling file request to the streaming media playback server, so that the streaming media playback server queries the database for the course type of the streaming media file requested for playback, and acquires the signaling file in the database according to the course type. Storage address.
  17. 根据权利要求16所述的流媒体回放方法,其特征在于,所述课程类型为一对一授课、一对多授课或多对一授课。The streaming media playback method according to claim 16, wherein the course type is one-to-one lecture, one-to-many lecture, or many-to-one lecture.
  18. 根据权利要求12所述的流媒体回放方法,其特征在于,所述方法进一步包括:The streaming media playback method according to claim 12, wherein the method further comprises:
    向流媒体回放服务器发送流媒体上传请求;Sending a streaming media upload request to the streaming media playback server;
    向所述流媒体回放服务器发送原始媒体文件。The original media file is sent to the streaming playback server.
  19. 一种流媒体回放服务器,其特征在于,包括A streaming media playback server, characterized in that it comprises
    数据库,存储有流媒体文件的相关信息和存储地址;a database storing related information and a storage address of the streaming media file;
    信息转发模块,用于接收客户端发送的流媒体回放指令并将所述流媒体回放指令转发至应用处理模块;An information forwarding module, configured to receive a streaming media playback command sent by the client, and forward the streaming media playback instruction to the application processing module;
    应用处理模块,用于鉴权所述流媒体回放指令的合法性,输出合法的流媒体回放指令;An application processing module, configured to authenticate the legality of the streaming media playback instruction, and output a legal streaming media playback instruction;
    多个业务处理模块,用于接收所述合法的流媒体回放指令,在数据库中查找请求回放的流媒体文件的相关信息,并响应于数据库中存在所述流媒体文件的相关信息,向所述客户端发送流媒体回放地址,以使所述客户端形成回放页面;a plurality of service processing modules, configured to receive the legal streaming media playback instruction, search for related information of the streaming media file requested to be played back in the database, and respond to the related information of the streaming media file in the database, to the The client sends a streaming media playback address to cause the client to form a playback page;
    所述多个业务处理模块进一步用于从所述数据库中提取对应的流媒体文件的存 储地址并发送给所述客户端,以使所述客户端获取流媒体文件并加载至所述回放页面。The plurality of service processing modules are further configured to extract a storage address of the corresponding streaming media file from the database and send the storage address to the client, so that the client obtains the streaming media file and loads the playback media file.
  20. 根据权利要求19所述的流媒体回放服务器,其特征在于,所述应用处理模块进一步用于接收所述客户端根据所述流媒体回放地址发出的页面生成指令,生成回放页面数据并将所述回放页面数据发送给所述客户端,以使所述客户端生成回放页面。The streaming media playback server according to claim 19, wherein the application processing module is further configured to receive a page generation instruction sent by the client according to the streaming media playback address, generate playback page data, and The playback page data is sent to the client to cause the client to generate a playback page.
  21. 根据权利要求20所述的流媒体回放服务器,其特征在于,所述应用处理模块进一步用于接收客户端的所述页面生成指令,生成HTML5页面数据并将所述HTML5页面数据发送给所述客户端,以使客户端形成HTML5回放页面。The streaming media playback server according to claim 20, wherein the application processing module is further configured to receive the page generation instruction of the client, generate HTML5 page data, and send the HTML5 page data to the client. To allow the client to form an HTML5 playback page.
  22. 根据权利要求19所述的流媒体回放服务器,其特征在于,所述应用处理模块进一步用于定时向每个业务处理模块发送状态查询指令;The streaming media playback server according to claim 19, wherein the application processing module is further configured to periodically send a status query instruction to each service processing module;
    每个业务处理模块用于根据接收的所述状态查询指令向所述应用处理模块发回一个回复指令;Each service processing module is configured to send a reply instruction to the application processing module according to the received status query instruction;
    其中,所述应用处理模块进一步被配置为响应于所述业务处理模块未在指定时间内发回所述回复指令或发回错误指令,停止向该业务处理模块发送所述流媒体回放请求。The application processing module is further configured to stop sending the streaming media playback request to the service processing module in response to the service processing module not sending back the reply instruction or sending back an error instruction within a specified time.
  23. 根据权利要求19所述的流媒体回放服务器,其特征在于,所述流媒体文件包括音视频文件;The streaming media playback server according to claim 19, wherein the streaming media file comprises an audio and video file;
    所述多个业务处理模块用于基于客户端发送的音视频文件请求,在数据库中查询所述音视频文件的存储地址并将该音视频文件的存储地址发送给客户端,以使客户端根据所述音视频文件的存储地址从对应的CDN边缘节点中获取自云存储服务器同步的所述音视频文件并加载至所述回放页面。The plurality of service processing modules are configured to query, according to the audio and video file request sent by the client, the storage address of the audio and video file in a database, and send the storage address of the audio and video file to the client, so that the client The storage address of the audio and video file is obtained from the corresponding CDN edge node and the audio and video file synchronized from the cloud storage server is loaded and loaded to the playback page.
  24. 根据权利要求19或23所述的流媒体回放服务器,其特征在于,所述流媒体文件包括信令文件;The streaming media playback server according to claim 19 or 23, wherein the streaming media file comprises a signaling file;
    所述多个业务处理模块用于基于客户端发送的信令文件请求,在数据库中查询所述信令文件的存储地址并将该信令文件的存储地址发送给客户端,以使客户端获取云存储服务器中的信令文件并将该信令文件加载至所述回放页面。The multiple service processing modules are configured to query, according to a signaling file request sent by the client, a storage address of the signaling file in a database, and send the storage address of the signaling file to the client, so that the client obtains A signaling file in the cloud storage server and loading the signaling file to the playback page.
  25. 根据权利要求24所述的流媒体回放服务器,其特征在于,所述多个业务处理模块用于基于客户端发送的信令文件请求,在所述数据库中查询请求回放的信令文件的课程类型,并根据所述课程类型获取所述数据库中所述信令文件的存储地址。The streaming media playback server according to claim 24, wherein the plurality of service processing modules are configured to query, in the database, a course type of a signaling file requested for playback based on a signaling file request sent by a client. And obtaining, according to the course type, a storage address of the signaling file in the database.
  26. 根据权利要求25所述的流媒体回放服务器,其特征在于,所述课程类型为一对一授课、一对多授课或多对一授课。The streaming media playback server according to claim 25, wherein the course type is one-on-one, one-to-many, or many-to-one.
  27. 根据权利要求19所述的流媒体回放服务器,其特征在于,所述服务器进一步用于对客户端传输的原始媒体文件进行转码得到所述流媒体文件。The streaming media playback server according to claim 19, wherein the server is further configured to transcode the original media file transmitted by the client to obtain the streaming media file.
  28. 根据权利要求27所述的流媒体回放服务器,其特征在于,所述服务器进一步包括:The streaming media playback server of claim 27, wherein the server further comprises:
    消息队列模块,用于接收客户端的流媒体上传请求;a message queue module, configured to receive a streaming media upload request of the client;
    所述多个业务处理模块进一步用于获取所述流媒体上传请求,并根据所述流媒体上传请求从客户端中提取原始媒体文件,解析并序列化所述原始媒体文件得到原始数据文件;The plurality of service processing modules are further configured to obtain the streaming media upload request, and extract the original media file from the client according to the streaming media upload request, parse and serialize the original media file to obtain the original data file;
    多个数据缓存模块,用于接收并缓存所述业务处理模块传输的所述原始数据文件;a plurality of data caching modules, configured to receive and cache the original data file transmitted by the service processing module;
    多个视频转码模块,用于从所述数据缓存模块依次提取所述原始数据文件并反序列化得到所述原始媒体文件,将所述原始媒体文件转码形成所述流媒体文件,存储所述流媒体文件并返回所述流媒体文件的存储地址至所述多个业务处理模块,以使业务处理模块将所述存储地址存储于数据库中。a plurality of video transcoding modules, configured to sequentially extract the original data file from the data cache module and deserialize the original media file, and transcode the original media file to form the streaming media file, and store Deriving the media file and returning the storage address of the streaming media file to the plurality of service processing modules, so that the service processing module stores the storage address in a database.
  29. 根据权利要求28所述的流媒体回放服务器,其特征在于,所述流媒体文件包括音视频文件和信令文件;The streaming media playback server according to claim 28, wherein the streaming media file comprises an audio and video file and a signaling file;
    所述多个视频转码模块用于将所述流媒体文件存储于云存储服务器并将流媒体文件中的音视频文件同步至CDN边缘节点上,将CDN边缘节点中的音视频文件的存储地址以及云存储服务器中的信令文件的存储地址传输至所述业务处理模块,以使所述业务处理模块进一步将音视频文件和信令文件的存储地址存储于数据库中。The plurality of video transcoding modules are configured to store the streaming media file in a cloud storage server and synchronize the audio and video files in the streaming media file to a CDN edge node, and store the audio and video files in the CDN edge node. And storing, by the service processing module, the storage address of the signaling file in the cloud storage server, so that the service processing module further stores the storage address of the audio and video file and the signaling file in a database.
  30. 一种客户端,其特征在于,包括A client, characterized in that it comprises
    回放请求模块,用于向流媒体回放服务器发送流媒体回放指令,以获取流媒体回放地址;a playback request module, configured to send a streaming media playback instruction to the streaming media playback server to obtain a streaming media playback address;
    页面生成模块,用于向流媒体回放服务器发送页面生成指令,以获取回放页面数据,进一步形成回放页面;a page generating module, configured to send a page generating instruction to the streaming media playback server to obtain playback page data, further forming a playback page;
    数据加载模块,用于向流媒体回放服务器发送流媒体加载指令,以获取流媒体文件的存储地址,以进一步根据所述流媒体文件的存储地址获取所述流媒体文件加载至所述回放页面。And a data loading module, configured to send a streaming media loading instruction to the streaming media playback server to obtain a storage address of the streaming media file, to further acquire the streaming media file to be loaded into the playback page according to the storage address of the streaming media file.
  31. 根据权利要求30所述的客户端,其特征在于,所述页面生成模块进一步用于向流媒体回放服务器发送页面生成指令,以获取流媒体回放服务器生成的HTML5页面数据并发回,以进一步形成HTML5页面。The client according to claim 30, wherein the page generating module is further configured to send a page generation instruction to the streaming media playback server to obtain the HTML5 page data generated by the streaming media playback server and send back the data to further form the HTML5. page.
  32. 根据权利要求30所述的客户端,其特征在于,所述流媒体文件包括音视频文件;The client according to claim 30, wherein the streaming media file comprises an audio and video file;
    所述数据加载模块用于向流媒体回放服务器发送音视频文件请求,以获取流媒体回放服务器在数据库中查询的所述音视频文件的音视频存储地址;The data loading module is configured to send an audio and video file request to the streaming media playback server to obtain an audio and video storage address of the audio and video file queried by the streaming media playback server in the database;
    所述数据加载模块用于根据所述音视频存储地址查找至对应的CDN边缘节点,并从所述CDN边缘节点中获取自云存储服务器同步的音视频文件并加载至所述回放页面。The data loading module is configured to search for a corresponding CDN edge node according to the audio and video storage address, and acquire an audio and video file synchronized from the cloud storage server from the CDN edge node and load the file into the playback page.
  33. 根据权利要求30或32所述的客户端,其特征在于,所述流媒体文件包括信令文件;The client according to claim 30 or 32, wherein the streaming media file comprises a signaling file;
    所述数据加载模块用于向流媒体回放服务器发送信令文件请求,以获取流媒体回放服务器在数据库中查询的所述信令文件的存储地址;The data loading module is configured to send a signaling file request to the streaming media playback server to obtain a storage address of the signaling file that is queried by the streaming media playback server in the database;
    所述数据加载模块用于根据信令文件的存储地址获取云存储服务器中的信令文件并将该信令文件加载至所述回放页面。The data loading module is configured to acquire a signaling file in the cloud storage server according to the storage address of the signaling file and load the signaling file to the playback page.
  34. 根据权利要求33所述的客户端,其特征在于,所述数据加载模块进一步用于向流媒体回放服务器发送信令文件请求,以使流媒体回放服务器在所述数据库中查询请求回放的流媒体文件的课程类型,并根据所述课程类型获取所述数据库中所述信令文件的存储地址。The client according to claim 33, wherein the data loading module is further configured to send a signaling file request to the streaming media playback server, so that the streaming media playback server queries the database for streaming media requesting playback. The course type of the file, and the storage address of the signaling file in the database is obtained according to the course type.
  35. 根据权利要求34所述的客户端,其特征在于,所述课程类型为一对一授课、一对多授课或多对一授课。The client of claim 34, wherein the course type is one-on-one, one-to-many, or many-to-one.
  36. 根据权利要求30所述的客户端,其特征在于,进一步包括:The client according to claim 30, further comprising:
    转码请求模块,用于向流媒体回放服务器发送流媒体上传请求;a transcoding request module, configured to send a streaming media upload request to the streaming media playback server;
    其中,转码请求模块进一步用于向所述流媒体回放服务器发送原始媒体文件。The transcoding request module is further configured to send the original media file to the streaming media playback server.
PCT/CN2019/077226 2018-04-09 2019-03-06 Streaming media playback method, server, client and computer device WO2019196577A1 (en)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN201810311833.8A CN108600777B (en) 2018-04-09 2018-04-09 Streaming media playback server and client
CN201810312559.6 2018-04-09
CN201810312559.6A CN108737372B (en) 2018-04-09 2018-04-09 Streaming media playback method, computer equipment and readable medium
CN201810311833.8 2018-04-09

Publications (1)

Publication Number Publication Date
WO2019196577A1 true WO2019196577A1 (en) 2019-10-17

Family

ID=68163053

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/077226 WO2019196577A1 (en) 2018-04-09 2019-03-06 Streaming media playback method, server, client and computer device

Country Status (1)

Country Link
WO (1) WO2019196577A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111814687A (en) * 2020-07-10 2020-10-23 苏州数智源信息技术有限公司 Flight support node intelligent identification system
CN112351564A (en) * 2020-11-19 2021-02-09 青岛易来智能科技股份有限公司 Light control method, system and coding method
CN112954444A (en) * 2021-02-03 2021-06-11 北京大米科技有限公司 Method and device for loading signaling file, storage medium and electronic equipment
CN114554286A (en) * 2021-12-09 2022-05-27 武汉众智数字技术有限公司 Audio and video data processing method and system based on GB35114

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102393854A (en) * 2011-09-09 2012-03-28 杭州海康威视数字技术股份有限公司 Method and device obtaining audio/video data
CN102447681A (en) * 2010-10-13 2012-05-09 中兴通讯股份有限公司 Monitoring client sub-system, video monitoring system and video replaying method
CN105407379A (en) * 2014-08-26 2016-03-16 天脉聚源(北京)教育科技有限公司 Synchronous recording method for multiple media
CN106685942A (en) * 2016-12-20 2017-05-17 徐亮 Video live and replaying system and video live and replaying method
US20170310752A1 (en) * 2016-04-21 2017-10-26 Samsung Electronics Company, Ltd. Utilizing a Content Delivery Network as a Notification System
CN107517240A (en) * 2016-06-17 2017-12-26 上海理优教育科技有限公司 Intelligent terminal online education platform
CN108600777A (en) * 2018-04-09 2018-09-28 北京大米科技有限公司 A kind of stream media playback server, client
CN108737372A (en) * 2018-04-09 2018-11-02 北京大米科技有限公司 A kind of stream media playback method, computer equipment and readable medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102447681A (en) * 2010-10-13 2012-05-09 中兴通讯股份有限公司 Monitoring client sub-system, video monitoring system and video replaying method
CN102393854A (en) * 2011-09-09 2012-03-28 杭州海康威视数字技术股份有限公司 Method and device obtaining audio/video data
CN105407379A (en) * 2014-08-26 2016-03-16 天脉聚源(北京)教育科技有限公司 Synchronous recording method for multiple media
US20170310752A1 (en) * 2016-04-21 2017-10-26 Samsung Electronics Company, Ltd. Utilizing a Content Delivery Network as a Notification System
CN107517240A (en) * 2016-06-17 2017-12-26 上海理优教育科技有限公司 Intelligent terminal online education platform
CN106685942A (en) * 2016-12-20 2017-05-17 徐亮 Video live and replaying system and video live and replaying method
CN108600777A (en) * 2018-04-09 2018-09-28 北京大米科技有限公司 A kind of stream media playback server, client
CN108737372A (en) * 2018-04-09 2018-11-02 北京大米科技有限公司 A kind of stream media playback method, computer equipment and readable medium

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111814687A (en) * 2020-07-10 2020-10-23 苏州数智源信息技术有限公司 Flight support node intelligent identification system
CN112351564A (en) * 2020-11-19 2021-02-09 青岛易来智能科技股份有限公司 Light control method, system and coding method
CN112954444A (en) * 2021-02-03 2021-06-11 北京大米科技有限公司 Method and device for loading signaling file, storage medium and electronic equipment
CN112954444B (en) * 2021-02-03 2023-04-07 北京大米科技有限公司 Method and device for loading signaling file, storage medium and electronic equipment
CN114554286A (en) * 2021-12-09 2022-05-27 武汉众智数字技术有限公司 Audio and video data processing method and system based on GB35114
CN114554286B (en) * 2021-12-09 2023-12-15 武汉众智数字技术有限公司 GB 35114-based audio and video data processing method and system

Similar Documents

Publication Publication Date Title
CN108600777B (en) Streaming media playback server and client
WO2019196577A1 (en) Streaming media playback method, server, client and computer device
CN108737372B (en) Streaming media playback method, computer equipment and readable medium
US11252444B2 (en) Video stream processing method, computer device, and storage medium
US11272257B2 (en) Method and apparatus for pushing subtitle data, subtitle display method and apparatus, device and medium
US7085842B2 (en) Line navigation conferencing system
US10135887B1 (en) Shared multimedia annotations for group-distributed video content
US20100268694A1 (en) System and method for sharing web applications
US20090244372A1 (en) Method and system for closed caption processing
JP2020119497A (en) Live streaming segmentation method, apparatus and system
WO2020199304A1 (en) Method, apparatus and system for synchronously playing message stream and audio/video stream
US11140422B2 (en) Thin-cloud system for live streaming content
WO2021159770A1 (en) Video playback method, device, apparatus, and storage medium
EP3055761B1 (en) Framework for screen content sharing system with generalized screen descriptions
WO2023093322A1 (en) Live broadcast method and device
US20230294001A1 (en) Content stream processing
US20170171579A1 (en) Method and Device for Transcoding Live Video
US20240179221A1 (en) Mitigating network resource contention
US20240039663A1 (en) Optimized kernel for concurrent streaming sessions
US20230283813A1 (en) Centralized streaming video composition
WO2019210667A1 (en) Screen image transmission method, device, server and storage medium
CN114938443B (en) Streaming media-based real-time scoring method for experimental real-time examination
CN110650159A (en) Multi-person interactive online teaching method, device and system
US11575528B1 (en) Dynamic virtual meeting, online webinar and distance-based education systems and methods
KR101247133B1 (en) Media contents streaming method and system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19784784

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19784784

Country of ref document: EP

Kind code of ref document: A1