CN113315810B - Online audio playing method and equipment - Google Patents

Online audio playing method and equipment Download PDF

Info

Publication number
CN113315810B
CN113315810B CN202110475963.7A CN202110475963A CN113315810B CN 113315810 B CN113315810 B CN 113315810B CN 202110475963 A CN202110475963 A CN 202110475963A CN 113315810 B CN113315810 B CN 113315810B
Authority
CN
China
Prior art keywords
audio
playing
target
file
cache region
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110475963.7A
Other languages
Chinese (zh)
Other versions
CN113315810A (en
Inventor
邓旭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Search Information Technology Co ltd
Original Assignee
Shanghai Search Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Search Information Technology Co ltd filed Critical Shanghai Search Information Technology Co ltd
Priority to CN202110475963.7A priority Critical patent/CN113315810B/en
Publication of CN113315810A publication Critical patent/CN113315810A/en
Application granted granted Critical
Publication of CN113315810B publication Critical patent/CN113315810B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/60Information retrieval; Database structures therefor; File system structures therefor of audio data
    • G06F16/63Querying
    • G06F16/638Presentation of query results
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application aims at providing an online audio playing method and equipment, wherein an audio cache region is established in an existing executable memory of playing equipment, and the playing equipment further comprises an audio player and a playing cache region corresponding to the audio player; downloading a target audio file from a target server to the audio cache region in a segmented manner in a breakpoint continuous transmission manner, and writing the file content of the downloaded target audio file in the audio cache region into a playing cache region according to the segmented sequence of the breakpoint continuous transmission manner when the audio cache region is full; the file contents of the playing cache region are played in sequence through the audio player, so that the playing equipment with low hardware configuration can play rich audio resources on line under the condition of not downloading or storing complete audio files.

Description

Online audio playing method and equipment
Technical Field
The present application relates to the field of computers, and in particular, to an online audio playing method and device.
Background
Aiming at the equipment with short hardware resources (such as small RAM and small Flash), a software platform is RTOS (real time operating system) and does not support a mature streaming media playing protocol, the equipment cannot completely download or store one or more audio resources (usually, an MP3 with good tone quality needs at least 2-3 MB of storage space), and for small Flash equipment (such as only a few MB-dozen MB of storage space), the complete audio resources cannot be downloaded or stored in most cases, so that good audio playing service cannot be provided for users, therefore, a simple and practical online audio playing technology is considered to be realized, and the equipment can realize rich online audio resource playing without downloading or storing complete audio files.
Disclosure of Invention
An object of the present application is to provide an online audio playing method and device, so as to implement that a playing device with low hardware configuration can play rich audio resources online without downloading or saving a complete audio file.
According to an aspect of the present application, an online audio playing method is provided, which is applied to a playing device side, wherein the method includes:
establishing an audio buffer area in an existing executable memory of the playing device, wherein the playing device further comprises an audio player and a playing buffer area corresponding to the audio player;
downloading a target audio file from a target server to the audio cache region in a segmented manner in a breakpoint continuous transmission manner, and writing the file content of the downloaded target audio file in the audio cache region into a playing cache region according to the segmented sequence of the breakpoint continuous transmission manner when the audio cache region is full;
and playing the file contents of the playing buffer area in sequence through the audio player.
Further, the above online audio playing method based on low hardware configuration further includes, before establishing an audio buffer in an existing executable memory of the playing device:
acquiring the highest play code rate which can be supported by the play equipment;
determining a first preset cache length of the audio cache region according to the highest playing code rate;
wherein, the establishing an audio buffer area in the existing executable memory of the playing device includes:
and correspondingly creating an audio cache region with the first preset cache length in an existing executable memory of the playing device.
Further, the above online audio playing method based on low hardware configuration further includes, before establishing an audio buffer in an existing executable memory of the playing device:
acquiring the playing code rate of each audio file in all the audio files;
determining different playing levels of the playing code rate according to the playing code rate of each audio file;
determining different second preset cache lengths of the audio cache regions corresponding to different playing levels;
wherein, the establishing an audio buffer area in the existing executable memory of the playing device includes:
acquiring a target playing code rate of the target audio file;
determining a target playing level to which the target playing code rate belongs;
and correspondingly creating an audio cache region with a second preset cache length of the target corresponding to the target playing level in the existing executable memory of the playing device.
Further, in the above online audio playing method based on low hardware configuration, when the audio buffer is full, after writing the file content of the downloaded target audio file in the audio buffer into the playing buffer according to the segmentation sequence performed in the breakpoint resuming manner, the method further includes:
judging whether the residual memory of the audio cache region reaches a preset memory threshold value in real time,
if yes, continuously downloading the residual file content of the target audio file from the target server to the audio cache region in a segmented manner in a breakpoint continuous transmission mode until the audio cache region is full or the target audio file is completely downloaded.
Further, the above online audio playing method based on low hardware configuration further includes:
monitoring the downloading rate of the target audio file from the server in a segmented manner;
determining whether the download rate is less than a preset download rate threshold,
and if so, sending a network connection request to a server storing the target audio file.
Further, the method for playing the online audio based on the low-hardware configuration, where the sending a network connection request to the server storing the target audio file includes:
and sending the network connection request to the target server.
Further, the method for playing the online audio based on the low-hardware configuration, where the sending a network connection request to the server storing the target audio file includes:
and sending the network connection request to a target history server in a plurality of history servers cached in the playing device.
According to another aspect of the present application, there is also provided a non-volatile storage medium having computer-readable instructions stored thereon, which, when executed by a processor, cause the processor to implement the above-mentioned online audio playing method.
According to another aspect of the present application, there is also provided an online audio playing device, wherein the device includes:
one or more processors;
a non-volatile storage medium for storing one or more computer-readable instructions,
when executed by the one or more processors, cause the one or more processors to implement an online audio playback method as described above.
Compared with the prior art, the method and the device have the advantages that an audio cache region is established in the existing executable memory of the playing device, and the playing device further comprises an audio player and a playing cache region corresponding to the audio player; downloading a target audio file from a target server to the audio cache region in a segmented manner in a breakpoint continuous transmission manner, and writing the file content of the downloaded target audio file in the audio cache region into a playing cache region according to the segmented sequence of the breakpoint continuous transmission manner when the audio cache region is full; the file contents of the playing cache region are played in sequence through the audio player, so that the playing equipment with low hardware configuration can play rich audio resources on line under the condition of not downloading or storing complete audio files.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 illustrates a flow diagram of a method of online audio playback, according to one aspect of the subject application;
FIG. 2 illustrates a block diagram of a method of online audio playback, according to an aspect of the subject application;
FIG. 3 illustrates a network monitoring diagram of an online audio playback method in accordance with an aspect of the subject application.
The same or similar reference numbers in the drawings identify the same or similar elements.
Detailed Description
The present application is described in further detail below with reference to the attached figures.
In a typical configuration of the present application, the terminal, the device serving the network, and the trusted party each include one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both permanent and non-permanent, removable and non-removable media, may implement the information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include non-transitory computer readable media (transient media), such as modulated data signals and carrier waves.
As shown in fig. 1, a flow diagram of an online audio playing method according to an aspect of the present application is shown. The online audio playing method is applied to a playing device, and comprises the following steps: step S11, step S12, and step S13, specifically including the steps of:
step S11, an audio buffer area is established in an existing executable memory of the playing equipment, and the playing equipment further comprises an audio player and a playing buffer area corresponding to the audio player; here, the audio buffer is a continuous block of Memory space applied in an existing executable Memory (i.e., random Access Memory (RAM)), which is referred to as a cache, and the implementation manner includes, but is not limited to, dynamically applying for N Bytes of Memory space through a Memory application interface of a real-time operating system RTOS, for example, through a malloc (i.e., dynamically allocating Memory) function, or determining a Byte type as a static array with a length of N, where the Byte type is a data type, and the applicable system includes, but is not limited to, an RTOS system, and is also applicable to a non-RTOS system and a system supporting a larger RAM and a larger Flash; and after the audio buffer area is established, controlling the addition and elimination of data in the audio buffer in a management mode of a circular queue.
Step S12, downloading a target audio file from a target server to the audio cache region in a segmented manner in a breakpoint continuous transmission manner, and writing the file content of the downloaded target audio file in the audio cache region into a playing cache region according to the segmented sequence performed in the breakpoint continuous transmission manner when the audio cache region is full; here, the GET method in the Hypertext Transfer Protocol (HTTP) or the Hyper Text Transfer Protocol over secure session Layer (HTTPs) may specify the start position and length characteristics of the file content to be acquired, so that the target audio file is segmented from the target server and presented in the audio cache region, and breakpoint resume may be performed.
In step S12, a File Transfer Protocol (FTP) is used in the breakpoint resuming, and the FTP client software breakpoint resuming refers to that, during downloading or uploading, a downloading or uploading task (a File or a compressed packet) is artificially divided into several parts, each part is uploaded or downloaded by using a thread, and if a network failure occurs, the uncompleted part can be uploaded or downloaded from the uploaded or downloaded part without uploading or downloading from the beginning, so that the user can save time and increase speed.
And step S13, playing the file contents of the playing buffer area in sequence through the audio player. Here, the file contents of the play buffer are played by the audio player in the order written from the audio buffer to the play buffer.
Through the steps S11 to S13, the present application establishes an audio buffer area in an existing executable memory of a playing device, where the playing device further includes an audio player and a playing buffer area corresponding to the audio player; downloading a target audio file from a target server to the audio cache region in a segmented manner in a breakpoint continuous transmission manner, and writing the file content of the downloaded target audio file in the audio cache region into a playing cache region according to the segmented sequence of the breakpoint continuous transmission manner when the audio cache region is full; the file contents of the playing cache region are played in sequence through the audio player, so that the playing equipment with low hardware configuration can play rich audio resources on line under the condition of not downloading or storing complete audio files.
For example, in a preferred embodiment of the present application, a continuous memory space is applied in an executable memory RAM of a playing device with a low hardware configuration as an audio buffer, and data addition and elimination in the audio buffer are controlled by a management manner of a circular queue, and a target audio file is downloaded from a target server to the audio buffer, where when the target audio file is downloaded, file contents with specified start positions and length characteristics may be downloaded from the target server by a GET method in an HTTP (or HTTPs) protocol, so that the target audio file is downloaded to the audio buffer in segments, when the audio buffer is full, the file contents of the target audio file that has been downloaded from the audio buffer are written to the playing buffer in the order of downloading from the target server to the audio buffer, so that an audio player in the playing device plays the file contents in the playing buffer, and when the audio player plays the file in the playing buffer, the file contents in the playing buffer are written in the order, and the audio player plays the file in the playing buffer, and the playing of the audio file in the audio buffer is performed without interruption, and the playing card is not written into the playing card in the playing buffer.
Next, in the above embodiment of the present application, before the step S11 establishes an audio buffer in an existing executable memory of the playback device, the method further includes:
acquiring the highest play code rate which can be supported by the play equipment;
determining a first preset cache length of the audio cache region according to the highest playing code rate;
it should be noted that, establishing an audio buffer area in an existing executable memory of a playing device may be implemented by, for example, predicting an upper limit of a playing code rate of an audio file that can be supported by the playing device (i.e., a supportable highest playing code rate), and then setting a fixed first preset buffer length according to the highest playing code rate of the audio file that can be supported by the playing device, so that the audio buffer area may be established in the existing executable memory of the playing device according to the first preset buffer length.
Wherein, the establishing an audio buffer area in the existing executable memory of the playing device includes:
and correspondingly creating an audio cache region with the first preset cache length in an existing executable memory of the playing device.
In order to save resources for adjusting the cache length of the audio cache region by the playing device, before the audio cache region is established in the existing executable memory of the playing device, the highest play code rate which can be supported by the playing device can be directly obtained, and then the first preset cache length of the audio cache region is determined according to the highest play code rate, so that when the target audio file with any play code rate is obtained and needs to be played and cached later, the audio cache region for the target audio file to be cached can be correspondingly established in the existing executable memory of the playing device directly according to the first preset cache length, and the cache length of the audio cache region is the first preset cache length, thereby not only saving the resources for calculating the cache length of the created audio cache region each time, but also meeting the highest play code rate which can be supported by the playing device, and meeting the play requirements of users as much as possible.
In a preferred embodiment of the present application, the highest play code rate may be a highest play code rate of any size that can be supported by a playing device, and the maximum time that can be supported by the playing device under the current highest play code rate is determined according to the highest play code rate, in the present application, the supportable highest play code rate is preferably 300kbps, if the maximum time that can be supported by the playing device when the highest play code rate is 300kbps is 30s, a first preset buffer length is determined according to the highest play code rate 300kbps, and an audio buffer corresponding to the first preset buffer length is established in an existing executable memory of the playing device, for example, the size of the audio buffer is 300kbps 30s/8=1125kb.
Next, in the foregoing embodiments of the present application, before establishing an audio buffer in an existing executable memory of a playback device, the method further includes:
acquiring the playing code rate of each audio file in all the audio files;
determining different playing levels of the playing code rate according to the playing code rate of each audio file;
determining different second preset cache lengths of the audio cache regions corresponding to different playing levels;
it should be noted that, an audio buffer is established in the existing executable memory of the playing device, and may also be implemented in the following manner, before each audio file is downloaded from the server, an audio buffer needs to be established in the existing executable memory of the playing device, before the audio file needs to be downloaded from the server next time, the audio buffer that has been established last time is released first, and the audio buffer is established according to the step of establishing the audio buffer each time; further, the playing code rate of each audio file is obtained, different playing levels of the playing code rate are determined according to the playing code rate of each audio file, wherein the presentation form of the playing level includes but is not limited to a buffer area or a specific buffer length value, and different second preset buffer lengths are determined according to different playing levels, so that different playing code rates can be matched with and create audio buffer areas with different buffer lengths, and the buffer requirements of different playing code rates in an actual application scene are met.
Wherein, the establishing an audio buffer area in the existing executable memory of the playing device includes:
acquiring a target playing code rate of the target audio file;
determining a target playing level to which the target playing code rate belongs;
and correspondingly creating an audio cache region with a second preset cache length of the target corresponding to the target playing level in the existing executable memory of the playing device.
In order to save space resources of an executable memory in a playing device, before an audio buffer is established in an existing executable memory of the playing device, a target playing code rate of a target audio file to be downloaded at the current time can be obtained before the target audio file is played, a playing level of the current time is determined according to the target playing code rate of the target audio file at the current time, a target second preset buffer length of the current time is determined according to the playing level of the current time, the audio buffer of the current time is established in the existing executable memory of the playing device according to the target second preset buffer length, and the buffer length of the audio buffer is the second preset buffer length, so that occupation of the space of the executable memory in the playing device can be reduced as much as possible, smoothness of playing of the audio file can be guaranteed, and buffer requirements of different playing code rates can be met.
For example, in a preferred embodiment of the present application, the target playing bitrate of the target audio file to be played each time may include any size, and a time length corresponding to the target playing bitrate of the target audio file is preset, where the time length may include any value, in this application, the target playing bitrate of the current target audio file is preferably 50kbps, and the preset time length is 30s, a second preset buffer length is determined when the playing bitrate of the 30s time length is 50kbps, and an audio buffer area corresponding to the second preset buffer length is established in an existing executable memory of the playing device, where the size of the audio buffer area is 50kbps 30s/8=187.5kb.
Next to the foregoing embodiment of the present application, in step S12, when the audio buffer is full, after writing the file content of the downloaded target audio file in the audio buffer into a play buffer according to the segmentation sequence performed in the breakpoint resuming manner, the method further includes:
judging whether the residual memory of the audio cache region reaches a preset memory threshold value in real time, wherein the preset memory threshold value comprises but is not limited to any memory value;
if yes, continuously downloading the residual file content of the target audio file from the target server to the audio cache region in a segmented manner in a breakpoint continuous transmission mode until the audio cache region is full or the target audio file is completely downloaded.
As shown in fig. 2, when the audio buffer is full, after the file content of the downloaded target audio file in the audio buffer is written into the play buffer in a segmented sequence according to the breakpoint continuous transmission manner, it is further required to determine whether the remaining memory of the audio buffer reaches a preset memory threshold in real time. The real-time judgment is to know the cache residue in the audio cache region in time so as to download the file content of the target audio file from the server to the audio cache region in time, thereby ensuring the fluency of subsequent playing; the preset memory threshold represents the consumption of the file content of the downloaded target audio file in the audio cache region, the larger the preset memory threshold is, the more the consumption of the file content of the downloaded target audio file is, and the smaller the preset memory threshold is, the less the consumption of the file content of the downloaded target audio file is; the preset memory threshold may be set according to different conditions of a network, for example, in a case that a network condition is good, the preset memory threshold may be set to be larger, because if the network condition is good, even if the file content consumption of the downloaded target audio file is relatively large, the file content consumption of the downloaded target audio file may be supplemented, and in a case that the network condition is poor, the preset memory threshold may be set to be smaller, because if the network condition is poor, in order to timely supplement the file content consumption of the downloaded target audio file in the audio cache region, it is avoided that the playing speed is blocked because the consumption speed of the file content of the downloaded target audio file is greater than the downloading speed from the server, the preset memory threshold needs to be set to be smaller.
If the real-time judgment result is: and if the residual memory of the audio cache region reaches a preset memory threshold value, continuously downloading the residual file content of the target audio file from the target server to the audio cache region in a segmented manner in a breakpoint continuous transmission manner until the audio cache region is full or the target audio file is completely downloaded, so as to avoid the problems that the audio file cannot be downloaded in time and the playing is blocked or the playing quality is poor and the like caused by the fact that the file content cached in the audio cache region is completely written into the playing cache region, and ensure smooth playing of the audio player. If the real-time judgment result is: and if the residual memory of the audio cache region does not reach the preset memory threshold value, continuously writing the file contents of the target audio file cached in the audio cache region into the playing cache region in sequence, and temporarily not continuously downloading the residual file contents of the target audio file from the target server to the audio cache region.
For example, in a preferred embodiment of the present application, if the mobile terminal is in a network with a faster network speed such as 4G, a preset memory threshold may be set to 2/3 of the size of an audio cache region, the size of the remaining memory of the audio cache region is determined in real time, and if the size of the remaining memory reaches 2/3 of the size of the preset cache region, the remaining file content of the target audio file is downloaded from the target server to the audio cache region in a segmented manner in a breakpoint continuous manner until the audio cache region is full or the target audio file is completely downloaded, so as to avoid that the audio file cannot be downloaded in time after the file content cached in the audio cache region is completely written into the play cache region, which may cause problems of stutter of play or poor play quality, and so as to ensure smooth play of the audio player; if the size of the residual memory does not reach 2/3 of the size of the preset cache region, continuously writing the file contents of the target audio files cached in the audio cache region into the playing cache region in sequence, and temporarily not continuously downloading the residual file contents of the target audio files from the target server to the audio cache region.
For another example, in a preferred embodiment of the present application, if the network is in a network with a slow network speed such as 2G, 3G, etc., the preset memory threshold may be set to 1/3 of the size of the audio buffer, the size of the remaining memory of the audio buffer is determined in real time, and if the size of the remaining memory reaches 1/3 of the size of the preset buffer, the remaining file content of the target audio file is downloaded to the audio buffer in a segmented manner from the target server by using a breakpoint continuous transmission manner until the audio buffer is full or the target audio file is completely downloaded, so as to avoid the problem that the audio file cannot be downloaded in time and the problem of a play card is not played or the play quality is not good after the file content cached in the audio buffer is completely written into the play buffer, thereby ensuring smooth play of the audio player; if the size of the residual memory does not reach 1/3 of the size of the preset cache region, the file contents of the target audio files cached in the audio cache region are continuously written into the playing cache region in sequence, and the residual file contents of the target audio files do not need to be continuously downloaded from the target server to the audio cache region temporarily.
Following the above embodiments of the present application, wherein the method further comprises:
monitoring the downloading rate of the target audio file from the server in a segmented manner;
and judging whether the download rate is smaller than a preset download rate threshold, wherein the preset download rate threshold can be set according to different conditions of the network, if the network is in a high-speed network, the preset download rate threshold can be set to be relatively larger, and if the network is in a low-speed network, the client sets the preset download rate threshold to be relatively smaller.
And if so, sending a network connection request to a server storing the target audio file.
As shown in fig. 3, during the process of caching and playing by the playing device, it is further required to monitor the download rate of the target audio file from the server in a segment manner; in a preferred embodiment of the present application, the network monitoring function of the playing device is implemented by a code or the like, and then the timer triggering function is implemented by a timer mechanism of the RTOS itself, and a timer is set to trigger the network monitoring function of the playing device at a fixed time, so as to be able to monitor the downloading rate of the target audio file from the server in a segmented manner at a fixed time.
As shown in fig. 3, after the download rate of the target audio file is monitored, it is determined whether the download rate is less than a preset download rate threshold,
if so, sending a network connection request to a server storing the target audio file, and if not, not interfering the caching and playing of the playing equipment so as to monitor the downloading rate of the target audio file to be performed next time.
Here, the download rate includes, but is not limited to, the speed, the flow rate, the time delay, etc. of the data received by the playback device from the server, i.e. the number of bytes transmitted from the server to the playback device in a unit time (usually within 1 second, but not limited in this application); after a network monitoring function is started, monitoring the number of bytes transmitted from a server to a playing device in unit time, if the number of bytes is continuously N seconds (in order to judge the downloading speed in time, the value of N is as low as 10 seconds as possible, but the downloading speed is not limited in the application), the downloading speed is lower than the preset downloading speed threshold, the connection between the playing device and the current server can be considered to have a problem, the server storing the target audio file can be actively reconnected, wherein the server storing the target audio file can be the currently connected server or other servers storing the target audio file, so that the situation that the speed cannot be recovered after the same server is reconnected is avoided, the playing device and the server recover a normal connection state, and the downloading speed of data is guaranteed; if the playing device has reconnected with the server for many times, that is, if the connection frequency of the playing device and the server is too high, it indicates that the current network condition is unstable, the time interval of the timer can be adjusted, and the interval time is appropriately shortened, so that the network monitoring is more accurate.
For example, in a preferred embodiment of the present application, if the preset download rate threshold is 100KB/s, the network monitoring function is started, and the number of bytes transmitted from the server to the playback device per second is detected, and if the download rate threshold is 5s continuously, the rate is lower than 100KB/s, it may be considered that there is a problem in connection between the playback device and the current server at this time, and therefore the playback device needs to actively reconnect to the current server, or reconnect to another server storing the target audio file, so that the playback device and the server recover to a normal connection state, thereby ensuring the download rate of data.
Next, in the foregoing embodiments of the present application, the sending a network connection request to a server storing the target audio file includes:
and sending the network connection request to the target server.
For example, when the download rate is less than the preset download threshold, the playback device may send a network connection request to the current target server again, so as to recover the normal connection state between the playback device and the target server, and ensure the data transmission rate between the playback device and the target server.
Following the above-mentioned embodiments of the present application, the sending a network connection request to a server storing the target audio file includes:
and sending the network connection request to a target history server in a plurality of history servers cached in the playing device. Here, when the network connection request is resent, if the IP addresses of the plurality of servers are cached before, one of the IP addresses of the plurality of servers cached before may be reselected for connection, which may avoid performing domain name resolution for each connection, thereby speeding up the speed of the playback device obtaining data from the server, and improving the fluency of obtaining the file content of the audio file and the user experience.
For example, when the download rate is less than the preset download threshold, if the IP addresses of the servers are cached before, the playback device may reselect one of the IP addresses cached before to send the network connection request, so as to avoid a situation that the download rate cannot be recovered after reconnecting the same server.
According to another aspect of the present application, there is also provided a non-volatile storage medium having computer-readable instructions stored thereon, which, when executed by a processor, cause the processor to implement the above-mentioned online audio playing method.
According to another aspect of the present application, there is also provided an online audio playing device, wherein the device includes:
one or more processors;
a non-volatile storage medium for storing one or more computer-readable instructions,
when executed by the one or more processors, cause the one or more processors to implement an online audio playback method as described above.
Here, for details of each embodiment of the online audio playing device, reference may be specifically made to corresponding parts of the embodiment of the online audio playing method, and details are not described herein again.
In summary, the present application establishes an audio buffer area in an existing executable memory of a playing device, where the playing device further includes an audio player and a playing buffer area corresponding to the audio player; downloading a target audio file from a target server to the audio cache region in a segmented manner in a breakpoint continuous transmission manner, and writing the file content of the downloaded target audio file in the audio cache region into a playing cache region according to the segmented sequence of the breakpoint continuous transmission manner when the audio cache region is full; the file contents of the playing cache region are played in sequence through the audio player, so that the playing equipment with low hardware configuration can play rich audio resources on line under the condition of not downloading or storing complete audio files.
It should be noted that the present application may be implemented in software and/or a combination of software and hardware, for example, as an Application Specific Integrated Circuit (ASIC), a general purpose computer or any other similar hardware device. In one embodiment, the software programs of the present application may be executed by a processor to implement the steps or functions described above. Likewise, the software programs (including associated data structures) of the present application may be stored in a computer readable recording medium, such as RAM memory, magnetic or optical drive or diskette and the like. Additionally, some of the steps or functions of the present application may be implemented in hardware, for example, as circuitry that cooperates with the processor to perform various steps or functions.
Additionally, some portions of the present application may be applied as a computer program product, such as computer program instructions, which, when executed by a computer, may invoke or provide the method and/or solution according to the present application through the operation of the computer. Program instructions which invoke the methods of the present application may be stored on a fixed or removable recording medium and/or transmitted via a data stream on a broadcast or other signal-bearing medium and/or stored within a working memory of a computer device operating in accordance with the program instructions. An embodiment according to the present application comprises an apparatus comprising a memory for storing computer program instructions and a processor for executing the program instructions, wherein the computer program instructions, when executed by the processor, trigger the apparatus to perform a method and/or a solution according to the aforementioned embodiments of the present application.
It will be evident to those skilled in the art that the present application is not limited to the details of the foregoing illustrative embodiments, and that the present application may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the application being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned. Furthermore, it will be obvious that the term "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the apparatus claims may also be implemented by one unit or means in software or hardware. The terms first, second, etc. are used to denote names, but not any particular order.

Claims (9)

1. An on-line audio playing method is applied to a playing device, wherein,
the method comprises the following steps:
establishing an audio buffer area in an existing executable memory of playing equipment, and controlling the addition and elimination of data in the audio buffer area in a management mode of a circular queue, wherein the playing equipment also comprises an audio player and a playing buffer area corresponding to the audio player;
downloading a target audio file from a target server to the audio cache region in a segmented manner in a breakpoint continuous transmission manner, and writing the file content of the downloaded target audio file in the audio cache region into a playing cache region according to the segmented sequence of the breakpoint continuous transmission manner when the audio cache region is full;
and playing the file contents of the playing buffer area in sequence through the audio player.
2. The method of claim 1, wherein,
before an audio buffer is established in an existing executable memory of the playing device, the method further includes:
acquiring the highest play code rate which can be supported by the play equipment;
determining a first preset cache length of the audio cache region according to the highest playing code rate;
wherein, the establishing an audio buffer area in the existing executable memory of the playing device includes:
and correspondingly creating an audio cache region with the first preset cache length in an existing executable memory of the playing device.
3. The method of claim 1, wherein,
before an audio buffer is established in an existing executable memory of the playing device, the method further includes:
acquiring the playing code rate of each audio file in all the audio files;
determining different playing levels of the playing code rate according to the playing code rate of each audio file;
determining different second preset cache lengths of the audio cache regions corresponding to different playing levels;
wherein, the establishing an audio buffer area in the existing executable memory of the playing device includes:
acquiring a target playing code rate of the target audio file;
determining a target playing level to which the target playing code rate belongs;
and correspondingly creating an audio cache region with a second preset cache length of the target corresponding to the target playing level in the existing executable memory of the playing device.
4. The method of any one of claims 1 to 3,
after the file content of the downloaded target audio file in the audio buffer is written into the playing buffer according to the segmentation sequence performed in the breakpoint resuming manner when the audio buffer is full, the method further includes:
judging whether the residual memory of the audio cache region reaches a preset memory threshold value in real time,
if yes, continuously downloading the residual file content of the target audio file from the target server to the audio cache region in a segmented manner in a breakpoint continuous transmission mode until the audio cache region is full or the target audio file is completely downloaded.
5. The method of any one of claims 1 to 3,
the method further comprises the following steps:
monitoring the downloading rate of the target audio file from the server in a segmented manner;
determining whether the download rate is less than a preset download rate threshold,
and if so, sending a network connection request to a server storing the target audio file.
6. The method of claim 5, wherein,
the sending a network connection request to a server storing the target audio file includes:
and sending the network connection request to the target server.
7. The method of claim 5, wherein,
the sending a network connection request to a server storing the target audio file includes:
and sending the network connection request to a target history server in a plurality of history servers cached in the playing device.
8. A non-transitory storage medium having stored thereon computer readable instructions which, when executed by a processor, cause the processor to implement the method of any one of claims 1 to 7.
9. An online audio playing device based on low-hardware configuration, wherein,
the apparatus comprises:
one or more processors;
a non-volatile storage medium for storing one or more computer-readable instructions,
the one or more computer readable instructions, when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-7.
CN202110475963.7A 2021-04-29 2021-04-29 Online audio playing method and equipment Active CN113315810B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110475963.7A CN113315810B (en) 2021-04-29 2021-04-29 Online audio playing method and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110475963.7A CN113315810B (en) 2021-04-29 2021-04-29 Online audio playing method and equipment

Publications (2)

Publication Number Publication Date
CN113315810A CN113315810A (en) 2021-08-27
CN113315810B true CN113315810B (en) 2023-04-07

Family

ID=77371790

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110475963.7A Active CN113315810B (en) 2021-04-29 2021-04-29 Online audio playing method and equipment

Country Status (1)

Country Link
CN (1) CN113315810B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114727128B (en) * 2022-03-30 2024-04-12 恒玄科技(上海)股份有限公司 Data transmission method and device of playing terminal, playing terminal and storage medium
CN116996810A (en) * 2023-07-31 2023-11-03 广州星际悦动股份有限公司 Audio processing method, device, equipment and storage medium of oral care equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110958298A (en) * 2019-10-30 2020-04-03 成都法兰特科技有限公司 Wireless audio playing device and wireless internet audio playing method thereof
CN111222004A (en) * 2020-01-08 2020-06-02 广州小鹏汽车科技有限公司 Audio playing method, terminal equipment and vehicle
WO2020155959A1 (en) * 2019-01-30 2020-08-06 上海哔哩哔哩科技有限公司 Definition switching method and apparatus, computer device, and readable storage medium

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1961154A4 (en) * 2005-12-13 2016-03-09 Audio Pod Inc Segmentation and transmission of audio streams
CN101695131A (en) * 2009-10-16 2010-04-14 深圳市五巨科技有限公司 Method and device for playing online audio/video by mobile terminal
CA2843438A1 (en) * 2012-07-30 2013-03-21 Reza Rassool System and method for providing audio for a requested note using a render cache
CN108156524A (en) * 2017-12-29 2018-06-12 北京奇宝科技有限公司 Control method for playing back, device and the computer readable storage medium of multimedia resource
CN108965984A (en) * 2018-08-27 2018-12-07 优视科技新加坡有限公司 A kind of method, apparatus and equipment/terminal/server file transmission and played
CN112449250B (en) * 2019-08-27 2022-08-23 腾讯科技(深圳)有限公司 Method, device, equipment and medium for downloading video resources
CN112565906A (en) * 2020-11-05 2021-03-26 深圳市麦谷科技有限公司 On-demand video processing method and system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020155959A1 (en) * 2019-01-30 2020-08-06 上海哔哩哔哩科技有限公司 Definition switching method and apparatus, computer device, and readable storage medium
CN110958298A (en) * 2019-10-30 2020-04-03 成都法兰特科技有限公司 Wireless audio playing device and wireless internet audio playing method thereof
CN111222004A (en) * 2020-01-08 2020-06-02 广州小鹏汽车科技有限公司 Audio playing method, terminal equipment and vehicle

Also Published As

Publication number Publication date
CN113315810A (en) 2021-08-27

Similar Documents

Publication Publication Date Title
US11778006B2 (en) Data transmission method and apparatus
US10271072B2 (en) Video preloading method and apparatus
CN113315810B (en) Online audio playing method and equipment
CN110807128B (en) Video preloading method, device, equipment and storage medium
CN109600437B (en) Downloading method of streaming media resource and cache server
US10389599B2 (en) Server side content delivery network quality of service
US11527264B2 (en) Systems and methods for adaptive streaming of multimedia content
WO2021159770A1 (en) Video playback method, device, apparatus, and storage medium
CN110022482B (en) Video playing starting method, video service system and storage medium
JP6314252B2 (en) Network video playback method and apparatus
CN104219286B (en) streaming media processing method, device, client, CDN node server and terminal
WO2011150657A1 (en) Processing method and device after play time-point jump in streaming media
CN112333476B (en) Video loading method and device
MXPA04006412A (en) Sparse caching for streaming media.
CN102918594A (en) Cache control for adaptive stream player
CN110636339A (en) Scheduling method and device based on code rate and electronic equipment
WO2022105798A1 (en) Video processing method and apparatus, and storage medium
CN112839238B (en) Screen projection playing method and device and storage medium
US20140331266A1 (en) Caching of content
CN111083536A (en) Method and device for adjusting video code rate
CN110290396B (en) Video processing method, device, system, equipment and storage medium
EP3247124A1 (en) Client, streaming media data receiving method and streaming media data transmission system
CN108494702B (en) Transmission control method and apparatus, storage medium, and electronic apparatus
CN107959659B (en) Streaming media playing control method and device and electronic equipment
JP7162019B2 (en) DATA STREAMING METHOD, DATA STREAMING DEVICE, AND COMPUTER PROGRAM

Legal Events

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