Streaming media data caching method and device, electronic equipment, storage medium and product
By caching streaming media data into a designated cache queue in monitoring scenarios, the problems of high cost and poor flexibility of real-time monitoring equipment are solved, enabling efficient recording and flexible storage of sudden abnormal situations.
Patent Information
- Application Number
- CN202210827097.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-14
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2042-07-14
AI Technical Summary
In existing technologies, real-time monitoring uses the same video format to output to the terminal, which makes it impossible to handle emergencies specially, resulting in increased equipment costs and poor monitoring flexibility.
By responding to caching requests triggered by monitoring scenarios, streaming media data is obtained for each caching request, and the data is cached into different caching queues according to the set caching duration. The appropriate media encoding format is selected for encoding, thereby enabling the recording of audio and video data of sudden abnormal situations.
It saves memory resources, reduces equipment costs, and improves the flexibility and resource consumption of data storage in monitoring abnormal scenarios.
Smart Images

Figure CN115348418B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a streaming media data caching method, apparatus, electronic device, computer-readable storage medium, and computer program product. Background Technology
[0002] In related technologies, real-time monitoring of certain scenarios is required. Real-time monitoring involves first acquiring audio and video data streams from the camera using a streaming media framework, then transmitting these streams to the terminal via media transmission protocols such as TCP / RTP / RTSP, where the terminal parses and plays the audio and video data streams.
[0003] In other words, real-time monitoring requires transmitting the audio and video data streams captured by the camera to the terminal for parsing and playback via streaming media transmission protocols. Continuous recording consumes significant resources from the camera, network, and terminal devices; furthermore, storing video files requires substantial ROM resources, increasing equipment costs. Since real-time monitoring often outputs the same video format to the terminal, it cannot handle unexpected situations, resulting in poor monitoring flexibility. Summary of the Invention
[0004] This invention provides a method, apparatus, electronic device, computer-readable storage medium, and computer program product for caching streaming media data, to at least solve the technical problems in related technologies where real-time monitoring data is output to the terminal in the same video format for storage and playback, making it impossible to handle special situations in monitoring scenarios, leading to increased equipment costs and poor monitoring flexibility. The technical solution of this invention is as follows:
[0005] According to a first aspect of the present invention, a streaming media data caching method is provided, comprising:
[0006] In response to a cache request triggered by at least one monitoring scenario, retrieve the corresponding streaming media data for each cache request;
[0007] Each stream of streaming data is cached into a different cache queue according to the set caching duration.
[0008] Optionally, before caching each stream of streaming data into different cache queues according to a set caching duration, the method further includes:
[0009] Select the media encoding format corresponding to each stream of streaming media data obtained;
[0010] Each stream of streaming media data is encoded according to the selected media encoding format to obtain encoded streaming media data.
[0011] The step of caching each stream of streaming media data into different cache queues according to a set cache duration includes: caching each encoded stream of streaming media data into different cache queues according to a set cache duration.
[0012] Optionally, after responding to a cache request triggered by at least one monitoring scenario, the method further includes:
[0013] In the case of storing a cache queue corresponding to the at least one monitoring scenario, the step of obtaining the corresponding streaming media data according to each cache request is performed;
[0014] If there is no cache queue corresponding to the at least one monitoring scenario, create a cache queue corresponding to the at least one monitoring scenario and execute the step of obtaining the corresponding streaming media data according to each cache request.
[0015] Optionally, the method further includes:
[0016] If the duration of the cached streaming data exceeds the set cache duration, remove the head data from the cache queue and continue caching the streaming data to the tail of the cache queue.
[0017] Optionally, the duration of the cached streaming media data is determined according to the following steps:
[0018] The difference between the timestamp at which the media stream data begins to be cached and the timestamp at which the media stream data ends to be determined is the length of time the media stream data is cached.
[0019] According to a second aspect of the present invention, a streaming media data caching method is provided, comprising:
[0020] A request to obtain streaming media data is detected, the request including: the start time and end time of the request to request streaming media data in the cache queue;
[0021] Based on the request start time and request end time of the streaming media data, determine the streaming media data to be retrieved in the cache queue;
[0022] Obtain the streaming media data to be acquired from the cache queue.
[0023] Optionally, determining the streaming media data to be retrieved in the cache queue based on the request start time and request end time of the streaming media data includes:
[0024] If the request start time and request end time of the streaming media data are valid times, the request start time and request end time of the streaming media data are matched sequentially with the timestamps of each frame of the streaming media data in the cache queue from the head of the cache queue.
[0025] The streaming media data within the corresponding time period that was successfully matched is identified as the streaming media data to be acquired.
[0026] Optionally, obtaining the streaming media data to be obtained from the cache queue includes:
[0027] Retrieve unread streaming media data starting from the head of the cache queue;
[0028] If the end time of the request for the unread streaming media data is greater than or equal to the timestamp of the acquired streaming media data, and the timestamp of the acquired streaming media data is greater than or equal to the start time of the request for the unread streaming media data, then the acquired streaming media data is stored.
[0029] If the timestamp of the last frame of data in the cache queue is less than the end time of the request for the unread streaming media data, then the step of retrieving the unread streaming media data starting from the head of the cache queue is executed.
[0030] If the request end time for the unread streaming media data is less than the timestamp of the acquired streaming media data, and the timestamp of the acquired streaming media data is less than the request start time for the unread streaming media data, or the timestamp of the last frame in the cache queue is greater than or equal to the request end time for the unread streaming media data, then the acquisition of streaming media data shall be terminated.
[0031] Optionally, when multiple requests for obtaining streaming media data are detected, the method further includes:
[0032] If the request start time or request end time of the multiple requests overlaps with the request start time, update the request start time or request end time of the requests with overlapping time periods, so that the updated request start time or request end time includes the request start time or request end time before the update.
[0033] The updated multiple requests are merged into one request.
[0034] According to a third aspect of the present invention, a streaming media data caching device is provided, comprising:
[0035] The acquisition module is used to respond to cache requests triggered by at least one monitoring scenario and acquire the corresponding streaming media data based on each cache request;
[0036] The first caching module is used to cache each stream of streaming media data into different caching queues according to the set caching duration.
[0037] Optionally, the device further includes:
[0038] The selection module is used to select the media encoding format corresponding to each stream of streaming media data before the first caching module caches each stream of streaming media data into different caching queues according to the set caching duration.
[0039] The encoding module is used to encode each stream of streaming media data according to the selected media encoding format to obtain each stream of streaming media data after encoding.
[0040] The first caching module is also used to cache each encoded streaming media data into different caching queues according to a set caching duration.
[0041] Optionally, the device further includes:
[0042] The first judgment module is used to determine whether there is a cache queue corresponding to the at least one monitoring scenario after the cache request is triggered in response to at least one monitoring scenario.
[0043] A creation module is used to create a cache queue corresponding to the least one monitoring scenario when the first judgment module determines that there is no cache queue corresponding to the at least one monitoring scenario.
[0044] The acquisition module is further configured to acquire corresponding streaming media data for each cache request after the creation module creates a cache queue corresponding to the least one monitoring scenario.
[0045] Optionally, the acquisition module is further configured to acquire corresponding streaming media data based on each cache request when the first judgment module determines that there is a cache queue corresponding to the at least one monitoring scenario.
[0046] Optionally, the device further includes:
[0047] The second judgment module is used to determine whether the duration of the cached streaming media data exceeds the set cache duration;
[0048] The removal module is used to remove the head data in the cache queue when the second judgment module determines that the cache duration exceeds the set cache duration;
[0049] The first caching module is further configured to continue caching the fluid data to the tail of the caching queue after the removal module removes the head data from the caching queue.
[0050] Optionally, the device further includes:
[0051] The difference determination module is used to determine the difference between the timestamp at which the media stream data starts caching and the timestamp at which the media stream data ends caching as the length of time the media stream data is cached, before the second judgment module determines whether the length of time the cached media stream data exceeds the set caching duration.
[0052] According to a fourth aspect of the present invention, a streaming media data caching device is provided, comprising:
[0053] The detection module is used to detect requests to obtain streaming media data, the requests including: the start time and end time of the request for streaming media data in the request cache queue;
[0054] The determination module is used to determine the streaming media data to be acquired in the cache queue based on the request start time and request end time of the streaming media data;
[0055] The acquisition module is used to acquire the streaming media data to be acquired in the cache queue.
[0056] Optionally, the determining module includes:
[0057] The first judgment module is used to determine whether the request start time and request end time of the streaming media data are valid times;
[0058] The matching module is used to match the request start time and request end time of the streaming media data with the timestamp of each frame of the streaming media data in the cache queue sequentially from the head of the cache queue, when the first judgment module determines that the request start time and request end time are valid times.
[0059] The data determination module is used to determine the streaming media data within the corresponding time period of the successful match as the streaming media data to be acquired when the matching module successfully matches.
[0060] Optionally, the acquisition module includes:
[0061] The data acquisition module is used to acquire unread streaming media data starting from the head of the cache queue;
[0062] A storage module is configured to store the acquired streaming media data when the request end time of the unread streaming media data acquired by the data acquisition module is greater than or equal to the timestamp of the acquired streaming media data, and the timestamp of the acquired streaming media data is greater than or equal to the request start time of the unread streaming media data;
[0063] The data acquisition module is further configured to acquire unread streaming media data starting from the head of the cache queue if the timestamp of the last frame of data in the cache queue is less than the request end time of the unread streaming media data.
[0064] The termination module is used to terminate the acquisition of streaming media data when the request end time of the unread streaming media data acquired by the data acquisition module is less than the timestamp of the acquired streaming media data, and the timestamp of the acquired streaming media data is less than the request start time of the unread streaming media data, or the timestamp of the last frame data in the cache queue is greater than or equal to the request end time of the unread streaming media data.
[0065] Optionally, the device further includes:
[0066] The second judgment module is used to determine whether there are overlapping time periods when the request to obtain streaming media data by the acquisition module is a multiple request;
[0067] The update module is used to update the request start time or request end time in the request with overlapping time periods when the second judgment module determines that there is overlapping time periods, so that the updated request start time or request end time includes the request start time or request end time before the update.
[0068] The merging module is used to merge the multiple requests updated by the update module into one request.
[0069] According to a fifth aspect of the present invention, an electronic device is provided, comprising:
[0070] processor;
[0071] Memory used to store the processor's executable instructions;
[0072] The processor is configured to execute the instructions to implement the streaming media data caching method described above.
[0073] According to a sixth aspect of the present invention, a computer-readable storage medium is provided, wherein when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the streaming media data caching method as described above.
[0074] According to a seventh aspect of the present invention, a computer program product is provided, comprising a computer program or instructions, wherein the computer program or instructions, when executed by a processor, implement the streaming media data caching method as described above.
[0075] The technical solutions provided by the embodiments of the present invention bring at least the following beneficial effects:
[0076] In this embodiment of the invention, in response to a caching request triggered by at least one monitoring scenario, corresponding streaming media data is obtained according to each caching request; the streaming media data obtained according to each caching request is cached into different caching queues according to a set caching duration. In this embodiment of the invention, when caching requests triggered by various monitoring scenarios are detected, the streaming media data under each monitoring scenario is recorded, and the recorded streaming media data is cached into the corresponding caching queue according to a set caching duration. This achieves the recording and storage of audio and video data within the time frame before and after a sudden abnormal scene according to a set caching duration, which not only saves memory resources, reduces caching costs, and reduces resource consumption by all parties in abnormal scenarios, but also improves the flexibility of data storage in monitoring abnormal scenarios.
[0077] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit the invention. Attached Figure Description
[0078] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention, but do not constitute an undue limitation of the invention.
[0079] Figure 1 A flowchart of a streaming media data caching method provided in an embodiment of the present invention.
[0080] Figure 2 This is a schematic diagram illustrating a method of caching data according to a set caching duration, as provided in an embodiment of the present invention.
[0081] Figure 3 This is a first application example diagram of a streaming media data caching method provided in an embodiment of the present invention.
[0082] Figure 4 Another flowchart of a streaming media data caching method provided in an embodiment of the present invention.
[0083] Figure 5 This is a second application example diagram of a streaming media data caching method provided in an embodiment of the present invention.
[0084] Figure 6 This is a schematic diagram illustrating how to determine whether multiple requests overlap in a time period, as provided in an embodiment of the present invention.
[0085] Figure 7 This is a block diagram of a streaming media data caching device provided in an embodiment of the present invention.
[0086] Figure 8Another block diagram of a streaming media data caching device provided in an embodiment of the present invention.
[0087] Figure 9 This is a block diagram of an electronic device provided in an embodiment of the present invention.
[0088] Figure 10 This is a block diagram of an apparatus with streaming media data buffering provided in an embodiment of the present invention. Detailed Implementation
[0089] To enable those skilled in the art to better understand the technical solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings.
[0090] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this invention. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the invention as detailed in the appended claims.
[0091] Figure 1 This is a flowchart of a streaming media data caching method provided in an embodiment of the present invention, which takes caching streaming media data as an example. Figure 1 As shown, the streaming media data caching method is used in a terminal or server, and the method includes the following steps:
[0092] In step 101, in response to a cache request triggered by at least one monitoring scenario, the corresponding streaming media data is obtained according to each cache request;
[0093] In this embodiment, a cache request triggered by a single monitoring scenario can be detected, or multiple cache requests triggered by monitoring scenarios can be detected. For each detected cache request, the corresponding media stream data will be retrieved. For example, in a retail store, when an abnormality is detected at the store entrance, a cache request is triggered to record the scene within the store, i.e., to retrieve the corresponding streaming media data.
[0094] In this embodiment, the media stream data can be audio data, video data, or a combination of audio and video data. Audio and video stream data can be acquired using mainstream streaming media frameworks such as FFMPEG and Gstreamer, which can capture audio and video data from a camera. These frameworks provide encoding and decoding technologies, resulting in smaller memory footprints and greater flexibility in use. It's worth noting that these streaming media frameworks can structure each frame of the streaming media data, including a timestamp field for each frame. This timestamp field is crucial for calculating the amount of data to be cached for a preset duration (i.e., a fixed time). Furthermore, different data formats have varying storage performance. For example, storing JPEG, a video format with large data volume and high image clarity, requires a significant amount of memory. Conversely, storing H.264, a video format with lower image quality, requires less memory, thus reducing resource consumption from various sources (such as CPU, memory, and ROM).
[0095] In step 102, each stream of streaming data is cached into a different cache queue according to the set caching duration.
[0096] In this step, typically, for each monitoring scenario, each triggered cache request corresponds to a cache queue in memory. The cache queue is used to cache streaming media data acquired under specific scenarios. The cached streaming media data (such as audio and video stream data) can be in any data stream format, including video stream data in formats such as JPEG, MPEG4, or H264, and audio stream data in formats such as AAC or G726.
[0097] In this embodiment, to ensure flexible access to cached media stream data, the streaming media data is stored in the terminal's memory. Specifically, this embodiment pre-allocates a memory area in the terminal to store the streaming media data (such as audio and video stream data) obtained based on cache requests. This memory area is divided into multiple cache queues capable of storing data for a set cache duration, and each cache queue is assigned a different ID to distinguish between different types of streaming media data (each type corresponds to one stream of streaming media data). The set cache duration can be one minute of streaming media data, or other durations such as two or three minutes can be set as needed; this embodiment does not impose any restrictions. For example, in a retail store, when abnormal activity is detected at the store entrance, a cache request is triggered, controlling the camera to capture the monitored scene inside the store and record the streaming media data for that scene. The recording duration can be a pre-set duration, such as one minute, and the recorded streaming media data is cached in the corresponding cache queue for storage of the streaming media data for that scene.
[0098] In this embodiment, since the length of the cached streaming media data also affects memory usage, the caching duration can be set according to actual needs. Generally, for most sudden events under monitoring, the time from one minute before the event to the event itself is sufficient. Therefore, in this embodiment, the caching duration for streaming media data (such as audio and video streams) can be based on a unit of time, that is, caching audio and video stream data within one minute in the memory cache queue. Furthermore, the cached streaming media data is the streaming media data from one minute ago to the current time, thereby meeting the requirements for recording and storing past monitoring scenes.
[0099] In this embodiment of the invention, in response to a caching request triggered by at least one monitoring scenario, corresponding streaming media data is obtained according to each caching request; the streaming media data obtained according to each caching request is cached into different caching queues according to a set caching duration. That is, in this embodiment of the invention, when a caching request triggered by each monitoring scenario is detected, the streaming media data under each monitoring scenario is recorded, and the recorded streaming media data is cached into the corresponding caching queue according to a set caching duration. This achieves the recording and storage of audio and video data within the time frame before and after a sudden abnormal scene according to a set caching duration, which not only saves memory resources, reduces caching costs, and reduces resource consumption by all parties in abnormal scenarios, but also improves the flexibility of data storage in monitoring abnormal scenarios.
[0100] Optionally, in another embodiment, based on the above embodiment, before caching each stream of streaming media data into different cache queues according to a set cache duration, the method may further include: selecting a media encoding format corresponding to each stream of streaming media data; encoding each stream of streaming media data according to the selected media encoding format to obtain encoded streaming media data; and caching each encoded streaming media data into different cache queues according to a set cache duration.
[0101] In this step, since the format of streaming media data has a significant impact on terminal memory consumption, in order to save memory resources, it can be decided whether the format of the acquired raw streaming media data (such as yuv / raw, etc.) needs to be encoded into the corresponding streaming media data according to actual needs, so as to obtain each stream of streaming media data after encoding; then, each stream of streaming media data after encoding is cached into different cache queues in order to achieve a balance between memory consumption and audio and video quality.
[0102] In this embodiment of the invention, appropriate media encoding formats can be selected for different types of streaming media according to actual needs, and each stream of streaming media data can be encoded and compressed according to the selected media encoding format, thereby reducing the memory space occupied when storing media stream data and improving memory utilization.
[0103] Optionally, in another embodiment, after responding to a cache request triggered by at least one monitoring scenario, the method may further include: if a cache queue corresponding to the at least one monitoring scenario exists, performing the step of obtaining the corresponding streaming media data according to each cache request; or if a cache queue corresponding to the at least one monitoring scenario does not exist, creating a cache queue corresponding to the at least one monitoring scenario and performing the step of obtaining the corresponding streaming media data according to each cache request.
[0104] In this embodiment, when a cache request triggered by at least one monitoring scenario is detected, it is first determined whether a cache queue corresponding to the at least one monitoring scenario exists in memory; if it does not exist, a cache queue corresponding to the at least one monitoring scenario is created, and then the corresponding streaming media data is obtained according to the cache request of each monitoring scenario in the at least one monitoring scenario; if it exists, the corresponding streaming media data is obtained directly according to the cache request of each monitoring scenario in the at least one monitoring scenario.
[0105] In this embodiment, typically, for each monitoring scenario, a cache queue corresponding to the streaming media data in each monitoring scenario is pre-created in memory. For example, two cache queues corresponding to the first retail store monitoring scenario (two cache queues are used as an example in this embodiment) are pre-created in memory, namely cache queue 01 and cache queue 02. Cache queue 01 is used to cache audio data in this monitoring scenario, and cache queue 02 is used to cache video data in this monitoring scenario. Of course, when a newly added scenario is detected, a corresponding cache queue needs to be created for that scenario.
[0106] Therefore, when the terminal detects a cache request triggered by a certain monitoring scenario, it will first check whether there is a cache queue in memory corresponding to the monitoring scenario; if it does not exist, it will create a cache queue corresponding to the monitoring scenario, and then obtain the corresponding streaming media data according to the cache request of the monitoring scenario; if it exists, it will directly obtain the corresponding streaming media data according to the cache request of the monitoring scenario.
[0107] In other words, in this embodiment of the invention, before detecting a cache request triggered by a monitoring scenario and obtaining the streaming media data corresponding to the cache request, it is first determined whether there is a cache queue in memory corresponding to the monitoring scenario. If there is, the streaming media data corresponding to the cache request is obtained directly, and then the obtained streaming media data is stored in the corresponding cache queue. If there is no such data, a cache queue corresponding to the monitoring scenario is established, and then the streaming media data corresponding to the cache request is obtained and cached in the created cache queue.
[0108] In this embodiment of the invention, based on different monitoring scenarios, a cache queue corresponding to the monitoring scenario is created in memory in advance. This allows the streaming media data of the monitoring scenario to be classified and cached into the corresponding cache queue when a cache request for the monitoring scenario is detected, thereby saving memory space and improving the efficiency of searching streaming media data.
[0109] Optionally, in another embodiment, based on the above embodiment, the method may further include: if the duration of the cached streaming media data exceeds the set cache duration, removing the head data from the cache queue and continuing to cache the streaming media data to the tail of the cache queue. Specifically, as follows... Figure 2 As shown, Figure 2 This is a schematic diagram illustrating a method of caching data according to a set caching duration, as provided in an embodiment of the present invention.
[0110] like Figure 2 As shown, the buffering time set in this embodiment is one minute, that is, the streaming media data from one minute ago to the current time is buffered and the streaming media data is buffered to the tail of the corresponding buffer queue. During the buffering process, it is determined whether the time length of the buffered streaming media data exceeds one minute. If it exceeds one minute, the head data in the buffer queue is removed, that is, the arrow of frame data out shown in the figure, and the streaming media data continues to be buffered to the tail of the buffer queue, that is, the arrow of frame data in shown in the figure.
[0111] In this embodiment of the invention, the cache structure of the cache queue can be a double-ended queue. Its advantage is that the data can be first-in, first-out, which can make the cached data orderly and avoid the problem of audio and video synthesis caused by retrieving disordered data later. In addition, this embodiment can quickly read the first and last data in the cache queue, so as to determine whether the time length of the cached data has reached the set cache length.
[0112] Optionally, in another embodiment, based on the above embodiment, the duration of the cached streaming media data is determined by the following steps: determining the difference between the timestamp at which the caching of the media stream data begins and the timestamp at which the caching of the media stream data ends; and using the timestamp difference as the duration of the caching of the media data stream.
[0113] In this embodiment, the calculation of the buffering time for streaming media data relies on the timestamp field in the audio and video frames. The difference between the timestamps of the first and last frames is used to determine whether the stored streaming media data exceeds a one-minute limit. If it exceeds one minute, the head data of the buffer queue is removed to ensure that new data can be stored at the head or tail of the buffer queue. In other words, this embodiment buffers streaming media data for a set fixed time.
[0114] Please also see Figure 3 This diagram illustrates a first application example of a streaming media data caching method provided by an embodiment of the present invention; this embodiment takes receiving a caching request as an example. However, in practical applications, it is not limited to this, and the received caching requests can be processed in parallel.
[0115] Step 301: A cache request triggered by a monitoring scenario was detected;
[0116] Step 302: Determine whether a cache queue corresponding to the monitoring scenario exists in memory; if not, proceed to step 303; otherwise, proceed to step 304.
[0117] Step 303: Create a cache queue corresponding to the monitoring scenario;
[0118] Step 304: Obtain the streaming media data for the monitoring scene based on the cache request;
[0119] Step 305: Start caching the acquired streaming media data of the monitoring scene into the corresponding cache queue;
[0120] Step 306: Determine whether the buffering time of the buffered streaming media data exceeds one minute (in this embodiment, the buffering time is set to one minute as an example). If yes, proceed to step 307; otherwise, proceed to step 308.
[0121] Step 307: Remove the head data from the cache queue;
[0122] Step 308: Continue to cache the streaming media data to the tail of the cache queue.
[0123] In this embodiment of the invention, when a cache request triggered by a monitoring scene is detected, it is first determined whether a cache queue corresponding to the monitoring scene exists in memory. If it exists, the streaming media data of the monitoring scene is acquired and cached into the corresponding cache queue. Then, it is determined whether the caching duration of the streaming media data exceeds a set one-minute caching duration. If it does, the head data in the cache queue is removed, and the streaming media data is cached to the tail of the cache queue. Otherwise, the streaming media data is cached to the tail of the cache queue. In this embodiment of the invention, after a cache request triggered by a monitoring scene is detected, sudden monitoring scenes can be recorded, and the recorded streaming media data can be cached into the corresponding cache queue according to a set caching duration. This not only saves memory resources and reduces equipment costs but also improves the flexibility of monitoring.
[0124] Please also see Figure 4 This is another flowchart of a streaming media data caching method provided by an embodiment of the present invention, which takes reading cached streaming media data in a cache queue as an example. Figure 4 As shown, the streaming media data caching method is used in a terminal or server, and the method includes the following steps:
[0125] Step 401: A request to obtain streaming media data is detected, the request including: the start time and end time of the request to obtain streaming media data in the cache queue;
[0126] In this step, since the streaming media data cached in the cache queue is stored according to the set cache duration (i.e., fixed time length), when reading the streaming media data in the cache queue, it is necessary to include the valid start time and end time of the request for the streaming media data in the cache queue in the request, so as to match it with the timestamp field of each frame of the streaming media data in order to find the streaming media data that matches the time period.
[0127] Step 402: Determine the streaming media data to be acquired in the cache queue based on the request start time and request end time of the streaming media data;
[0128] In this step, it is first determined whether the request start time and request end time of the streaming media data are valid times; if they are valid times, the request start time and request end time of the streaming media data are matched sequentially with the timestamp of each frame of the streaming media data in the cache queue from the head of the cache queue; if the match is successful, the streaming media data in the corresponding time period that is successfully matched is determined to be the streaming media data to be acquired.
[0129] Step 403: Obtain the streaming media data to be obtained from the cache queue.
[0130] In this step, the corresponding streaming media data is retrieved starting from the head of the cache queue. If the end time of the request to retrieve the corresponding streaming media data is greater than or equal to the timestamp of each frame in the currently retrieved streaming media data or the start time of the current request, the retrieved streaming media data is stored. If the timestamp of the last frame in the cache queue is less than the end time of the request, the corresponding streaming media data is retrieved starting from the head of the cache queue. If the end time of the request to retrieve the corresponding streaming media data is less than the timestamp of each frame in the currently retrieved streaming media data or the start time of the current request, or if the timestamp of the last frame in the cache queue is greater than or equal to the end time of the request, the retrieval of streaming media data is terminated.
[0131] Since the data in the cache queue is constantly being updated, the end time of the request can be some future time. When the set cache duration is reached, the header data in the cache queue is removed so that the newly obtained data can be added to the tail of the cache queue, until the timestamp of the newly added data frame at the tail reaches the end time of the request.
[0132] In this embodiment of the invention, when a request to obtain streaming media data is detected, the streaming media data to be obtained in the cache queue is determined based on the request start time and request end time of the streaming media data; and the streaming media data to be obtained in the cache queue is then obtained. In other words, in this embodiment of the invention, based on the request start time and request end time of the streaming media data in the cache queue within the request to obtain streaming media data, the cached streaming media data in the cache queue can be flexibly read according to needs, improving the flexibility of reading monitoring data.
[0133] Optionally, in another embodiment, based on the above embodiment, when multiple requests for streaming media data are detected, the method may further include: if there is an overlap between the request start time and request end time in the multiple requests, updating the request start time or request end time in the requests with overlapping time periods, so that the updated request start time or request end time includes the request start time or request end time before the update.
[0134] In other words, when multiple requests for streaming media data are detected, it is first determined whether any of the multiple requests request streaming media data within the same time period; if so, the requests for obtaining streaming media data within the same time period are merged into one request.
[0135] In this embodiment of the invention, it can support responses to requests for multiple streaming media data and adopts a time coverage mechanism. When multiple requests for streaming media data are detected simultaneously, it is first determined whether there is any overlap in time period between the start time and end time of the new request and the existing request. If so, the two requests are merged into one request to reduce resource consumption.
[0136] Please also see Figure 5 This diagram illustrates a second application example of a streaming media data caching method provided by an embodiment of the present invention; this embodiment uses reading multiple cached requests as an example. However, in practical applications, it is not limited to this. The method includes:
[0137] Step 501: Multiple requests to obtain streaming media data are detected. Each request includes: the start time and end time of the request for streaming media data in the request cache queue.
[0138] Step 502: Determine if a cache queue for each request exists in memory; if it exists, proceed to step 503; otherwise, proceed to step 510.
[0139] Step 503: Determine whether the start time and end time of each request are valid times; if yes, proceed to step 504; otherwise, proceed to step 509.
[0140] Step 504: Determine whether there are overlapping time periods between the start time or end time of the requests among the multiple requests; if yes, proceed to step 505; otherwise, proceed to step 506.
[0141] Step 505: Update the start time or end time of requests with overlapping time periods, so that the updated start time or end time includes the original start time or end time, and merge the updated requests into one request, then proceed to step 510.
[0142] In steps 504 and 505, the judgment process is illustrated with specific examples, as shown in Figure 6. Figure 6 This is a schematic diagram illustrating how to determine whether multiple requests overlap in a given time period, as provided in an embodiment of the present invention. Figure 6As shown, this embodiment takes three requests as an example. When request 2 arrives, it first determines whether the request already exists and whether there is a time overlap with the start or end time of the existing request. If there is, the start or end time of request 2 is updated to include the start or end times of both request 1 and request 2. At the same time, when request 3 arrives, a similar judgment is made. Based on the judgment result, a new request that can include all the previous requests with time overlap is finally synthesized. Otherwise, each request is treated as an independent request. This judgment can usually effectively solve the problem of wasted resource consumption and ultimately achieve the goal of saving CPU, ROM and other resource consumption.
[0143] Step 506: Read unread streaming media data starting from the head of the buffer queue;
[0144] Step 507: Determine whether the request end time of the unread streaming media data is greater than or equal to the timestamp of the acquired streaming media data, and whether the timestamp of the acquired streaming media data is greater than or equal to the request start time of the unread streaming media data; if yes, proceed to step 508; otherwise, proceed to step 510.
[0145] Step 508: Store the acquired streaming media data;
[0146] Step 509: Determine whether the timestamp of the last frame of data in the cache queue is less than the end time of the request for the unread streaming media data. If yes, return to step 506; otherwise, proceed to step 510.
[0147] Step 510: End the acquisition of streaming media data.
[0148] Step 511: Combine the acquired streaming media data into an audio and video file.
[0149] In this embodiment of the invention, the valid start and end times of requests for obtaining streaming media data are matched with the timestamp field of the audio and video stream data to identify streaming media data that matches the time period. It is also determined whether multiple requests contain requests with overlapping time periods; if so, they are merged into a single request to reduce resource consumption for all parties. Furthermore, after the streaming media data request ends, the requested streaming media data is synthesized into an audio and video file for use by other platforms.
[0150] Furthermore, this embodiment can also encode the acquired streaming media data into a desired format according to requirements, and then synthesize audio and video files, etc.
[0151] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that this disclosure is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the present invention.
[0152] Figure 7 This is a block diagram of a streaming media data caching device according to an embodiment of the present invention. The device includes: an acquisition module 601 and a first caching module 602, wherein...
[0153] The acquisition module 601 is used to acquire corresponding streaming media data according to each cache request in response to at least one cache request triggered by a monitoring scenario.
[0154] The first caching module 602 is used to cache each stream of streaming media data into different caching queues according to a set caching duration.
[0155] Optionally, in another embodiment, based on the above embodiments, the apparatus further includes: a selection module and an encoding module, wherein,
[0156] The selection module is used to select the media encoding format corresponding to each stream of streaming media data before the first caching module caches each stream of streaming media data into different caching queues according to the set caching duration.
[0157] The encoding module is used to encode each stream of streaming media data according to the selected media encoding format to obtain each stream of streaming media data after encoding.
[0158] The first caching module is also used to cache each encoded streaming media data into different caching queues according to a set caching duration.
[0159] Optionally, in another embodiment, based on the above embodiments, the apparatus further includes: a first determining module and a creating module, wherein,
[0160] The first judgment module is used to determine whether there is a cache queue corresponding to the at least one monitoring scenario after the cache request is triggered in response to at least one monitoring scenario.
[0161] The creation module is used to create a cache queue corresponding to the least one monitoring scenario when the first judgment module determines that there is no cache queue corresponding to the at least one monitoring scenario.
[0162] The acquisition module is further configured to acquire corresponding streaming media data for each cache request after the creation module creates a cache queue corresponding to the least one monitoring scenario.
[0163] Optionally, in another embodiment, based on the above embodiment, the acquisition module is further configured to acquire corresponding streaming media data according to each cache request when the first judgment module determines that there is a cache queue corresponding to the at least one monitoring scenario.
[0164] Optionally, in another embodiment, based on the above embodiments, the device further includes: a second determining module and a removing module, wherein,
[0165] The second judgment module is used to determine whether the duration of the cached streaming media data exceeds the set cache duration;
[0166] The removal module is used to remove the header data in the cache queue when the second judgment module determines that the cache duration exceeds the set cache duration;
[0167] The first caching module is further configured to continue caching the fluid data to the tail of the caching queue after the removal module removes the head data from the caching queue.
[0168] Optionally, in another embodiment, based on the above embodiments, the apparatus further includes: a difference determination module, wherein,
[0169] The difference determination module is used to determine the difference between the timestamp at which the media stream data starts caching and the timestamp at which the media stream data ends caching as the length of time the media stream data is cached, before the second judgment module determines whether the length of time the cached media stream data exceeds the set caching duration.
[0170] Please also see Figure 8 This is another block diagram of a streaming media data caching device provided in an embodiment of the present invention. The device includes: a detection module 701, a determination module 702, and an acquisition module 703, wherein...
[0171] The detection module 701 is used to detect a request to obtain streaming media data, the request including: the request start time and request end time of the streaming media data in the request cache queue;
[0172] The determining module 702 is used to determine the streaming media data to be acquired in the cache queue based on the request start time and request end time of the streaming media data;
[0173] The acquisition module 703 is used to acquire streaming media data to be acquired in the cache queue.
[0174] Optionally, in another embodiment, based on the above embodiments, the determining module includes: a first judging module, a matching module, and a data determining module, wherein,
[0175] The first judgment module is used to determine whether the request start time and request end time of the streaming media data are valid times;
[0176] The matching module is used to match the request start time and request end time of the streaming media data with the timestamp of each frame of the streaming media data in the cache queue sequentially from the head of the cache queue when the first judgment module determines that the request start time and request end time are valid times.
[0177] The data determination module is used to determine the streaming media data within the corresponding time period of the successful match as the streaming media data to be acquired when the matching module successfully matches.
[0178] Optionally, in another embodiment, based on the above embodiments, the acquisition module includes: a data acquisition module, a storage module, and an termination module, wherein,
[0179] The data acquisition module is used to acquire unread streaming media data starting from the head of the cache queue;
[0180] The storage module is configured to store the acquired streaming media data when the request end time of the unread streaming media data acquired by the data acquisition module is greater than or equal to the timestamp of the acquired streaming media data, and the timestamp of the acquired streaming media data is greater than or equal to the request start time of the unread streaming media data.
[0181] The data acquisition module is further configured to acquire unread streaming media data starting from the head of the cache queue if the timestamp of the last frame of data in the cache queue is less than the request end time of the unread streaming media data.
[0182] The termination module is used to terminate the acquisition of streaming media data when the request end time of the unread streaming media data acquired by the data acquisition module is less than the timestamp of the acquired streaming media data, and the timestamp of the acquired streaming media data is less than the request start time of the unread streaming media data, or the timestamp of the last frame data in the cache queue is greater than or equal to the request end time of the unread streaming media data.
[0183] Optionally, in another embodiment, based on the above embodiments, the apparatus further includes: a second determination module, an update module, and a merging module, wherein,
[0184] The second judgment module is used to determine whether there are overlapping time periods when the request to obtain streaming media data by the acquisition module is a multiple request;
[0185] The update module is used to update the request start time or request end time in the request with overlapping time periods when the second judgment module determines that there is overlapping time periods, so that the updated request start time or request end time includes the request start time or request end time before the update.
[0186] This merging module is used to merge the multiple requests after the update module has updated them into one request.
[0187] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0188] This invention also provides an electronic device, comprising:
[0189] processor;
[0190] Memory used to store the processor's executable instructions;
[0191] The processor is configured to execute the instructions to implement the streaming media data caching method described above.
[0192] This invention also provides a computer-readable storage medium that, when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, enables the electronic device to perform the streaming media data caching method described above. Optionally, the computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, or optical data storage device, etc.
[0193] In an exemplary embodiment, the present invention also provides a computer program product, including a computer program or instructions, characterized in that, when the computer program or instructions are executed by a processor, they implement the streaming media data caching method described above. 。
[0194] Figure 8This is a block diagram of an electronic device 800 provided in an embodiment of the present invention. For example, the electronic device 800 can be a mobile terminal or a server; in this embodiment, a mobile terminal is used as an example for explanation. For example, the electronic device 800 can be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, etc.
[0195] Reference Figure 8 The electronic device 800 may include one or more of the following components: a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input / output (I / O) interface 812, a sensor component 814, and a communication component 816.
[0196] Processing component 802 typically controls the overall operation of electronic device 800, such as operations associated with display, telephone calls, data communication, camera operation, and recording operations. Processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the methods described above. Furthermore, processing component 802 may include one or more modules to facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.
[0197] Memory 804 is configured to store various types of data to support the operation of device 800. Examples of this data include instructions for any application or method operating on electronic device 800, contact data, phonebook data, messages, pictures, videos, etc. Memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0198] Power supply component 806 provides power to various components of electronic device 800. Power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 800.
[0199] Multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 808 includes a front-facing camera and / or a rear-facing camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0200] Audio component 810 is configured to output and / or input audio signals. For example, audio component 810 includes a microphone (MIC) configured to receive external audio signals when electronic device 800 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 804 or transmitted via communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
[0201] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0202] Sensor assembly 814 includes one or more sensors for providing state assessments of various aspects of electronic device 800. For example, sensor assembly 814 may detect the on / off state of device 800, the relative positioning of components such as the display and keypad of electronic device 800, changes in position of electronic device 800 or a component of electronic device 800, the presence or absence of user contact with electronic device 800, orientation or acceleration / deceleration of electronic device 800, and temperature changes of electronic device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 814 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, or temperature sensor.
[0203] Communication component 816 is configured to facilitate wired or wireless communication between electronic device 800 and other devices. Electronic device 800 can access wireless networks based on communication standards, such as WiFi, carrier networks (such as 2G, 3G, 4G, or 5G), or combinations thereof. In one exemplary embodiment, communication component 816 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 816 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0204] In an embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the streaming media data caching method described above.
[0205] This invention also provides a computer-readable storage medium that, when the instructions in the computer-readable storage medium are executed by the processor of an electronic device, enables the electronic device 800 to perform the streaming media data caching method described above. For example, the computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, or optical data storage device, etc.
[0206] This invention also provides a computer program product, including a computer program or instructions, which, when executed by a processor 820, implement the streaming media data caching method as described above.
[0207] Figure 9 This is a block diagram of an apparatus 900 for buffering streaming media data according to an embodiment of the present invention. For example, apparatus 900 can be provided as a server. (See also...) Figure 9 The device 900 includes a processing component 922, which further includes one or more processors, and memory resources represented by memory 932 for storing instructions, such as application programs, that can be executed by the processing component 922. The application programs stored in memory 932 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 922 is configured to execute instructions to perform the aforementioned streaming media data caching method.
[0208] The device 900 may also include a power supply component 926 configured to perform power management of the device 900, a wired or wireless network interface 950 configured to connect the device 900 to a network, and an input / output (I / O) interface 958. The device 900 can operate on an operating system stored in memory 932, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, or similar.
[0209] Other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of the invention are indicated by the following claims.
[0210] It should be understood that the present invention is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.
Claims
1. A streaming media data caching method, characterized in that, include: In response to a cache request triggered by at least one monitoring scenario, retrieve the corresponding streaming media data for each cache request; The streaming media data is audio data, video data, or audio-visual data; When multiple cache requests triggered by monitoring scenarios are detected simultaneously, first determine whether there is a time overlap between the start time and end time of the new request and the existing request. If so, merge the two requests into one request and obtain the corresponding streaming media data based on the updated cache request. Each stream of streaming media data is cached into a different cache queue according to the set cache duration. Each cache request triggered by each monitoring scenario corresponds to a cache queue. The cache queues are set with different IDs to distinguish and store different types of streaming media data.
2. The streaming media data caching method according to claim 1, characterized in that, Before caching each stream of streaming data into different cache queues according to a set caching duration, the method further includes: Select the media encoding format corresponding to each stream of streaming media data obtained; Each stream of streaming media data is encoded according to the selected media encoding format to obtain encoded streaming media data. The step of caching each stream of streaming media data into different cache queues according to a set cache duration includes: caching each encoded stream of streaming media data into different cache queues according to a set cache duration.
3. The streaming media data caching method according to claim 1, characterized in that, After responding to a cache request triggered by at least one monitoring scenario, the method further includes: If a cache queue corresponding to the at least one monitoring scenario exists, perform the step of obtaining the corresponding streaming media data based on each cache request; or If there is no cache queue corresponding to the at least one monitoring scenario, create a cache queue corresponding to the at least one monitoring scenario and execute the step of obtaining the corresponding streaming media data according to each cache request.
4. The streaming media data caching method according to any one of claims 1 to 3, characterized in that, The method further includes: If the duration of the cached streaming media data exceeds the set cache duration, remove the head data from the cache queue and continue caching the streaming media data to the tail of the cache queue.
5. The streaming media data caching method according to claim 4, characterized in that, Determine the duration of the cached streaming media data using the following steps: The difference between the timestamp at which the caching of the streaming media data begins and the timestamp at which the caching of the streaming media data ends is determined as the length of time the streaming media data is cached.
6. A streaming media data caching method, characterized in that, include: A request to obtain streaming media data was detected, wherein the streaming media data is audio data, video data, or audio-visual data; The request includes: the start time and end time of the request for streaming media data in the request cache queue; when it is detected that there are multiple requests for obtaining streaming media data, the request includes: if there are overlapping time periods in the start time or end time of the multiple requests, updating the start time or end time of the requests with overlapping time periods, so that the updated start time or end time includes the original start time or end time; merging the updated multiple requests into one request; and updating the start time and end time of the streaming media data in the request cache queue. Each cache request triggered by each monitoring scenario corresponds to a cache queue; the streaming media data to be retrieved in the cache queue is determined based on the request start time and request end time of the streaming media data; or, the streaming media data to be retrieved in the cache queue is determined based on the request start time and request end time of the updated streaming media data. Obtain the streaming media data to be acquired from the cache queue.
7. The streaming media data caching method according to claim 6, characterized in that, The step of determining the streaming media data to be retrieved in the cache queue based on the request start time and request end time of the streaming media data includes: If the request start time and request end time of the streaming media data are valid times, the request start time and request end time of the streaming media data are matched sequentially with the timestamps of each frame of the streaming media data in the cache queue from the head of the cache queue. The streaming media data within the corresponding time period that was successfully matched is identified as the streaming media data to be acquired.
8. The streaming media data caching method according to claim 6 or 7, characterized in that, Retrieving the streaming media data to be retrieved from the cache queue includes: Retrieve unread streaming media data starting from the head of the cache queue; If the end time of the request for the unread streaming media data is greater than or equal to the timestamp of the acquired streaming media data, and the timestamp of the acquired streaming media data is greater than or equal to the start time of the request for the unread streaming media data, then the acquired streaming media data is stored. If the timestamp of the last frame of data in the cache queue is less than the end time of the request for the unread streaming media data, then the step of retrieving the unread streaming media data starting from the head of the cache queue is executed. The acquisition of streaming media data ends if the request end time for the unread streaming media data is less than the timestamp of the acquired streaming media data, and the timestamp of the acquired streaming media data is less than the request start time for the unread streaming media data, or if the timestamp of the last frame in the cache queue is greater than or equal to the request end time for the unread streaming media data.
9. A streaming media data buffering device, characterized in that, include: The acquisition module is used to respond to cache requests triggered by at least one monitoring scenario and acquire the corresponding streaming media data based on each cache request; The streaming media data is audio data, video data, or audio-visual data. When multiple cache requests triggered by monitoring scenarios are detected simultaneously, it is first determined whether the start time and end time of the new request and the existing request overlap in time period. If they do, the two requests are merged into one request, and the corresponding streaming media data is obtained according to the updated cache request. The first caching module is used to cache each stream of streaming media data acquired into different caching queues according to a set caching duration. Each caching request triggered by each monitoring scenario corresponds to one caching queue. The caching queues are set with different ID identifiers to distinguish and store different types of streaming media data.
10. A streaming media data buffering device, characterized in that, include: The detection module is used to detect requests to acquire streaming media data, which may be audio data, video data, or audio-visual data. The request includes: the start time and end time of the request for streaming media data in the request cache queue; when it is detected that there are multiple requests for obtaining streaming media data, the request includes: if there are overlapping time periods in the start time or end time of the multiple requests, updating the start time or end time of the requests with overlapping time periods, so that the updated start time or end time includes the original start time or end time; merging the updated multiple requests into one request; and updating the start time and end time of the streaming media data in the request cache queue. The determination module is configured such that each cache request triggered by each monitoring scenario corresponds to a cache queue; it is used to determine the streaming media data to be acquired in the cache queue based on the request start time and request end time of the streaming media data; or, based on the updated request start time and request end time of the streaming media data, it determines the streaming media data to be acquired in the cache queue. The acquisition module is used to acquire streaming media data to be acquired in the cache queue.
11. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the streaming media data caching method as described in any one of claims 1 to 8.
12. A computer-readable storage medium, characterized in that, When the instructions in the computer-readable storage medium are executed by the processor of the electronic device, the electronic device is able to perform the streaming media data caching method as described in any one of claims 1 to 8.
13. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by the processor, they implement the streaming media data caching method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Method and device for monitoring video
CN101867786A
Audio and video data capturing method, audio and video data snapshot method, related device and system
CN110324552A
Video recording method, terminal and computer readable storage medium
CN110324698A