Online playing method, device and computer equipment of multimedia file

CN122933616APending Publication Date: 2026-10-16GUANGZHOU DINGJIA COMPUTER TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611060712.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-16
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

[0004]基于此,有必要针对上述多媒体流在线播放的资源利用效率与播放稳定性较低的技术问题,提供一种能够提高多媒体流在线播放的资源利用率与播放稳定性的多媒体文件的在线播放方法、装置、计算机设备、计算机可读存储介质和计算机程序产品

Benefits of technology

[0053]The aforementioned online playback method, apparatus, computer device, computer-readable storage medium, and computer program product for multimedia files, firstly, during the online playback of the multimedia file, before requesting the server to obtain the target segment, obtains the address validity period and address generation timestamp of the first temporary signature access address of the multimedia file; the multimedia file includes multiple segments, and the target segment is any one of the multiple segments; the first temporary signature access address is the temporary signature access address currently used to request the acquisition of the multimedia file segment; then, if, based on the address validity period and address generation timestamp, it is determined that the remaining validity period of the first temporary signature access address is less than or equal to an advance refresh duration threshold, an address refresh request is sent to the server; the advance refresh duration threshold is used to characterize the time difference between the executable refresh time and the expiration time of the temporary signature access address; next, receives the second temporary signature access address of the multimedia file issued by the server in response to the address refresh request, and based on the second temporary signature access address, sends a segment acquisition request for the target segment to the server to obtain the target segment; then, after playing the preceding segments of the target segment, the target segment is played. The online playback method for multimedia files based on the above process, for each segment, before requesting to obtain the segment, determines whether the remaining validity period of the first temporary signature access address is less than or equal to the advance refresh duration threshold used to characterize the time difference between the executable refresh time and the expiration time, based on the address validity period and address generation timestamp of the currently used first temporary signature access address. If it is less than or equal to the threshold, an address refresh request is sent to the server to obtain the second temporary signature access address, and the segment is obtained and played based on the second temporary signature access address. In this way, compared with periodic refresh based on timers, the validity period of the first temporary signature access address and the address generation timestamp can be used to determine whether the remaining validity period of the first temporary signature access address is less than or equal to the advance refresh duration threshold used to characterize the time difference between the executable refresh time and the expiration time. This enables on-demand refresh of the temporary signature access address, rather than periodic refresh. On the one hand, it can avoid excessive advance refresh of the temporary signature access address, and on the other hand, it can avoid untimely refresh of the temporary signature access address. Therefore, the online playback method of multimedia files based on the above process reduces the waste of network and computing resources, ensures continuous download of segments, and ensures uninterrupted playback, thereby improving the resource utilization and playback stability of online multimedia streaming.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122933616A_ABST
    Figure CN122933616A_ABST
Patent Text Reader

Abstract

The application relates to an online playing method and device of a multimedia file and computer equipment, and relates to the technical field of multimedia playing. The method comprises the following steps: obtaining an address validity period and an address generation timestamp of a first temporary signed access address of a multimedia file before requesting a server to acquire a target segment in the multimedia file; sending an address refreshing request to the server in the case that the address remaining validity period of the first temporary signed access address is less than or equal to an early refreshing time threshold based on the address validity period and the address generation timestamp; receiving a second temporary signed access address of the multimedia file issued by the server in response to the address refreshing request, sending a segment acquisition request for the target segment to the server based on the second temporary signed access address, and acquiring the target segment; and playing the target segment after playing a previous segment of the target segment. The method can improve the resource utilization rate and playing stability of the online playing of the multimedia stream.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of multimedia playback technology, and in particular to a method, apparatus, computer device, computer-readable storage medium, and computer program product for online playback of multimedia files. Background Technology

[0002] In the field of online multimedia streaming, to ensure the transmission stability and playback smoothness of multimedia files, such as video and audio files, a segmented download and playback mechanism is usually adopted, and a pre-signed URL (Uniform Resource Locator) is used as the download credential for each segment. Specifically, the server divides the complete multimedia file into multiple independent segments, and the terminal achieves continuous playback by downloading and parsing each segment in sequence. The server is responsible for generating the pre-signed URL and calculating its validity period, while the terminal is responsible for triggering the pre-signed URL refresh request and obtaining the new pre-signed URL, thereby ensuring the continuous download of segments and ensuring that the playback process is uninterrupted.

[0003] In related technologies, terminals commonly employ a timed polling scheme based on a background timer to periodically refresh the pre-signed URL. This scheme refreshes the pre-signed URL periodically via a background timer. However, the timed polling scheme is prone to two extreme problems: first, excessively early refreshing, triggering a refresh of the pre-signed URL with a considerable amount of time remaining before its expiration, resulting in meaningless refreshes and wasting network and computing resources; second, failure to refresh in a timely manner, triggering a refresh of the pre-signed URL only after its expiration, directly causing playback interruptions and stuttering. Therefore, the timed polling scheme reduces the resource utilization and playback stability of online multimedia streaming. Summary of the Invention

[0004] Therefore, it is necessary to address the aforementioned technical problems of low resource utilization efficiency and low playback stability in online multimedia streaming by providing a method, apparatus, computer device, computer-readable storage medium, and computer program product for online playback of multimedia files that can improve resource utilization and playback stability.

[0005] Firstly, this application provides a method for online playback of multimedia files, including:

[0006] During the online playback of a multimedia file, before requesting the server to obtain the target segment, the address validity period and address generation timestamp of the first temporary signature access address of the multimedia file are obtained; the multimedia file includes multiple segments, and the target segment is any one of the multiple segments; the first temporary signature access address is the temporary signature access address currently used to request the acquisition of the segment of the multimedia file.

[0007] If, based on the address validity period and the address generation timestamp, the remaining validity period of the first temporary signature access address is less than or equal to the early refresh duration threshold, an address refresh request is sent to the server; the early refresh duration threshold is used to characterize the time difference between the executable refresh time and the expiration time of the temporary signature access address.

[0008] Receive the second temporary signature access address of the multimedia file issued by the server in response to the address refresh request, and send a fragment acquisition request for the target fragment to the server based on the second temporary signature access address in order to acquire the target fragment;

[0009] The target segment is played after the preceding segment is played.

[0010] In one embodiment, before sending an address refresh request to the server when the remaining validity period of the first temporary signature access address is less than or equal to the early refresh duration threshold based on the address validity period and the address generation timestamp, the method further includes:

[0011] Determine the first time difference between the current time and the timestamp generated by the address;

[0012] Determine a second time difference between the address validity period and the early refresh duration threshold;

[0013] If the first time difference is greater than the second time difference, it is determined that the remaining validity period of the address is less than or equal to the early refresh duration threshold.

[0014] In one embodiment, before sending an address refresh request to the server when the remaining validity period of the first temporary signature access address is less than or equal to the early refresh duration threshold based on the address validity period and the address generation timestamp, the method further includes:

[0015] Based on the address validity period and the address generation timestamp, the address expiration time of the first temporary signature access address is determined;

[0016] Determine the third time difference between the address expiration time and the current time;

[0017] Based on the third time difference, the remaining validity period of the address is obtained.

[0018] In one embodiment, obtaining the address validity period and address generation timestamp of the first temporary signature access address of the multimedia file includes:

[0019] The validity period of the address and the timestamp of the address generation are determined from the first temporary signature access address of the multimedia file;

[0020] The method further includes:

[0021] If the timestamp generation for the address fails to be obtained, the timestamp of the first temporary signature access address is obtained.

[0022] Based on the address validity period and the receiving timestamp of the first temporary signature access address, determine whether the remaining validity period of the address is less than or equal to the early refresh duration threshold.

[0023] After receiving the second temporary signature access address issued by the server, the method further includes:

[0024] Record the timestamp of the second temporary signature access address.

[0025] In one embodiment, the method further includes:

[0026] If, based on the address validity period and the address generation timestamp, it is determined that the remaining validity period of the address is greater than the early refresh duration threshold, a fragment acquisition request for the target fragment is sent to the server based on the first temporary signature access address to acquire the target fragment.

[0027] The target segment is played after the preceding segment is played.

[0028] In one embodiment, after sending the address refresh request to the server, the method further includes:

[0029] If the second temporary signature access address fails to be obtained, a fragment retrieval request for the target fragment is sent to the server based on the first temporary signature access address to obtain the target fragment.

[0030] In one embodiment, the method further includes:

[0031] Upon receiving an address expiration message from the server regarding the current temporary signature access address, the system sends an address refresh request to the server to request a new temporary signature access address for the multimedia file; the current temporary signature access address is the temporary signature access address currently used to request the acquisition of the multimedia file's fragments.

[0032] Secondly, this application also provides an online playback device for multimedia files, comprising:

[0033] The time information acquisition module is used to acquire the address validity period and address generation timestamp of the first temporary signature access address of the multimedia file before requesting the target segment from the server during the online playback of the multimedia file; the multimedia file includes multiple segments, and the target segment is any one of the multiple segments; the first temporary signature access address is the temporary signature access address currently used to request the acquisition of the segment of the multimedia file.

[0034] The refresh request sending module is used to send an address refresh request to the server when the remaining validity period of the first temporary signature access address is less than or equal to an early refresh duration threshold based on the address validity period and the address generation timestamp; the early refresh duration threshold is used to characterize the time difference between the executable refresh time and the expiration time of the temporary signature access address.

[0035] An access address receiving module is used to receive the second temporary signature access address of the multimedia file sent by the server in response to the address refresh request;

[0036] The target fragment acquisition module is used to send a fragment acquisition request for the target fragment to the server based on the second temporary signature access address, so as to acquire the target fragment;

[0037] The target segment playback module is used to play the target segment after playing the preceding segment.

[0038] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0039] During the online playback of a multimedia file, before requesting the server to obtain the target segment, the address validity period and address generation timestamp of the first temporary signature access address of the multimedia file are obtained; the multimedia file includes multiple segments, and the target segment is any one of the multiple segments; the first temporary signature access address is the temporary signature access address currently used to request the acquisition of the segment of the multimedia file.

[0040] If, based on the address validity period and the address generation timestamp, the remaining validity period of the first temporary signature access address is less than or equal to the early refresh duration threshold, an address refresh request is sent to the server; the early refresh duration threshold is used to characterize the time difference between the executable refresh time and the expiration time of the temporary signature access address.

[0041] Receive the second temporary signature access address of the multimedia file issued by the server in response to the address refresh request, and send a fragment acquisition request for the target fragment to the server based on the second temporary signature access address in order to acquire the target fragment;

[0042] The target segment is played after the preceding segment is played.

[0043] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:

[0044] During the online playback of a multimedia file, before requesting the server to obtain the target segment, the address validity period and address generation timestamp of the first temporary signature access address of the multimedia file are obtained; the multimedia file includes multiple segments, and the target segment is any one of the multiple segments; the first temporary signature access address is the temporary signature access address currently used to request the acquisition of the segment of the multimedia file.

[0045] If, based on the address validity period and the address generation timestamp, the remaining validity period of the first temporary signature access address is less than or equal to the early refresh duration threshold, an address refresh request is sent to the server; the early refresh duration threshold is used to characterize the time difference between the executable refresh time and the expiration time of the temporary signature access address.

[0046] Receive the second temporary signature access address of the multimedia file issued by the server in response to the address refresh request, and send a fragment acquisition request for the target fragment to the server based on the second temporary signature access address in order to acquire the target fragment;

[0047] The target segment is played after the preceding segment is played.

[0048] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:

[0049] During the online playback of a multimedia file, before requesting the server to obtain the target segment, the address validity period and address generation timestamp of the first temporary signature access address of the multimedia file are obtained; the multimedia file includes multiple segments, and the target segment is any one of the multiple segments; the first temporary signature access address is the temporary signature access address currently used to request the acquisition of the segment of the multimedia file.

[0050] If, based on the address validity period and the address generation timestamp, the remaining validity period of the first temporary signature access address is less than or equal to the early refresh duration threshold, an address refresh request is sent to the server; the early refresh duration threshold is used to characterize the time difference between the executable refresh time and the expiration time of the temporary signature access address.

[0051] Receive the second temporary signature access address of the multimedia file issued by the server in response to the address refresh request, and send a fragment acquisition request for the target fragment to the server based on the second temporary signature access address in order to acquire the target fragment;

[0052] The target segment is played after the preceding segment is played.

[0053] The aforementioned online playback method, apparatus, computer device, computer-readable storage medium, and computer program product for multimedia files, firstly, during the online playback of the multimedia file, before requesting the server to obtain the target segment, obtains the address validity period and address generation timestamp of the first temporary signature access address of the multimedia file; the multimedia file includes multiple segments, and the target segment is any one of the multiple segments; the first temporary signature access address is the temporary signature access address currently used to request the acquisition of the multimedia file segment; then, if, based on the address validity period and address generation timestamp, it is determined that the remaining validity period of the first temporary signature access address is less than or equal to an advance refresh duration threshold, an address refresh request is sent to the server; the advance refresh duration threshold is used to characterize the time difference between the executable refresh time and the expiration time of the temporary signature access address; next, receives the second temporary signature access address of the multimedia file issued by the server in response to the address refresh request, and based on the second temporary signature access address, sends a segment acquisition request for the target segment to the server to obtain the target segment; then, after playing the preceding segments of the target segment, the target segment is played. The online playback method for multimedia files based on the above process, for each segment, before requesting to obtain the segment, determines whether the remaining validity period of the first temporary signature access address is less than or equal to the advance refresh duration threshold used to characterize the time difference between the executable refresh time and the expiration time, based on the address validity period and address generation timestamp of the currently used first temporary signature access address. If it is less than or equal to the threshold, an address refresh request is sent to the server to obtain the second temporary signature access address, and the segment is obtained and played based on the second temporary signature access address. In this way, compared with periodic refresh based on timers, the validity period of the first temporary signature access address and the address generation timestamp can be used to determine whether the remaining validity period of the first temporary signature access address is less than or equal to the advance refresh duration threshold used to characterize the time difference between the executable refresh time and the expiration time. This enables on-demand refresh of the temporary signature access address, rather than periodic refresh. On the one hand, it can avoid excessive advance refresh of the temporary signature access address, and on the other hand, it can avoid untimely refresh of the temporary signature access address. Therefore, the online playback method of multimedia files based on the above process reduces the waste of network and computing resources, ensures continuous download of segments, and ensures uninterrupted playback, thereby improving the resource utilization and playback stability of online multimedia streaming. Attached Figure Description

[0054] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only one embodiment of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0055] Figure 1 This is a diagram illustrating the application environment of an online multimedia file playback method in one embodiment.

[0056] Figure 2 This is a flowchart illustrating an online playback method for multimedia files in one embodiment;

[0057] Figure 3 This is a timing interaction diagram of an online playback method for multimedia files in one embodiment;

[0058] Figure 4 This is a flowchart illustrating a method for adaptive refresh of pre-signed URLs and uninterrupted playback of media streams for private cloud storage in one embodiment.

[0059] Figure 5 This is a structural block diagram of an online multimedia file playback device in one embodiment;

[0060] Figure 6 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0061] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0062] It is understood that terms such as "first" and "second" in this application are used only to distinguish similar objects and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. The term "connection" in the embodiments of this application refers to various connection methods, such as direct or indirect connections, to achieve communication between devices; this application does not impose any limitations on this.

[0063] It is understandable that "at least one" refers to one or more, while "multiple" refers to two or more.

[0064] When used herein, the singular forms of “a,” “an,” and “the” may also include the plural forms unless the context clearly indicates otherwise. It should also be understood that the terms “comprising / including” or “having,” etc., specify the presence of the stated features, wholes, steps, operations, components, parts, or combinations thereof, but do not preclude the possibility of the presence or addition of one or more other features, wholes, steps, operations, components, parts, or combinations thereof. Meanwhile, the term “and / or” as used in this specification includes any and all combinations of the associated listed items.

[0065] The backup method provided in this application embodiment can be applied to, for example, Figure 1 The application environment shown is a private cloud environment, including server 102 and at least one terminal 104. Server 102 communicates with terminal 104 via a network. Server 102 is a server providing a private cloud storage system; it can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a NAS (Network Attached Storage) server. Terminal 104 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, drones, low-altitude aircraft, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, projection devices, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc. Head-mounted devices can be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc. In practical applications, the server is the storage server for the private cloud application; the terminal is the device running the private cloud application, such as the user's personal device; the private cloud application integrates a multimedia player, and the user can play multimedia files, such as video files and audio files, stored on the server (i.e., the private cloud) online using the multimedia player integrated into the private cloud application. Furthermore, the server 102 and the terminal 104 can be directly or indirectly connected via wired or wireless communication, which is not limited herein.

[0066] For example, firstly, during the online playback of a multimedia file, before requesting the target segment from the server 102, the terminal 104 obtains the address validity period and address generation timestamp of the first temporary signature access address of the multimedia file; the multimedia file includes multiple segments, and the target segment is any one of the multiple segments; the first temporary signature access address is the temporary signature access address currently used by the terminal 104 to request the segment of the multimedia file; then, if the terminal 104 determines, based on the address validity period and address generation timestamp, that the remaining validity period of the first temporary signature access address is less than or equal to the early refresh duration threshold, it sends an address refresh request to the server 102; the early refresh duration threshold is used as... An advance refresh duration threshold is defined to characterize the time difference between the executable refresh time and the expiration time. Server 102 is configured to generate a second temporary signature access address for the multimedia file in response to an address refresh request, and send the second temporary signature access address to terminal 104. Then, terminal 104 receives the second temporary signature access address for the multimedia file sent by server 102 in response to the address refresh request, and sends a fragment acquisition request for the target fragment to server 102 based on the second temporary signature access address to acquire the target fragment. Server 102 is configured to send the target fragment to terminal 104 in response to the fragment acquisition request. Then, terminal 104 plays the target fragment after playing the preceding fragments of the target fragment.

[0067] In one embodiment, such as Figure 2 As shown, an online playback method for multimedia files is provided, which can be applied to... Figure 1 Taking the terminal in the example, the method includes the following steps:

[0068] Step S202: During the online playback of the multimedia file, before requesting the target segment from the server, obtain the address validity period and address generation timestamp of the first temporary signature access address of the multimedia file; the multimedia file includes multiple segments, and the target segment is any one of the multiple segments; the first temporary signature access address is the temporary signature access address currently used to request the segment of the multimedia file.

[0069] Multimedia files can be video files, audio files, or other multimedia files.

[0070] The temporary signature access address is the address issued by the server to the terminal for the terminal to obtain the fragment; for example, the temporary signature access address is the pre-signed URL.

[0071] The address validity period of the temporary signature access address is used to characterize the effective duration of the temporary signature access address; the address generation timestamp of the temporary signature access address is used to characterize the time when the server generates the temporary signature access address; for example, the temporary signature access address carries the address validity period and the address generation time.

[0072] In this step, during the online playback of a multimedia file, for each segment of the multimedia file, before requesting the server to obtain the segment, the terminal first identifies the segment as the target segment, and then reads the address validity period and address generation time of the first temporary signature access address from the first temporary signature access address currently used to request the multimedia file segment.

[0073] Step S204: If the remaining validity period of the first temporary signature access address is less than or equal to the advance refresh duration threshold based on the address validity period and the address generation timestamp, an address refresh request is sent to the server; the advance refresh duration threshold is used to characterize the time difference between the executable refresh time and the expiration time of the temporary signature access address.

[0074] In this process, the server responds to the address refresh request, generates a new temporary signature access address for the multimedia file, obtains a second temporary signature access address for the multimedia file, and sends the second temporary signature access address to the terminal. Each temporary signature access address generated by the server carries its validity period and a timestamp of address generation. For example, the validity period of the temporary signature access address is set to 7200 seconds (2 hours). Furthermore, if the multimedia file is a file normally stored in the private cloud, the server generates the temporary signature access address based on the application server interface; if the multimedia file is a file in the private cloud recycle bin, the server generates the temporary signature access address based on the generatePresignedURL interface in the S3 (Simple Storage Service) object storage protocol.

[0075] The advance refresh duration threshold is used to characterize the time difference between the executable refresh time and the expiration time of the temporary signature access address, specifically the time difference between the executable refresh time and the expiration time of the temporary signature access address. For example, if it is set that the temporary signature access address can be refreshed within 10 minutes before its expiration, the advance refresh duration threshold is set to 10 minutes; if it is set that the temporary signature access address can be refreshed within 5 minutes before its expiration, the advance refresh duration threshold is set to 5 minutes. Exemplarily, the advance refresh duration threshold can be set by the server or by the user using the terminal.

[0076] In this step, the terminal determines whether the remaining validity period of the first temporary signature access address is less than or equal to the early refresh duration threshold based on the address validity period and the address generation timestamp. If the remaining validity period of the first temporary signature access address is less than or equal to the early refresh duration threshold, it indicates that the temporary signature access address needs to be refreshed. Therefore, the terminal calls the address refresh callback function to send an address refresh request to the server to request the server to generate and issue a second temporary signature access address. In response to the address refresh request, the server generates and issues a second temporary signature access address to the terminal. If the remaining validity period of the first temporary signature access address is greater than the early refresh duration threshold, it indicates that the temporary signature access address does not need to be refreshed at present. Therefore, the terminal sends a fragment acquisition request for the target fragment to the server based on the currently used first temporary signature access address to download the target fragment.

[0077] Step S206: Receive the second temporary signature access address of the multimedia file issued by the server in response to the address refresh request, and send a fragment retrieval request for the target fragment to the server based on the second temporary signature access address in order to obtain the target fragment.

[0078] In this process, the server responds to the fragment retrieval request for the target fragment by sending the target fragment to the terminal.

[0079] In this step, the terminal receives the second temporary signature access address of the multimedia file sent by the server, and sends a fragment acquisition request for the target fragment to the server based on the second temporary signature access address in order to download the target fragment; in response to the fragment acquisition request, the server verifies the second temporary signature access address, and if the second temporary signature access address is verified, sends the target fragment to the terminal.

[0080] For example, the fragment acquisition request carries at least a second temporary signature access address and a fragment identifier of the target fragment; the server verifies the second temporary signature access address in the fragment acquisition request, and if the verification is successful, the server determines the target fragment among multiple fragments of the multimedia file based on the fragment identifier in the fragment acquisition request, and sends the target fragment to the terminal.

[0081] For example, the fragment acquisition request carries at least the fragment identifier of the target fragment. The terminal sends the fragment acquisition request to the server using the second temporary signature access address as the request sending address. The server verifies the second temporary signature access address that receives the fragment acquisition request. If the verification is successful, the server determines the target fragment among the multiple fragments of the multimedia file based on the fragment identifier in the fragment acquisition request and sends the target fragment to the terminal.

[0082] Step S208: After playing the preceding segments of the target segment, play the target segment.

[0083] Among them, the preceding fragment of the target fragment is the fragment before the target fragment in the multiple fragments of the multimedia file; the multiple fragments of the multimedia file are arranged according to their temporal order.

[0084] In this step, the terminal continues playing the target segment after playing the previous segment, thus enabling online playback of multimedia files.

[0085] In the above-mentioned online playback method for multimedia files, firstly, during the online playback of the multimedia file, before requesting the server to obtain the target segment, the terminal obtains the address validity period and address generation timestamp of the first temporary signature access address of the multimedia file; the multimedia file includes multiple segments, and the target segment is any one of the multiple segments; the first temporary signature access address is the temporary signature access address currently used to request the acquisition of the multimedia file segment; then, if the terminal determines that the remaining validity period of the first temporary signature access address is less than or equal to the advance refresh duration threshold based on the address validity period and address generation timestamp, the terminal sends an address refresh request to the server; the advance refresh duration threshold is used to characterize the time difference between the executable refresh time and the expiration time of the temporary signature access address; next, the terminal receives the second temporary signature access address of the multimedia file issued by the server in response to the address refresh request, and sends a segment acquisition request for the target segment to the server based on the second temporary signature access address to obtain the target segment; then, the terminal plays the target segment after playing the preceding segments of the target segment. The online playback method for multimedia files based on the above process, for each segment, before requesting to obtain the segment, determines whether the remaining validity period of the first temporary signature access address is less than or equal to the advance refresh duration threshold used to characterize the time difference between the executable refresh time and the expiration time, based on the address validity period and address generation timestamp of the currently used first temporary signature access address. If it is less than or equal to the threshold, an address refresh request is sent to the server to obtain the second temporary signature access address, and the segment is obtained and played based on the second temporary signature access address. In this way, compared with periodic refresh based on timers, the validity period of the first temporary signature access address and the address generation timestamp can be used to determine whether the remaining validity period of the first temporary signature access address is less than or equal to the advance refresh duration threshold used to characterize the time difference between the executable refresh time and the expiration time. This enables on-demand refresh of the temporary signature access address, rather than periodic refresh. On the one hand, it can avoid excessive advance refresh of the temporary signature access address, and on the other hand, it can avoid untimely refresh of the temporary signature access address. Therefore, the online playback method of multimedia files based on the above process reduces the waste of network and computing resources, ensures continuous download of segments, and ensures uninterrupted playback, thereby improving the resource utilization and playback stability of online multimedia streaming.

[0086] In one embodiment, mobile terminal platforms widely use ExoPlayer as a media playback framework. When ExoPlayer plays multimedia files online, its internal downloader creates a new DataSource instance (DataSource: the data source interface in the ExoPlayer framework, responsible for loading media data from the network or local storage) for each segment acquisition request. The call chain inside the DataSource instance is: open() → read() → close(); where open() is used to establish a network based on the currently used pre-signed URL, read() is used to read segments from the established data connection, and close() is used to release the data connection and related resources. This architectural feature provides a natural entry point for embedding the online playback method of the multimedia files provided in this application into the fragment request path. Specifically, this application improves open() to enable the terminal to determine whether the remaining validity period of the currently used temporary signature access address is less than or equal to the early refresh duration threshold based on the address validity period and address generation timestamp of the currently used temporary signature access address before requesting to obtain a fragment. If it is less than or equal to the threshold, the terminal sends an address refresh request to the server to obtain a new temporary signature access address in order to refresh the temporary signature access address it is using.

[0087] For example, this application defines a new instance, RefreshablePresignedUrlDataSource, based on the underlying network DataSource instance in the ExoPlayer media playback framework. This instance contains the underlying network DataSource instance. Therefore, the custom RefreshablePresignedUrlDataSource instance can implement the open(), read(), close(), and other methods in the underlying network DataSource instance. This application injects the custom RefreshablePresignedUrlDataSource instance into ExoPlayer's MediaSourceFactory through DataSourceFactory, so that ExoPlayer automatically creates the custom RefreshablePresignedUrlDataSource instance through DataSourceFactory for each segment request during playback.

[0088] Compared to the underlying network DataSource instance, the internal processing flow of the custom RefreshablePresignedUrlDataSource instance is improved as follows: The expiration check and refresh logic for the temporary signature access address from steps S202 to S206 above is embedded in open(). For example... Figure 3 The diagram shows the timing interaction of the online playback method for multimedia files implemented in this embodiment. For each segment, when ExoPlayer needs to request the segment, it creates a custom RefreshablePresignedUrlDataSource instance and calls the open() method in the custom RefreshablePresignedUrlDataSource instance. The custom RefreshablePresignedUrlDataSource instance parses the address validity period and address generation timestamp in the currently used temporary signature access address, and determines whether the remaining validity period of the currently used temporary signature access address is less than or equal to the pre-refresh duration threshold. If it is less than or equal to, it requests the server to generate and issue a new temporary signature access address based on the URL refresh callback function URLRefreshFn(). Then, the custom RefreshablePresignedUrlDataSource instance calls the read() method in the underlying network DataSource instance it wraps, and requests the server to obtain the segment based on the new temporary signature access address. Finally, the server returns the segment to ExoPlayer.

[0089] In this embodiment, if ExoPlayer is playing a local multimedia file, it directly uses the underlying network DataSourceFactory (DataSourceFactory: the factory interface in ExoPlayer used to create DataSource instances).

[0090] In one embodiment, before sending an address refresh request to the server in step S204 above, when it is determined that the remaining validity period of the first temporary signature access address is less than or equal to the early refresh duration threshold based on the address validity period and the address generation timestamp, the following steps are further included to determine whether the remaining validity period of the first temporary signature access address is less than or equal to the early refresh duration threshold: determining a first time difference between the current time and the address generation timestamp; determining a second time difference between the address validity period and the early refresh duration threshold; and determining that the remaining validity period of the address is less than or equal to the early refresh duration threshold if the first time difference is greater than the second time difference.

[0091] The current time is the time obtained by the terminal based on the local clock system.

[0092] In this embodiment, firstly, the terminal calculates a first time difference between the current time and the address generation timestamp of the first temporary signature access address. For example, the first time difference is obtained by subtracting the address generation timestamp of the first temporary signature access address from the current time. Then, the terminal calculates a second time difference between the address validity period of the first temporary signature access address and the early refresh duration threshold. For example, the second time difference is obtained by subtracting the early refresh duration threshold from the address validity period of the first temporary signature access address. Next, the terminal compares the first time difference with the second time difference. If the first time difference is greater than the second time difference, it is determined that the remaining address validity period of the first temporary signature access address is less than or equal to the early refresh duration threshold.

[0093] For example, in this embodiment, determining whether the first time difference is greater than the second time difference is actually determining whether (current time - address generation timestamp) is greater than (address validity period - early refresh duration threshold). Transforming the above formula, it can be equivalent to determining whether (early refresh duration threshold) is greater than (address validity period + address generation timestamp - current time). Further transformation can be equivalent to determining whether (address validity period + address generation timestamp - current time) is less than or equal to (early refresh duration threshold). Here, (address validity period + address generation timestamp) represents the address expiration time of the first temporary signature access address. Therefore, (address validity period + address generation timestamp - current time) represents the remaining validity period of the first temporary signature access address. In other words, determining whether the first time difference is greater than the second time difference is equivalent to determining whether the early refresh duration threshold is less than or equal to the remaining address validity period. Therefore, if the first time difference is greater than the second time difference, the terminal can determine that the remaining address validity period is less than or equal to the early refresh duration threshold.

[0094] For example, assuming the current time is 14:00, the address generation timestamp of the first temporary signature access address is 12:30, the address validity period of the first temporary signature access address is 2 hours, and the early refresh time threshold is 10 minutes; then, the first time difference is 1 hour and 30 minutes, the second time difference is 1 hour and 50 minutes, 1 hour and 30 minutes is less than 1 hour and 50 minutes, the terminal determines that the remaining validity period of the address of the first temporary signature access address is greater than the early refresh time threshold.

[0095] For example, assuming the current time is 14:00, the address generation timestamp of the first temporary signature access address is 12:05, the address validity period of the first temporary signature access address is 2 hours, and the early refresh time threshold is 10 minutes; then, the first time difference is 1 hour and 55 minutes, the second time difference is 1 hour and 50 minutes, 1 hour and 55 minutes is greater than 1 hour and 50 minutes, the terminal determines that the remaining validity period of the address of the first temporary signature access address is less than the early refresh time threshold.

[0096] In this embodiment, the terminal can determine whether the remaining validity period of the first temporary signature access address is less than or equal to the advance refresh duration threshold based on the validity period of the first temporary signature access address and the address generation timestamp. This can avoid the failure to refresh the temporary signature access address in a timely manner, thereby ensuring the continuous download of segments, ensuring uninterrupted playback, and improving the playback stability of online multimedia streaming.

[0097] In one embodiment, before sending an address refresh request to the server in step S204 above, when the remaining validity period of the first temporary signature access address is determined to be less than or equal to the early refresh duration threshold based on the address validity period and the address generation timestamp, the following steps are further included to determine the remaining validity period of the first temporary signature access address: determining the address expiration time of the first temporary signature access address based on the address validity period and the address generation timestamp; determining a third time difference between the address expiration time and the current time; and obtaining the remaining validity period of the address based on the third time difference.

[0098] The current time is the time obtained by the terminal based on the local clock system.

[0099] In this embodiment, firstly, the terminal calculates the sum of the address generation time and the address validity period of the first temporary signature access address. This sum represents the actual expiration time of the first temporary signature access address. Therefore, the terminal obtains the address expiration time of the first temporary signature access address. For example, it adds the duration corresponding to the address validity period of the first temporary signature access address to the address generation time of the first temporary signature access address to obtain the address expiration time of the first temporary signature access address. Then, the terminal calculates a third time difference between the address expiration time of the first temporary signature access address and the current time. For example, it subtracts the current time from the address expiration time of the first temporary signature access address to obtain the third time difference. Next, since the third time difference represents the distance between the current time and the address expiration time of the first temporary signature access address, the terminal determines the third time difference as the remaining validity period of the first temporary signature access address and compares whether the remaining validity period of the first temporary signature access address is less than or equal to the early refresh duration threshold.

[0100] For example, assuming the current time is 14:00, the address generation timestamp of the first temporary signature access address is 12:30, the address validity period of the first temporary signature access address is 2 hours, and the early refresh time threshold is 10 minutes; then, the address expiration time of the first temporary signature access address is 14:30, and the remaining validity period of the first temporary signature access address is 30 minutes. The terminal determines that the remaining validity period of the first temporary signature access address (30 minutes) is greater than the early refresh time threshold (10 minutes).

[0101] For example, assuming the current time is 14:00, the address generation timestamp of the first temporary signature access address is 12:05, the address validity period of the first temporary signature access address is 2 hours, and the early refresh time threshold is 10 minutes; then, the address expiration time of the first temporary signature access address is 14:05, and the remaining validity period of the first temporary signature access address is 5 minutes. The terminal determines that the remaining validity period of the first temporary signature access address (5 minutes) is less than the early refresh time threshold (10 minutes).

[0102] In this embodiment, based on the validity period of the first temporary signature access address and the address generation timestamp, the terminal can determine whether the remaining validity period of the first temporary signature access address is less than or equal to the early refresh duration threshold used to characterize the need to refresh the temporary signature access address in advance. This can avoid the failure to refresh the temporary signature access address in a timely manner, thereby ensuring the continuous download of segments, ensuring that the playback process is not interrupted, and improving the playback stability of online multimedia streaming.

[0103] In one embodiment, the step S202 above, obtaining the address validity period and address generation timestamp of the first temporary signature access address of the multimedia file, includes the following steps: determining the address validity period and address generation timestamp from the first temporary signature access address of the multimedia file.

[0104] In this embodiment, the temporary signature access address includes an X-Amz-Expires field and an X-Amz-Date field. The X-Amz-Expires field records the validity period of the temporary signature access address, and the X-Amz-Date field records the timestamp of the temporary signature access address's generation. Therefore, the terminal reads the X-Amz-Expires and X-Amz-Date fields from the first temporary signature access address of the multimedia file, parses the validity period of the first temporary signature access address from the X-Amz-Expires field, and parses the timestamp of the first temporary signature access address's generation from the X-Amz-Date field.

[0105] In this embodiment, the terminal determines the address validity period and address generation timestamp from the first temporary signature access address of the multimedia file. It can make full use of the parameters recorded in the X-Amz-Expires and X-Amz-Date fields in the temporary signature access address, and based on the parameters recorded in the X-Amz-Expires and X-Amz-Date fields in the temporary signature access address, it can conveniently, quickly and accurately determine whether the remaining validity period of the first temporary signature access address is less than or equal to the early refresh duration threshold, and then determine whether the temporary signature access address needs to be refreshed, so as to realize on-demand refresh.

[0106] In one embodiment, the online playback method for multimedia files provided in this application further includes the following steps: if the address generation timestamp acquisition fails, obtain the receiving timestamp of the first temporary signature access address; and determine whether the remaining validity period of the address is less than or equal to the early refresh duration threshold based on the address validity period and the receiving timestamp of the first temporary signature access address.

[0107] In this embodiment, considering the possibility of failure in parsing the address generation timestamp from the first temporary signature access address of the multimedia file, if the terminal fails to obtain the address generation timestamp of the first temporary signature access address, it obtains the locally recorded receiving timestamp for the first temporary signature access address; and based on the address validity period and the receiving timestamp of the first temporary signature access address, it determines whether the remaining validity period of the first temporary signature access address is less than or equal to the early refresh duration threshold; if the remaining validity period of the first temporary signature access address is less than or equal to the early refresh duration threshold, it indicates that the temporary signature access address needs to be refreshed. Therefore, the terminal calls the address refresh callback function to send an address refresh request to the server to request the server to generate and distribute a second temporary signature access address. The server responds to the address refresh request and generates and distributes the second temporary signature access address to the terminal; if the remaining validity period of the first temporary signature access address is greater than the early refresh duration threshold, it indicates that the temporary signature access address does not need to be refreshed at present. Therefore, based on the currently used first temporary signature access address, the terminal sends a fragment acquisition request for the target fragment to the server to download the target fragment.

[0108] For example, similar to the address generation timestamp, the terminal calculates and determines the fourth time difference between the current time and the receiving timestamp of the first temporary signature access address, then calculates the fifth time difference between the address validity period of the first temporary signature access address and the early refresh duration threshold, and then, if the fourth time difference is greater than the fifth time difference, determines that the remaining address validity period of the first temporary signature access address is less than or equal to the early refresh duration threshold.

[0109] For example, similar to the address generation timestamp, the terminal calculates the sum of the address validity period of the first temporary signature access address and the receiving timestamp of the first temporary signature access address to obtain the address expiration time of the first temporary signature access address. Then, it calculates the sixth time difference between the address expiration time of the first temporary signature access address and the current time. Finally, it determines the sixth time difference as the remaining address validity period of the first temporary signature access address.

[0110] In this embodiment, if the address generation timestamp of the first temporary signature access address cannot be parsed from the first temporary signature access address, the terminal uses the locally recorded receiving timestamp of the first temporary signature access address as the address generation timestamp of the first temporary signature access address for calculation, thereby determining whether the remaining validity period of the first temporary signature access address is less than or equal to the early refresh duration threshold, and thus determining whether the temporary signature access address needs to be refreshed.

[0111] In one embodiment, after receiving the second temporary signature access address issued by the server in step S206 above, the following step is further included: recording the receiving timestamp of the second temporary signature access address.

[0112] The time at which the second temporary signature access address is received is the time obtained by the terminal based on its local clock system.

[0113] In this embodiment, after receiving the second temporary signature access address issued by the server, the terminal also needs to record the receiving timestamp of the second temporary signature access address. For example, the time when the second temporary signature access address is received is recorded as the receiving timestamp of the second temporary signature access address.

[0114] In this embodiment, by recording the time of receiving the second temporary signature access address as the receiving timestamp of the second temporary signature access address, the terminal can determine whether the remaining validity period of the first temporary signature access address is less than or equal to the early refresh duration threshold based on the receiving timestamp of the second temporary signature access address when it is not possible to parse the address generation timestamp of the second temporary signature access address from it. This allows the terminal to determine whether the temporary signature access address needs to be refreshed.

[0115] In one embodiment, the online playback method for multimedia files provided in this application further includes the following steps: if the remaining validity period of the address is determined to be greater than the advance refresh duration threshold based on the address validity period and the address generation timestamp, a segment acquisition request for the target segment is sent to the server based on the first temporary signature access address to acquire the target segment; and the target segment is played after the preceding segments of the target segment are played.

[0116] In this embodiment, if the remaining validity period of the first temporary signature access address is determined to be greater than the early refresh duration threshold based on the address validity period and the address generation timestamp of the first temporary signature access address, it means that there is no need to refresh the temporary signature access address at present. Therefore, the terminal sends a fragment acquisition request for the target fragment to the server based on the first temporary signature access address to download the target fragment. In response to the fragment acquisition request, the server verifies the first temporary signature access address. If the verification of the first temporary signature access address is successful, the server sends the target fragment to the terminal.

[0117] For example, the fragment acquisition request carries at least a first temporary signature access address and a fragment identifier of the target fragment; the server verifies the first temporary signature access address in the fragment acquisition request, and if the verification is successful, the server determines the target fragment among multiple fragments of the multimedia file based on the fragment identifier in the fragment acquisition request, and sends the target fragment to the terminal.

[0118] For example, the fragment acquisition request carries at least the fragment identifier of the target fragment. The terminal sends the fragment acquisition request to the server using the first temporary signature access address as the request sending address. The server verifies the first temporary signature access address that receives the fragment acquisition request. If the verification is successful, the server determines the target fragment among the multiple fragments of the multimedia file based on the fragment identifier in the fragment acquisition request and sends the target fragment to the terminal.

[0119] In this embodiment, when the remaining validity period of the first temporary signature access address is determined to be greater than the early refresh duration threshold based on the address validity period and the address generation timestamp of the first temporary signature access address, the terminal can determine that there is no need to refresh the temporary signature access address at present. When there is no need to refresh the temporary signature access address at present, the terminal requests to obtain the target fragment through the first temporary signature access address, instead of requesting to refresh the temporary signature access address and requesting to obtain the target fragment based on the new temporary signature access address. This can avoid excessive early refresh of the temporary signature access address, thereby reducing the waste of network resources and computing power resources and improving the resource utilization rate of online multimedia streaming.

[0120] In one embodiment, after sending an address refresh request to the server in step S204 above, the following steps are also included: if the second temporary signature access address fails to be obtained, a fragment acquisition request for the target fragment is sent to the server based on the first temporary signature access address to obtain the target fragment.

[0121] In this embodiment, if obtaining the second temporary signature access address from the server fails, the terminal sends a fragment acquisition request for the target fragment to the server based on the first temporary signature access address in order to download the target fragment; in response to the fragment acquisition request, the server verifies the first temporary signature access address, and if the first temporary signature access address is verified, the server sends the target fragment to the terminal.

[0122] In this embodiment, if the second temporary signature access address fails, the terminal continues to use the first temporary signature access address to try to obtain the target fragment in order to avoid interruption of multimedia file playback.

[0123] In one embodiment, the online playback method for multimedia files provided in this application further includes the following steps: upon receiving an address expiration message returned by the server for the current temporary signature access address, sending an address refresh request to the server to request a new temporary signature access address for the multimedia file.

[0124] The current temporary signature access address is the temporary signature access address currently used to request the acquisition of a multimedia file fragment; for example, the current temporary signature access address can be either a first temporary signature access address or a second temporary signature access address.

[0125] In this embodiment, if the terminal receives an address expiration message from the server after sending a fragment retrieval request based on the current temporary signature access address, the terminal immediately sends an address refresh request to the server to request a new temporary signature access address for the multimedia file, so as to avoid interruption of multimedia file playback.

[0126] Furthermore, if obtaining a new temporary signature access address fails, the terminal can send multiple address refresh requests to the server. A certain time interval is required between each consecutive address refresh request. For example, the time interval between consecutive address refresh requests can be determined using strategies such as exponential backoff, linear backoff, or fixed interval strategies. Even further, if the total duration of address acquisition failures reaches a preset duration threshold, or the total number of address acquisition failures reaches a preset number of failures threshold, the terminal will no longer send address refresh requests to the server. Instead, it will prompt the user to download the multimedia file to their local machine before playback.

[0127] In this embodiment, the terminal can achieve timely renewal by sending an address refresh request when the current temporary signature access address expires; and the terminal can achieve graceful degradation by prompting the user to download and play the app locally when multiple attempts to renew the signature fail.

[0128] In another specific embodiment, such as Figure 4 As shown, this application also provides a method for pre-signed URL adaptive refresh and uninterrupted media streaming playback for private cloud storage. This method is applied to a terminal running a private cloud application and includes the following steps:

[0129] For each segment of a multimedia file, before requesting the server to retrieve the segment, the address validity period and address generation timestamp of the current pre-signed URL are parsed from the current pre-signed URL.

[0130] The remaining validity period of the current pre-signed URL is determined based on the address validity period and the address generation timestamp.

[0131] Determine whether the remaining validity period of the current pre-signed URL is less than or equal to the early refresh time threshold.

[0132] If the remaining validity period of the current pre-signed URL is less than or equal to the early refresh time threshold, then send an address refresh request to the server.

[0133] If the pre-signed URL is refreshed successfully, the server will send a new pre-signed URL, which will be used as the new current pre-signed URL. The server will then send a fragment retrieval request for that fragment to the server in order to obtain the fragment.

[0134] If the pre-signed URL refresh fails, a fragment retrieval request for that fragment is sent to the server based on the current pre-signed URL in order to retrieve that fragment.

[0135] If the remaining validity period of the current pre-signed URL is greater than the early refresh time threshold, then a fragment retrieval request for that fragment is sent to the server based on the current pre-signed URL in order to obtain that fragment.

[0136] This segment is played after the previous segment.

[0137] If the current pre-signed URL expires, an address refresh request is sent to the server; if the retrieval fails, the user is prompted to download and play it locally, thus achieving graceful degradation.

[0138] The above solution is implemented by encapsulating the DataSource class in ExoPlayer. Alternatively, it can be implemented based on DefaultDataSource, OkHttpDataSource, or CronetDataSource in ExoPlayer.

[0139] In related technologies, the refresh mechanism for pre-signed URLs typically employs a timed polling refresh scheme, server-side push, or ExoPlayer's ResolvingDataSource scheme. In the server-side push scheme, the server actively notifies the terminal to refresh when the pre-signed URL expires. In the ResolvingDataSource scheme, the ResolvingDataSource component allows the internal URI (Uniform Resource Identifier) ​​to be resolved into the actual playback URL before a data request. This component is a general URI resolution framework designed to resolve internal identifiers into actual playable URLs. A comparison of the pre-signed URL adaptive refresh scheme provided in this embodiment with the above schemes is shown in Table 1:

[0140] Table 1

[0141]

[0142] In this embodiment, firstly, the background polling thread is eliminated, reducing power consumption: URL expiration checks are triggered only when ExoPlayer requests new data, eliminating the need to maintain any background timers or polling threads. Compared to traditional timed polling schemes, this reduces invalid URL expiration checks by more than 90%. Actual test data shows that when playing a 2-hour movie (with a pre-signed URL valid for 15 minutes), the traditional timed polling scheme (checking every 5 minutes) generates approximately 23 URL expiration checks, of which approximately 20 are invalid checks (URLs are not expired), and the background timer continuously wakes up the CPU. This embodiment only triggers checks and refreshes for two segment requests when the URL is about to expire, resulting in zero invalid checks and no background thread wake-up. Secondly, precise on-demand refresh is achieved: the refresh behavior is entirely triggered by the player's actual data requests, eliminating the problems of "premature refresh" (wasting requests) and "late refresh" (causing interruptions) by the timer, achieving zero lead time waste and zero delayed interruptions. Third, it does not rely on server cooperation and is compatible with lightweight private clouds: the entire URL lifecycle management is completed autonomously by the terminal, without requiring the server to implement WebSocket push, long polling, or special API interfaces, and is directly compatible with S3-compatible object storage services. Fourth, it uses the URL embedded timestamp as the authoritative benchmark and is not affected by clock synchronization: the remaining address validity period is calculated based on the parameter parsing value in the pre-signed URL, without relying on the clock synchronization between the terminal and the server, which is more accurate and reliable than the solution based on local timers. Fifth, it gracefully degrades in case of refresh failure, improving fault tolerance: when the network is abnormal or the server is temporarily unavailable, the original pre-signed URL is retained and playback continues; if the original pre-signed URL still has a remaining validity period, the user can continue to play smoothly until the original pre-signed URL actually expires; if it has expired, it enters a normal error state. Seventh, it features single-point encapsulation and non-intrusive integration: the entire refresh logic is encapsulated in a DataSource class, without modifying the core logic of the player or application layer state management, resulting in concise code implementation.

[0143] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.

[0144] Based on the same inventive concept, this application also provides an online multimedia file playback device for implementing the online multimedia file playback method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more embodiments of the online multimedia file playback device provided below can be found in the limitations of the online multimedia file playback method described above, and will not be repeated here.

[0145] In one embodiment, such as Figure 5 As shown, an online multimedia file playback device is provided, including: a time information acquisition module 502, a refresh request sending module 504, an access address receiving module 506, a target segment acquisition module 508, and a target segment playback module 510, wherein:

[0146] The time information acquisition module 502 is used to acquire the address validity period and address generation timestamp of the first temporary signature access address of the multimedia file before requesting the target segment from the server during the online playback of the multimedia file; the multimedia file includes multiple segments, and the target segment is any one of the multiple segments; the first temporary signature access address is the temporary signature access address currently used to request the segment of the multimedia file.

[0147] The refresh request sending module 504 is used to send an address refresh request to the server when the remaining validity period of the first temporary signature access address is less than or equal to the advance refresh duration threshold based on the address validity period and the address generation timestamp; the advance refresh duration threshold is used to characterize the time difference between the executable refresh time and the expiration time of the temporary signature access address.

[0148] The access address receiving module 506 is used to receive the second temporary signature access address of the multimedia file issued by the server in response to the address refresh request.

[0149] The target fragment acquisition module 508 is used to send a fragment acquisition request for the target fragment to the server based on the second temporary signature access address in order to acquire the target fragment.

[0150] The target segment playback module 510 is used to play the target segment after playing the preceding segment.

[0151] In one embodiment, the online playback device for multimedia files further includes a refresh trigger judgment module, which is used to determine a first time difference between the current time and the address generation timestamp; determine a second time difference between the address validity period and the early refresh duration threshold; and if the first time difference is greater than the second time difference, determine that the remaining address validity period is less than or equal to the early refresh duration threshold.

[0152] In one embodiment, the online playback device for multimedia files further includes a refresh trigger judgment module, which is used to determine the address expiration time of the first temporary signature access address based on the address validity period and the address generation timestamp; determine a third time difference between the address expiration time and the current time; and obtain the remaining validity period of the address based on the third time difference.

[0153] In one embodiment, the time information acquisition module 502 is further configured to determine the address validity period and address generation timestamp from the first temporary signature access address of the multimedia file.

[0154] The time information acquisition module 502 is also used to acquire the receiving timestamp of the first temporary signature access address in the event that the address generation timestamp acquisition fails.

[0155] The online playback device for multimedia files also includes a refresh trigger judgment module, which is used to determine whether the remaining validity period of the address is less than or equal to the early refresh duration threshold based on the address validity period and the receiving timestamp of the first temporary signature access address.

[0156] The access address receiving module 506 is also used to record the receiving timestamp of the second temporary signature access address.

[0157] In one embodiment, the target fragment acquisition module 508 is further configured to, based on the first temporary signature access address, send a fragment acquisition request for the target fragment to the server to acquire the target fragment when it is determined that the remaining validity period of the address is greater than the advance refresh duration threshold based on the address validity period and the address generation timestamp.

[0158] The target segment playback module 510 is also used to play the target segment after playing the preceding segment.

[0159] In one embodiment, the target fragment acquisition module 508 is further configured to, in the event that the second temporary signature access address acquisition fails, send a fragment acquisition request for the target fragment to the server based on the first temporary signature access address, and acquire the target fragment.

[0160] In one embodiment, the refresh request sending module 504 is further configured to send an address refresh request to the server upon receiving an address expiration message returned by the server for the current temporary signature access address, in order to request a new temporary signature access address for the multimedia file; the current temporary signature access address is the temporary signature access address currently used to request the acquisition of a segment of the multimedia file.

[0161] The modules in the aforementioned online multimedia file playback device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0162] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows. Figure 6As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through WiFi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When the computer program is executed by the processor, it implements a method for online playback of multimedia files. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0163] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0164] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0165] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above-described method embodiments.

[0166] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.

[0167] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0168] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0169] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for online playback of multimedia files, characterized in that, The method includes: During the online playback of a multimedia file, before requesting the server to obtain the target segment, the address validity period and address generation timestamp of the first temporary signature access address of the multimedia file are obtained; the multimedia file includes multiple segments, and the target segment is any one of the multiple segments; the first temporary signature access address is the temporary signature access address currently used to request the acquisition of the segment of the multimedia file. If, based on the address validity period and the address generation timestamp, the remaining validity period of the first temporary signature access address is less than or equal to the early refresh duration threshold, an address refresh request is sent to the server; the early refresh duration threshold is used to characterize the time difference between the executable refresh time and the expiration time of the temporary signature access address. Receive the second temporary signature access address of the multimedia file issued by the server in response to the address refresh request, and send a fragment acquisition request for the target fragment to the server based on the second temporary signature access address in order to acquire the target fragment; The target segment is played after the preceding segment is played.

2. The method according to claim 1, characterized in that, Before sending an address refresh request to the server when the remaining validity period of the first temporary signature access address is less than or equal to the early refresh duration threshold based on the address validity period and the address generation timestamp, the method further includes: Determine the first time difference between the current time and the timestamp generated by the address; Determine a second time difference between the address validity period and the early refresh duration threshold; If the first time difference is greater than the second time difference, it is determined that the remaining validity period of the address is less than or equal to the early refresh duration threshold.

3. The method according to claim 1, characterized in that, Before sending an address refresh request to the server when the remaining validity period of the first temporary signature access address is less than or equal to the early refresh duration threshold based on the address validity period and the address generation timestamp, the method further includes: Based on the address validity period and the address generation timestamp, the address expiration time of the first temporary signature access address is determined; Determine the third time difference between the address expiration time and the current time; Based on the third time difference, the remaining validity period of the address is obtained.

4. The method according to claim 1, characterized in that, The step of obtaining the address validity period and address generation timestamp of the first temporary signature access address of the multimedia file includes: The validity period of the address and the timestamp of the address generation are determined from the first temporary signature access address of the multimedia file; The method further includes: If the timestamp generation for the address fails to be obtained, the timestamp of the first temporary signature access address is obtained. Based on the address validity period and the receiving timestamp of the first temporary signature access address, determine whether the remaining validity period of the address is less than or equal to the early refresh duration threshold. After receiving the second temporary signature access address issued by the server, the method further includes: Record the timestamp of the second temporary signature access address.

5. The method according to claim 1, characterized in that, The method further includes: If, based on the address validity period and the address generation timestamp, the remaining validity period is determined to be greater than the early refresh duration threshold, a fragment acquisition request for the target fragment is sent to the server based on the first temporary signature access address to acquire the target fragment. The target segment is played after the preceding segment is played.

6. The method according to claim 1, characterized in that, After sending the address refresh request to the server, the method further includes: If the second temporary signature access address fails to be obtained, a fragment retrieval request for the target fragment is sent to the server based on the first temporary signature access address to obtain the target fragment.

7. The method according to any one of claims 1 to 6, characterized in that, The method further includes: Upon receiving an address expiration message from the server regarding the current temporary signature access address, the system sends an address refresh request to the server to request a new temporary signature access address for the multimedia file; the current temporary signature access address is the temporary signature access address currently used to request the acquisition of the multimedia file's fragments.

8. An online playback device for multimedia files, characterized in that, The device includes: The time information acquisition module is used to acquire the address validity period and address generation timestamp of the first temporary signature access address of the multimedia file before requesting the target segment from the server during the online playback of the multimedia file; the multimedia file includes multiple segments, and the target segment is any one of the multiple segments; the first temporary signature access address is the temporary signature access address currently used to request the acquisition of the segment of the multimedia file. The refresh request sending module is used to send an address refresh request to the server when the remaining validity period of the first temporary signature access address is less than or equal to an early refresh duration threshold based on the address validity period and the address generation timestamp; the early refresh duration threshold is used to characterize the time difference between the executable refresh time and the expiration time of the temporary signature access address. An access address receiving module is used to receive the second temporary signature access address of the multimedia file sent by the server in response to the address refresh request; The target fragment acquisition module is used to send a fragment acquisition request for the target fragment to the server based on the second temporary signature access address, so as to acquire the target fragment; The target segment playback module is used to play the target segment after playing the preceding segment.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.

11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.