Carousel flow pushing control method and device thereof, equipment and medium
By introducing intranet cache and intelligent traffic diversion strategies into the video carousel service, the problem of video carousel service reliance on external content distribution networks in the existing technology is solved, and more efficient video loading and playback is achieved, bandwidth costs are reduced, and user experience is improved.
Patent Information
- Application Number
- CN202410856311.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2025-04-25
Smart Images

Figure CN119893156A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network live broadcast technology, and in particular to a method for controlling carousel streaming and its device, equipment, and medium. Background Art
[0002] As an innovative way of communication, live streaming has not only greatly enriched people's ways of obtaining information and entertainment, but also played an important role in many fields such as social interaction, educational communication, and commercial marketing.
[0003] As a key component of live streaming, video carousel provides users with a continuous flow of information and interactive experience by playing video content in a loop, effectively improving user participation and satisfaction. The video carousel service provides users with a convenient experience of instant access and continuous viewing by playing selected video content in a loop. Video carousel not only enhances user participation and satisfaction, but also brings higher content exposure and commercial value to the platform.
[0004] However, in existing technical practices, video carousel services generally rely on external content distribution networks (CDNs) to store and distribute video content. Although this method ensures wide coverage of content, it also brings a series of challenges. In traditional carousel streaming services, video files are usually uploaded to external content distribution networks. When the carousel streaming service pushes video streams, it needs to pull video files from the external content distribution network. When the number of files to be pushed is huge, it will cause many problems:
[0005] First, the stability and response speed of live broadcast services are affected by the fluctuations in CDN service performance. The bandwidth peak problem is particularly prominent during peak hours, resulting in slow video loading or playback jams, affecting the user viewing experience. Second, the high bandwidth cost has become the main factor restricting the development of live broadcast platforms. With the growth of the user base and the improvement of video resolution, the cost of CDN services has also risen. In addition, the autonomy of live broadcast platforms in content updates and personalized recommendations is limited, which to a certain extent affects the optimization of user experience and the formation of platform characteristics. Summary of the invention
[0006] The purpose of the present application is to solve the above-mentioned problems and to provide a carousel streaming control method and its corresponding device, equipment, non-volatile readable storage medium, and computer program product.
[0007] According to one aspect of the present application, a method for controlling a carousel streaming is provided, comprising:
[0008] Receive a request for obtaining a carousel video submitted by a media service, and determine a feature identifier of a video file required by the request;
[0009] According to the feature identifier, query the file index library of the intranet cache system to determine whether the video file has been cached. If not, retrieve the video file from the external storage system according to the feature identifier and cache it in the intranet cache system, and associate the feature identifier of the cached video file with the source address and the cache address and store it in the file index library;
[0010] When the video file has been cached, the cache address and the return source address of the video file in the file index library are constructed as diversion strategy information and sent to the media service, so that the media service first pulls the video file according to the cache address for live broadcast. When the media service does not obtain the video file, it pulls the video file according to the return source address for live broadcast.
[0011] According to another aspect of the present application, a carousel streaming control device is provided, comprising:
[0012] A request response module, configured to receive a request for obtaining a carousel video submitted by a media service, and determine a feature identifier of a video file required by the request;
[0013] A back-to-source cache module is configured to query a file index library of an intranet cache system according to the feature identifier to determine whether the video file has been cached. If the video file has not been cached, the module retrieves the video file from an external storage system according to the feature identifier and caches the video file in the intranet cache system, and associates the feature identifier of the cached video file with the back-to-source address and the cache address and stores the cached video file in the file index library;
[0014] The diversion control module is configured to, when the video file has been cached, construct the cache address and the return source address of the video file in the file index library as diversion strategy information, and send it to the media service, so that the media service first pulls the video file according to the cache address for live broadcast, and when the media service does not obtain the video file, pulls the video file according to the return source address for live broadcast.
[0015] According to another aspect of the present application, a carousel streaming control device is provided, comprising a central processing unit and a memory, wherein the central processing unit is used to call and run a computer program stored in the memory to execute the steps of the carousel streaming control method described in the present application.
[0016] According to another aspect of the present application, a non-volatile readable storage medium is provided, which stores a computer program implemented according to the carousel streaming control method in the form of computer-readable instructions, and when the computer program is called and executed by a computer, the steps included in the method are executed.
[0017] According to another aspect of the present application, a computer program product is provided, including a computer program / instruction, wherein when the computer program / instruction is executed by a processor, the steps of the method described in any one of the embodiments of the present application are implemented.
[0018] The technical solution of the present application realizes the construction of a cache technology architecture for the carousel streaming service. Compared with the prior art, the technical solution of the present application has many technical advantages, including but not limited to:
[0019] First of all, from the perspective of performance optimization and resource management, this application achieves precise positioning of video content by receiving a request for obtaining a carousel video submitted by a media service and determining the characteristic identifier of the video file required for the request. Subsequently, the file index library of the intranet cache system is queried. This query process is not only fast but also efficient because it is directly related to whether the video file has been cached. If the video file is not cached, it will automatically retrieve the video file from the external storage system and cache it in the intranet cache system. At the same time, the characteristic identifier is associated with the return address and the cache address for storage, laying the foundation for subsequent resource scheduling. This intelligent pre-caching mechanism significantly improves the video loading speed, reduces dependence on external network resources, optimizes resource allocation, and thus reduces network bandwidth consumption. Since external dependence is reduced, the impact of bandwidth peak problems during peak hours is naturally reduced, thereby improving the stability and response speed of the live broadcast service and improving the user viewing experience.
[0020] Secondly, from the perspective of user experience and service continuity, this application implements intelligent traffic diversion by constructing diversion strategy information and sending the cache address and back-source address of cached video files to the media service. This means that the media service can give priority to using cache resources when there is a cache, and then go back to the source to obtain them when the cache resources are not available, thereby ensuring the stability and continuity of the live video broadcast. Even in the event of a failure or delay in the external storage system, the intranet cache system can ensure the continuous supply of video files, greatly improving the user's viewing experience and reducing buffering and interruptions.
[0021] Furthermore, in response to the high bandwidth cost problem, this application reduces the bandwidth demand for the external storage system, that is, the external CDN, through an intelligent pre-caching mechanism. When the video file is not cached, it will automatically go back to the external storage system to obtain the video file and cache it in the intranet cache system. This method not only reduces the dependence on CDN bandwidth, but also reduces the cost of repeatedly transmitting the same video content through the caching mechanism. With the growth of the user base and the improvement of video resolution, the benefits of the intranet cache system will become more obvious, effectively controlling the bandwidth cost of the live broadcast platform.
[0022] Finally, from the perspective of system maintenance and scalability, the automated caching and source return mechanism of this application simplifies system maintenance work, reduces the need for manual intervention, and thus reduces operation and maintenance costs. At the same time, it supports dynamically adding or updating the cache of video files so that it can flexibly respond to changing media service needs, improving the scalability and adaptability of the system. This design not only makes system maintenance easier, but also facilitates future technology upgrades and expansions, ensuring the long-term stable operation of the carousel streaming service. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0024] Figure 1 A schematic diagram of a backend network architecture of an exemplary application environment of the present application;
[0025] Figure 2 A flowchart of an embodiment of a method for controlling carousel streaming of the present application;
[0026] Figure 3 This is a principle block diagram of the carousel streaming control device of the present application;
[0027] Figure 4 This is a structural diagram of a carousel streaming control device used in this application. DETAILED DESCRIPTION
[0028] See also Figure 1 , Figure 1 The example shows the background network architecture for implementing the carousel streaming control method of the present application in the application scenario of the live broadcast platform. The architecture is composed of several key components, including a carousel server, a media server, an intranet cache server, an external storage system, and a streaming storage network. These components work together to achieve efficient video content distribution and management, thereby ensuring the provision of carousel streaming services for the live broadcast platform.
[0029] The core component is the carousel server, which installs and runs the computer program product implemented according to the carousel streaming control method of the present application, and is responsible for executing all key steps in the control method to implement and open the carousel streaming service. The carousel server is the hub for uploading, managing and distributing video content. It receives video playback requests from the media server, processes these requests, and generates diversion strategy information.
[0030] As the access point for user requests, the media server is responsible for forwarding the user's playback request to the carousel server and ultimately providing the video content to the user. Together with the carousel server and the intranet cache server, it is connected through the same switch / gateway to form a high-speed and secure intranet environment.
[0031] The role of the intranet cache server is to store frequently accessed video files to reduce dependence on external storage systems and speed up access to video content. When the carousel server receives a video request, it first queries the intranet cache server. If the video file is already in the cache, it is directly provided to the media server, thereby speeding up the loading and playback of the video.
[0032] The external storage system is deployed in the external network as the original repository of video content. When the required video file is not available in the intranet cache server, the carousel server will initiate a back-to-source request to the external storage system to obtain the video file.
[0033] The push-stream storage network is also deployed in the external network, responsible for streaming and storing video files and providing streaming addresses for media services. These addresses are used for end-user video downloads and playback. The intelligent design of the push-stream storage network allows the media server to store video files in the network and determine their streaming addresses. It also allows the carousel server to actively push video files to the network and provide streaming addresses to the media server.
[0034] It should be pointed out that the term "intranet" mentioned in this application refers to a private network in the same network environment as components such as a carousel server, a media server, and an intranet cache server. This network environment is usually controlled and managed by the operator of the live broadcast platform, providing a safe and efficient data transmission and processing platform. The design of the intranet allows high-speed data exchange, and due to its closed nature, it can reduce external security threats and ensure the stability and reliability of data transmission. In contrast, the "extranet" refers to the Internet or other public network environment, which is an open network space, and any device connected to the network can transmit and communicate data. Exogenous storage systems and streaming storage networks are deployed in such external networks, and they face more network delays and security risks compared to the intranet environment. Access to the extranet usually needs to be achieved through an Internet service provider (ISP), so it may be affected by bandwidth limitations and network congestion, and corresponding rental costs will also be incurred.
[0035] Based on this background network architecture, the following introduces the principle of the background network architecture serving the carousel streaming control method of this application:
[0036] When a user wants to enter a carousel channel or a live broadcast room that plays a video stream in a carousel manner, a corresponding carousel video playback request is triggered and sent to the media server. As the access point for user requests, the media server is responsible for converting these requests into carousel video acquisition requests and effectively forwarding them to the carousel server. The carousel server is the core of the entire system. It installs and runs the computer program product implemented according to the present application, is responsible for processing carousel video playback requests, and generates diversion strategy information.
[0037] After receiving the request to obtain the carousel video, the carousel server first queries the intranet cache server, which is used to store frequently accessed video files to reduce reliance on external storage. If the intranet cache server has cached the required video file, it will quickly respond to the request of the carousel server and provide the video content directly to the media server, thereby accelerating the loading and playback of the video and ensuring a smooth user experience.
[0038] If the required video file is not available in the intranet cache system, the carousel server will initiate a back-to-source request to the external storage system. The external storage system, deployed in the external network, serves as the original repository of video content. It receives the back-to-source request and provides the corresponding video file for the carousel server to process and distribute.
[0039] After the media server obtains the corresponding video file, it can store it in the push stream storage network. Therefore, the push stream storage network also plays an important role. It is responsible for pushing and storing video files and providing push stream addresses for media services. These push stream addresses allow end users to download and play videos. The intelligent design of the push stream storage network allows the media server to store video files in the network and determine its push stream address. It also allows the carousel server to actively push video files to the network and provide the push stream address to the media server.
[0040] Finally, the media server provides the streaming address to the terminal user, and the live broadcast program on the terminal user side downloads the corresponding video file according to the streaming address, plays the video file through the video player, and the corresponding carousel video images can be viewed in its graphical user interface.
[0041] See also Figure 2 According to a carousel streaming control method provided by the present application, the method is applied to a carousel server to provide corresponding carousel streaming services. In one embodiment, the method includes the following steps:
[0042] Step S3100: receiving a request for obtaining a carousel video submitted by a media service, and determining a feature identifier of a video file required by the request;
[0043] When the media service initiates a carousel video playback request on the user side, it generates and submits a carousel video acquisition request containing the video file feature identifier. The feature identifier can be the name, ID, URL or other attributes that can uniquely identify the video file. The feature identifier can be used to accurately locate and quickly retrieve the video content.
[0044] An effective communication mechanism is pre-established between the media service and the carousel server. For example, HTTP, HTTPS or other network protocols can be used to send and receive carousel video acquisition requests. During the transmission process, the request usually passes through the necessary network layers, such as the application layer, transport layer and network layer, until it reaches the carousel server. Since the carousel server and the media server are in the same intranet environment, the reliability of communication between the two is high.
[0045] After receiving the request for obtaining the video of the carousel, the carousel server will parse the characteristic identifier in the request to further determine the video file required by the user. The specific format of the video file can be any format suitable for encapsulating video data, whether it is a common MP4, MKV or other format of video files, as long as they have a unique characteristic identifier, they can be recognized and processed by the carousel server.
[0046] Step S3200: query the file index library of the intranet cache system according to the feature identifier to determine whether the video file has been cached; if not, retrieve the video file from the external storage system according to the feature identifier and cache it in the intranet cache system; associate the feature identifier of the cached video file with the source address and the cache address and store it in the file index library;
[0047] The file index library stores the feature identifiers of all cached video files in the intranet cache system, as well as the corresponding cache addresses and back-to-source addresses. When the carousel server receives a request to obtain a carousel video, it uses the feature identifier as a keyword to perform a search operation in the file index library.
[0048] The implementation of the search operation usually relies on efficient data retrieval algorithms, such as hash table search or balanced tree search, to ensure that specific video file records can be quickly located even on large-scale data sets. If there is a corresponding entry in the file index library, it means that the video file has been cached in the intranet, and the carousel server can directly provide the cache address and the source address, thereby accelerating the distribution process of video content.
[0049] If the query result shows that the video file has not been cached, the carousel server will start the back-to-source mechanism. This mechanism requires sending a back-to-source request to the external storage system to obtain the uncached video file. The external storage system can be a cloud storage service or other video content provider. After receiving the back-to-source request, they will provide the complete content of the video file or the corresponding data stream.
[0050] After obtaining the video file from the external storage system, the carousel server caches it in the intranet cache system and associates the feature identifier of the video file with the new source address and cache address and stores them in the file index library. In this way, it not only provides services for the current video playback request, but also provides the ability to quickly respond to subsequent possible requests for the same carousel video.
[0051] For example, if a video file has the name "example_video.mp4" and the ID "vid123" as its characteristic identifiers, the carousel server will first search for these identifiers in the file index library. If it is found that the video is cached, the server will use the cache address to provide the video content; if it is not cached, the server will initiate a back-to-source request to the external source and update the file index library after the video file arrives, ensuring that subsequent requests can be quickly responded to through the intranet cache system. This process not only improves the video loading speed, but also reduces the bandwidth pressure on the external storage system, optimizing the overall resource allocation and cost-effectiveness.
[0052] Step S3300: When the video file has been cached, the cache address and the return source address of the video file in the file index library are constructed as diversion strategy information, and sent to the media service, so that the media service first pulls the video file according to the cache address for live broadcast. When the media service does not obtain the video file, it pulls the video file according to the return source address for live broadcast.
[0053] If the video file is determined to be cached in the intranet cache system during the query process, the diversion strategy information can be constructed and sent to the media service. If the video file is already cached, the carousel server will use the cache address and back-to-source address stored in the file index library to construct the diversion strategy information.
[0054] The diversion strategy information is a strategy that guides the media service on how to obtain video content, including the cache address and back-to-source address of the video file. The cache address is the exact location where the video file is stored in the intranet cache system, while the back-to-source address is the location of the video file in the external storage system. Together, these two addresses ensure that the media service can choose the best way to obtain the video file based on the current network conditions and system load. Of course, given the performance advantages of the intranet cache system, the media service usually gives priority to obtaining the corresponding video file using the cache address.
[0055] In one embodiment, the diversion strategy information may include a priority indication, which may be a specific identifier or may be expressed by arranging the cache address and the back-to-source address in the data structure of the diversion strategy information, thereby instructing the media service to first try to pull the video file from the intranet cache system. If the media service fails to successfully obtain the video file based on the cache address, it may be because the cache is invalid or the video file has been removed. At this time, the back-to-source address in the diversion strategy information will be used as an alternative solution, and the media service can initiate a request to the external storage system based on this back-to-source address to pull the video file.
[0056] The construction of the diversion strategy information involves encapsulating the cache address and the back-source address into a recognizable and executable format, which can be achieved by defining a data structure, such as a structure or class containing two fields (cache address and back-source address). In addition, in order to ensure the security and integrity of the diversion strategy information, a digital signature can be further added to the information and encrypted.
[0057] Once the diversion strategy information is generated, the carousel server will send it to the media service. After receiving this information, the media service will perform the video file pull operation according to the instructions. If the media service successfully obtains the video file from the intranet cache system, it can quickly start video playback; if it fails to obtain it, it will request the video file from the external storage system according to the back-source address in the diversion strategy information.
[0058] For example, suppose the diversion strategy information received by the media service contains the following addresses: the cache address is "http: / / intranet-cache / video / vid123.mp4" and the source address is "https: / / external-storage / video / vid123.mp4". The media service first tries to pull the video file through the cache address. If it fails, it automatically switches to the source address for pulling. This process ensures efficient distribution of video content and provides the necessary redundancy mechanism to cope with different network and system conditions.
[0059] According to the above description, if the media service tries to pull the video file according to the cache address provided in the diversion strategy information but fails to obtain it successfully, the media service will use the return source address contained in the diversion strategy information instead. The return source address points to the video file in the external storage system, and the media service directly pulls the video file from this address, ensuring that the video content can still be successfully obtained and played even if the intranet cache is unavailable.
[0060] However, the media server may not be able to obtain the diversion strategy information for some reason, such as errors or loss during the transmission of the diversion strategy information, resulting in the media service not knowing the cache address and the return source address. In this case, the media service monitors whether the time to obtain the diversion strategy information has timed out. When the timeout occurs, it actively initiates a query request to the external storage system and uses the feature identifier of the video file to obtain the corresponding return source address. Once a valid return source address is received, the media service will directly pull the video file based on this address to ensure that the continuity of the playback process is not affected.
[0061] It can be seen that in some embodiments, when the media service fails to obtain the video file according to the cache address in the diversion strategy information, the video file is pulled according to the return-to-source address in the diversion strategy information; when the media service cannot obtain the diversion strategy information and fails to obtain the video file, the return-to-source address corresponding to the feature identifier is obtained from the external storage system, and the video file is directly pulled according to the return-to-source address.
[0062] These two processing mechanisms together form a robust video content acquisition process that can ensure that the user's video playback experience is not affected under different network conditions and system conditions. Through this intelligent diversion and return-to-source strategy, not only the distribution efficiency of video content is optimized, but also the stability and reliability of the entire carousel video playback service are improved.
[0063] According to the above embodiments, the technical solution of the present application realizes the construction of a cache technology architecture for the carousel streaming service, and has many technical advantages, including but not limited to:
[0064] First of all, from the perspective of performance optimization and resource management, this application achieves precise positioning of video content by receiving a request for obtaining a carousel video submitted by a media service and determining the characteristic identifier of the video file required for the request. Subsequently, the file index library of the intranet cache system is queried. This query process is not only fast but also efficient because it is directly related to whether the video file has been cached. If the video file is not cached, it will automatically retrieve the video file from the external storage system and cache it in the intranet cache system. At the same time, the characteristic identifier is associated with the return address and the cache address for storage, laying the foundation for subsequent resource scheduling. This intelligent pre-caching mechanism significantly improves the video loading speed, reduces dependence on external network resources, optimizes resource allocation, and thus reduces network bandwidth consumption. Since external dependence is reduced, the impact of bandwidth peak problems during peak hours is naturally reduced, thereby improving the stability and response speed of the live broadcast service and improving the user viewing experience.
[0065] Secondly, from the perspective of user experience and service continuity, this application implements intelligent traffic diversion by constructing diversion strategy information and sending the cache address and back-source address of cached video files to the media service. This means that the media service can give priority to using cache resources when there is a cache, and then go back to the source to obtain them when the cache resources are not available, thereby ensuring the stability and continuity of the live video broadcast. Even in the event of a failure or delay in the external storage system, the intranet cache system can ensure the continuous supply of video files, greatly improving the user's viewing experience and reducing buffering and interruptions.
[0066] Furthermore, in response to the high bandwidth cost problem, this application reduces the bandwidth demand for the external storage system, that is, the external CDN, through an intelligent pre-caching mechanism. When the video file is not cached, it will automatically go back to the external storage system to obtain the video file and cache it in the intranet cache system. This method not only reduces the dependence on CDN bandwidth, but also reduces the cost of repeatedly transmitting the same video content through the caching mechanism. With the growth of the user base and the improvement of video resolution, the benefits of the intranet cache system will become more obvious, effectively controlling the bandwidth cost of the live broadcast platform.
[0067] Finally, from the perspective of system maintenance and scalability, the automated caching and source return mechanism of this application simplifies system maintenance work, reduces the need for manual intervention, and thus reduces operation and maintenance costs. At the same time, it supports dynamically adding or updating the cache of video files so that it can flexibly respond to changing media service needs, improving the scalability and adaptability of the system. This design not only makes system maintenance easier, but also facilitates future technology upgrades and expansions, ensuring the long-term stable operation of the carousel streaming service.
[0068] Based on any embodiment of the method of the present application, after returning the video file from the external storage system to the intranet cache system according to the feature identifier, the method further includes:
[0069] Step S4100: determining whether the cached video file is a large file or a small file; if the file is a small file, directly regularizing the file index data of the small file to the video data header of the small file;
[0070] In the field of live webcasting, especially for popular video file formats such as MP4, the video data structure usually includes a series of data blocks, such as video frames, audio frames, metadata, etc. These data blocks are arranged in a specific order to ensure that the video can be decoded and played correctly. However, when video files are cached and transmitted, if the file index data (such as the MOOV atom, which contains the index information of the video file) is located at the end of the file or scattered in different locations in the file, it may cause inefficiency in retrieving video content in the cache system because the player needs to scan the entire file to locate the starting point of the video data.
[0071] In order to solve this problem, the present application performs file index data regularization on the video file. During the regularization process, the file index data is moved or copied to the header of the video file, so that when the video file is requested, the player can quickly access the index information, thereby speeding up the video loading time, reducing the I / O operations of the cache system, and improving the overall performance of the system.
[0072] For example, consider an MP4 video file with a MOOV atom at the end of the file. In this application, the MOOV atom can be moved to the beginning of the file, or a quick index pointing to the MOOV atom can be created in the file header. In this way, when the media service needs to pull a video file from the intranet cache system, it can immediately locate the starting point of the video data without performing additional search operations.
[0073] Through this regularization, video file access becomes more efficient, especially on live broadcast platforms where video content is frequently rotated and played on demand. Regularizing file index data not only improves user experience, but also optimizes the distribution process of video content and reduces the delay and resource consumption caused by retrieving video data.
[0074] Step S4200: if the file is a large file, the large file is first divided into a plurality of small files, and then the file index data of each small file is regularized into the video data header of the corresponding small file;
[0075] For cached video files, in addition to indexing small files, it is also necessary to process large files to improve cache efficiency and access speed. There are two ways to identify and segment large files: one is based on video length, and the other is based on video storage size.
[0076] In one embodiment, identifying and cutting large files based on video duration means that the video can be divided into multiple segments based on its playback duration. For example, a two-hour video can be divided into several ten-minute segments. Each segment is stored as a small file and has its own independent index data. The advantage of this method is that it allows viewers to jump to different playback periods more quickly during live broadcasts without having to load the entire long video.
[0077] In another embodiment, the large file is identified and cut based on the video storage size, and the split point is determined based on the file size. For example, if the system sets a threshold, such as each small file does not exceed 2GB, then any video file exceeding this size will be split into multiple small files, each of which contains a portion of video data and corresponding index data.
[0078] In the file index library, to support this sharded storage structure, each small file is assigned a unique identifier and records the large file to which they originally belong. The index library maintains a mapping relationship that associates these small files with their order, the identifier of the original large file, and their cache addresses in the intranet cache system. In this way, when the media service needs to obtain a large file, it can query all related small files through the file index library and obtain their cache addresses in the correct order.
[0079] For example, if a large file is split into four small files, the file index library will record the start and end timestamps of each small file, as well as their locations in the intranet cache system. When the media service requests this large file, it can retrieve the relevant information of the four small files through the file index library and pull them in chronological order to achieve seamless playback.
[0080] In this way, not only the storage efficiency of large files in the intranet cache system is optimized, but also it is ensured that the media service can correctly and efficiently obtain the small files of each fragment of the large file, thereby improving the response speed of video playback and user experience.
[0081] As for the method of organizing the file index data of each small file, it is the same as the method of organizing in the previous step S4100 and will not be repeated here.
[0082] Step S4300: Upload the small files whose file index data has been organized to the external storage system for storage.
[0083] After the previous steps, no matter whether the video file is a large file or a small file, it will eventually be processed into a small file. After the file index data of the small file is organized, these processed small files can be uploaded to an external storage system for storage to ensure that the optimized small files can be safely saved and effectively retrieved and accessed when needed.
[0084] During the upload process, each small file will retain its associated information with the original large file, including but not limited to the file segmentation order, timestamp, and location in the intranet cache system, etc. This information is crucial to maintaining the integrity and order of the file, ensuring seamless splicing and smooth experience during video playback.
[0085] For example, suppose a large file is divided into four small files, each of which contains index information organized into the header of the video data. When uploading these small files, the system will record the relevant information of each file and allocate appropriate storage space for them in the external storage system. At the same time, the system will also update the file index library to reflect the latest status and location of these small files.
[0086] In addition, the uploaded small files will follow specific naming rules or metadata tags to facilitate identification and classification in external storage systems. This includes file segmentation identifiers, feature identifiers of the original video files, and possible version or revision information, thus ensuring file consistency and traceability.
[0087] It should be noted that the embodiments defined in step S4100 to step S4300 can be triggered by a variety of mechanisms to achieve efficient management and playback of video files. For example:
[0088] In some embodiments, when a new video is uploaded to the intranet storage system, or when a video file from an external storage system is cached in the intranet cache system for the first time, the carousel server can automatically detect the corresponding video file and execute these steps to perform necessary segmentation and index optimization.
[0089] In another embodiment, these steps may also be executed periodically and triggered to run at certain time intervals. During the running process, steps S4100 to S4300 are executed by scanning each video file in the intranet cache system to ensure that the video files remain in the best state.
[0090] It can be seen that different trigger conditions may lead to the implementation of the embodiments defined by steps S4100 to S4300 to adapt to different management requirements and playback scenarios, thereby ensuring smooth playback of video content and optimization of system performance.
[0091] According to the description of the above embodiments, the above embodiments have further advantages around the two key measures of video segmentation and index data regularization, including but not limited to:
[0092] First, by splitting large video files into multiple small files, users can access different parts of the video content more quickly on the live broadcast platform. This segmentation mechanism not only reduces user waiting time, but also makes video playback more flexible, allowing users to easily jump to any segment of the video, greatly improving the viewing experience.
[0093] Secondly, the file index data is regularized to ensure that the index information is located at the head of the video data, thereby speeding up the retrieval of video content. This improvement significantly reduces the I / O operations of the cache system and improves the overall performance of the carousel streaming service. At the same time, the regular index data also optimizes the storage efficiency of video files in the intranet and extranet storage systems, reducing the delay and resource consumption caused by retrieving video data;
[0094] In addition, the combination of video segmentation and file index data regularization enables this application to improve the speed of video loading and playback while also enhancing the stability and reliability of the system. By combining intelligent caching strategies with efficient file management, the carousel streaming service can more flexibly respond to different video playback requirements, ensuring smooth playback of video content and optimization of system performance.
[0095] On the basis of any embodiment of the method of the present application, returning to the external storage system to obtain the video file and caching it in the intranet cache system according to the feature identifier includes:
[0096] Step S5600: Send a return-to-source request carrying the characteristic identifier to the external storage system, and obtain a return-to-source address returned by the external storage system;
[0097] When it is necessary to obtain a video file from an external storage system and cache it in the intranet cache system, the first operation is to send a back-to-source request to the external storage system. Based on this, a back-to-source request containing a feature identifier is constructed and sent to the external storage system.
[0098] A feature identifier is a unique identification information used to specify and identify the desired video file. It can be a file name, ID, hash value, or any other identifier that can uniquely determine the properties of a video file. When constructing a back-to-origin request, the feature identifier is embedded in the request parameters to ensure that the external storage system can accurately identify and locate the requested video file.
[0099] Since the intranet cache system used by the carousel streaming service can trigger a back-to-source request only when the video file is not retrieved based on the request of the media service, the feature identifier can usually directly use the feature identifier transmitted by the media service.
[0100] After sending the back-to-source request, the external storage system will process the request and return a back-to-source address. The back-to-source address is the network link or path to the storage location of the video file in the external storage system. This address enables the intranet cache system to accurately locate and access the video file for subsequent download and cache operations.
[0101] For example, if the feature identifier is the hash value of a video file, this hash value will be used as a parameter to send a back-to-source request to the cloud storage service of the external storage system. After receiving the request, the cloud storage service will find and return the URL address of the video file based on the hash value. This URL address is the back-to-source address, and the intranet cache system will use this address to download the video file.
[0102] Through this step, the intranet cache system can efficiently retrieve the required video files from the external storage system and prepare for the next cache operation. This process is automated, ensuring the fast distribution and availability of video content, while also providing the system with the necessary flexibility to handle a large number of video file requests.
[0103] Step S5700: Determine a target cache area provided by an available hard disk in a target cache node in the intranet cache system according to the back-to-source address;
[0104] After successfully obtaining the back-to-source address, the next task is to determine the target cache area in the intranet cache system. This requires analyzing the back-to-source address and determining the cache node and its available hard disk in the intranet based on the address, and then selecting a suitable storage area for caching video files.
[0105] In one embodiment, the target cache area is selected based on the current state of the intranet cache system, including the storage capacity, load and hard disk usage of each node. All available cache nodes are evaluated and an optimal cache node is selected to store the video file. This selection can be based on a comprehensive decision of multiple factors, such as the storage space size, access speed and historical cache efficiency of the cache node.
[0106] For example, if the intranet cache system consists of multiple cache nodes, each cache node contains multiple hard disk drives. Check the hard disk usage of each cache node, including the remaining space and read and write speed of the hard disk, to determine whether the hard disk is available. Then, apply a predetermined strategy, such as polling, least used principle, priority-based scheduling, or hash algorithm-based, to select an available hard disk as the target cache area.
[0107] In another embodiment, when selecting the target cache area, hot spots of the cache may also be considered, i.e., geographical locations or network areas where video files are frequently accessed. By caching video files on nodes close to the hot spots, delays can be further reduced and access speeds can be increased.
[0108] In addition, the number of available hard disks can be dynamically adjusted using hot-swap events of cache nodes. For example, if a hard disk is removed or replaced, the system will update its list of available hard disks and re-evaluate storage policies to ensure the continuity and efficiency of cache operations.
[0109] Through this step, the intranet cache system can efficiently utilize its storage resources and ensure that video files are cached in the optimal location, thereby improving the response speed and service quality of the entire system.
[0110] Step S5800: Download the corresponding video file according to the return-to-source address, and store the video file in the target cache area.
[0111] After determining the target cache area in the intranet cache system, the next step is the actual video file download operation. Specifically, this step uses the back-to-source address to download the video file from the external storage system and stores the downloaded file in the previously determined target cache area.
[0112] The download process begins when the intranet cache system initiates a request for the video file based on the back-source address. This request can be an HTTP GET request or other appropriate network protocol request, the purpose of which is to retrieve the video data from the external storage system. The back-source address is part of the request, guiding the external storage system to provide the correct video file.
[0113] Once the external storage system receives the back-to-source request, it will start to transfer the video file data, which will be transmitted over the network to the intranet cache system. During the data transmission process, the intranet cache system may use a variety of technologies to ensure the efficiency and reliability of the transmission, such as multi-threaded downloading, breakpoint resuming, error detection and verification, etc.
[0114] For example, if the back-to-source address points to an MP4 video file on a cloud storage service, the intranet cache system will send an HTTP GET request pointing to the file. The external storage system responds to the request and sends the video file data back to the intranet cache system. After receiving the data, the intranet cache system writes the data to the previously selected target cache area, such as a specific available hard disk.
[0115] In addition, in order to improve the fault tolerance and adaptability of the system, the download operation can include an integrity check of the video file. For example, the downloading video file can be verified to be complete and undamaged by comparing the hash value of the file.
[0116] Through this step, the intranet cache system not only successfully caches the video content locally, but also prepares for rapid response to future playback requests. It also reduces dependence on external storage systems and reduces bandwidth consumption and latency caused by frequent return to the source.
[0117] As can be seen from the above description, the embodiments disclosed in the above steps also have many technical advances, including but not limited to:
[0118] First, by using the back-to-source address to directly retrieve video files from the external storage system, this embodiment optimizes the retrieval process of video content. This process not only improves the retrieval efficiency, but also significantly improves the video loading speed and playback fluency by caching video files to the intranet. This efficient caching strategy reduces the dependence on the external storage system, reducing latency and bandwidth consumption.
[0119] Secondly, the above embodiment intelligently selects the optimal cache node and hard disk by comprehensively considering the storage capacity, load and hard disk usage of each node in the intranet cache system. This intelligent resource allocation mechanism ensures that the video files are stored in the location with the best performance and highest availability, thereby improving the response speed and service quality of the entire system. In addition, by dynamically adjusting the number of available hard disks, the system can flexibly respond to hardware changes and maintain the continuity and efficiency of cache operations.
[0120] Finally, in the process of downloading video files, the above embodiments use technologies such as multi-threaded downloading, breakpoint resume, and error detection and verification to enhance the stability and reliability of data transmission. Through these measures, the integrity and availability of video files can be ensured even in the case of network fluctuations or hardware failures. In addition, by verifying the integrity of the downloaded video files, the system further improves fault tolerance and ensures the continuity of playback and consistency of user experience.
[0121] Based on any embodiment of the method of the present application, determining the target cache area provided by the available hard disk in the target cache node in the intranet cache system according to the back-to-source address includes:
[0122] Step S5710: in response to a hot-plug event or a fault-enabling event of a target cache node, updating the number of available hard disks of the target cache node;
[0123] In an intranet cache system, ensuring the availability of cache nodes is critical to maintaining system performance. The number of available hard disks in a cache node may change due to a variety of situations, including hot swapping of hard disks and hard disk failure and repair. Step S5710 is a step based on a response mechanism to handle these changes and ensure that the system always operates according to the latest hardware status.
[0124] Each cache node is usually composed of multiple hard disks, each of which is used to provide a corresponding cache area to store data such as video files. In this configuration, the hot-swap function of the hard disk allows the hard disk to be removed or added without restarting the system, which improves the flexibility and maintainability of the system. However, the increase or decrease of hard disks will directly affect the number of available hard disks, which in turn affects the allocation of cache areas. In addition, failure factors caused by hard disk performance will also affect the number of available hard disks.
[0125] In order to adapt to such changes and ensure the accuracy of cache allocation, the system needs to be able to respond to hot-plug events and fault enable / disable events and update the number of available hard disks of the target cache node accordingly. Specifically, when a hard disk is inserted (disabled) or removed (enabled) in the system, the system detects this change and triggers an update process. This process re-evaluates the total number of hard disks available on the current cache node and updates the system's records accordingly.
[0126] Hot-swap events mean that hard disks can be safely added or removed while the system is running, without having to restart the entire system. This flexibility allows the system to dynamically adjust its storage resources. When a new hard disk is inserted into the system, the system needs to recognize this change and update the count of available hard disks. Correspondingly, if a hard disk is removed, the system also needs to reduce the count of available hard disks accordingly.
[0127] For example, suppose a cache node originally has four hard disks, and after a hot-swap event, it may become three or five hard disks. The system monitors these events and updates the record of the number of hard disks in real time to ensure that subsequent cache area allocation can be based on the latest hardware configuration. In this way, the system can ensure that video files are allocated to the correct hard disks while optimizing the use of storage space.
[0128] Failure enable events involve situations where a drive becomes unavailable due to a failure, or when a drive is repaired and re-enabled. When a drive fails, the system detects the failure and marks it as unavailable, updating the number of available drives. This process is called a failure-triggered disable event. Conversely, when a failed drive is repaired and rejoins service, the system re-increases the count of available drives through a failure-cleared enable event.
[0129] These events are triggered by the hardware's condition monitoring system or monitoring software on the cache node. For example, if a drive begins to show signs of performance degradation or becomes completely inaccessible, the condition monitoring system will recognize this state and trigger a fault-triggered disable event. Similarly, once the drive is repaired and passed testing, the system will trigger a fault-cleared enable event to mark the drive as available.
[0130] The implementation of step S5710 ensures that the intranet cache system can respond quickly when the number of hard disks changes. The system monitors these events and automatically updates the count of available hard disks when hot plug or fault enable events are detected. If these events do not occur, step S5710 will not be executed because the system status is already up to date. This response mechanism enables the intranet cache system to flexibly respond to dynamic changes in hardware configuration, improve the reliability and resilience of the system, maintain efficient data storage and retrieval operations, ensure the accuracy and efficiency of cache area allocation, and thus improve the performance and reliability of the entire system.
[0131] Step S5720: Apply a hash algorithm to convert the source address of the video file obtained from the external storage system into an integer value;
[0132] In the intranet cache system, after completing the update of the number of hard disks, the system needs to map the video files to a specific cache area. To this end, a hash algorithm is used to process the source address of the video file to ensure that the video files are evenly and reasonably distributed to different hard disks.
[0133] A hash algorithm is a mathematical method that can convert an input of any length (in this case, a source address) into an output of a fixed length, that is, an integer value (hash value). The key advantage of this process is its deterministic and uniform distribution characteristics, that is, the same input always produces the same output, and the output value is evenly distributed within the possible range.
[0134] In the process of applying the hash algorithm, the system first receives the source address of the video file from the external storage system. This address is the unique identifier of the video file in the external storage system and may contain the file's path, name, or other related information. The system then uses the source address as input and processes it through the hash algorithm to generate an integer value.
[0135] For example, assuming that the source address of a video file is "http: / / external-storage / video / vid123.mp4", the system inputs this address into the hash algorithm to obtain an integer value, such as 12345. This value is then used to determine the storage location of the video file in the intranet cache system. Step S5730, the integer value is modulo the number of available hard disks of the target cache node in the intranet cache system, and the cache area provided by the available hard disk corresponding to the remainder is used as the target cache area.
[0136] After completing the hash algorithm processing and obtaining the integer value corresponding to the source address, the next task is to map this integer value to a specific available hard disk to determine the storage location of the video file.
[0137] To achieve this mapping, the system uses the remainder method to allocate the cache area. Specifically, the system performs a remainder operation on the integer value obtained by the hash algorithm and the number of available hard disks in the target cache node. The remainder operation is a simple mathematical operation that divides the integer value by the number of available hard disks, and the remainder obtained will be used to determine the specific hard disk index.
[0138] For example, suppose the integer value obtained by the system through the hash algorithm is 12345, and the target cache node currently has 8 available hard disks. The system performs a remainder operation: 12345%8, and the remainder obtained is 1. This means that the video file will be stored on the hard disk with index 1. In other examples, if the remainder is 7, the video file is stored on the hard disk with index 7.
[0139] The advantage of this remainder allocation method is that it is evenly distributed, which can avoid the situation where some hard disks are overloaded while other hard disks are idle, thereby balancing the storage load of each hard disk. In addition, due to the determinism of the hash algorithm, the same back-to-source address is always mapped to the same hard disk, which helps improve the stability and predictability of the system.
[0140] In actual applications, the system may need to handle different numbers of hard disks. For example, when the number of hard disks changes (perhaps due to a hot-swap event or a fault-enabling event), the system will recalculate the remainder based on the latest number of hard disks to ensure that the video files are stored correctly. This dynamic adjustment capability allows the system to flexibly respond to hardware changes and maintain efficient cache management.
[0141] In this way, the system can efficiently distribute video files to different hard disks, while avoiding storage location confusion caused by the increase or decrease of hard disks. This process not only improves the efficiency of storage allocation, but also ensures the uniform distribution of data, which helps to balance the load of each hard disk and extend their service life.
[0142] The above embodiments have achieved significant technical progress in the carousel streaming service, which is mainly reflected in the following aspects:
[0143] First, the system can respond immediately to the hot-swap and fault-enabled events of hard disks in the intranet cache node, and ensure the accuracy of cache allocation by updating the number of hard disks. This ability to quickly adapt to hardware changes improves the system's response speed to dynamic environments and enhances the reliability and stability of the entire system.
[0144] Secondly, the hash algorithm is used to process the source address of the video file, and combined with the remainder method, the data is evenly distributed among the hard disks. This strategy not only ensures the effective storage of video files, but also improves the storage efficiency and performance of the system by avoiding hard disk overload.
[0145] In addition, based on the accurate number of available hard disks, the determinism of the hash algorithm combined with the remainder allocation method ensures consistent storage locations for the same video files, thereby enhancing the stability and predictability of the system. This method reduces the storage location confusion caused by hard disk changes and ensures the continuity and efficiency of data storage and retrieval operations.
[0146] On the basis of any embodiment of the method of the present application, before determining the target cache area provided by the available hard disk in the target cache node in the intranet cache system according to the back-to-source address, the method includes:
[0147] Step S5100: monitor the connection beacons of each cache node in the intranet cache system, and determine the cache node with the continuous connection beacon as the available cache node;
[0148] In an intranet cache system, it is necessary to effectively identify and utilize available cache nodes in order to optimize storage performance. To this end, a monitoring mechanism can be implemented to detect the activity and connection status of cache nodes. This mechanism relies on periodic signals sent from each cache node, called connection beacons.
[0149] A connection beacon is a signal broadcast periodically by a cache node, indicating that the node is currently in normal working condition and ready to receive data. These connection beacons are equivalent to the "life signs" of the node, allowing the system to monitor the availability of each cache node in real time. When a cache node is operating normally, it will continue to send connection beacons; if the cache node encounters a failure or goes offline, the connection beacon will stop sending.
[0150] The system determines which cache nodes are active by listening to these connection beacons and marks them as available cache nodes. For example, in a network consisting of multiple cache nodes, the system will continue to receive connection beacons from each cache node. If the connection beacon of a cache node is continuously received by the system, the system will determine that the cache node is available and list it in the list of available cache nodes as an available cache node.
[0151] This method of listening to connection beacons enables the system to dynamically identify and maintain the real-time status of available cache nodes, thereby providing an accurate basis for data allocation and storage decisions. In this way, the system can ensure that data is stored on valid and available cache nodes, while improving the efficiency and reliability of the entire cache system. If the connection beacon of a cache node stops, the system will automatically remove it from the available list to ensure that data is not allocated to unavailable nodes.
[0152] Step S5200: select an available cache node according to a preset strategy, bind it as a target cache node, and determine a cache address of the video file cached therein according to the network address of the target cache node;
[0153] Once the available cache nodes are identified, the next step is to select a suitable node to store the video file. This selection process is based on a set of preset policies to ensure that data is efficiently and reasonably distributed to the resources in the system.
[0154] The preset strategy may include a variety of different decision factors, such as the storage capacity of the node, the current load, historical performance, data access patterns, etc. The following are some optional embodiments:
[0155] In one embodiment, a random selection strategy is adopted: in the list of available cache nodes, the system can randomly select a node as the target cache node. This method is simple and easy to implement, and helps to evenly distribute the storage load.
[0156] In one embodiment, a polling selection strategy is adopted: the system can select each node as the target cache node in turn according to the order of the node list. This method can ensure that all nodes are used fairly and avoid some nodes being overloaded while other nodes are idle.
[0157] In one embodiment, a load balancing selection strategy is adopted: the system can select the node with the lightest load according to the current load of each node, which helps to optimize resource utilization and reduce the pressure on a single node.
[0158] In one embodiment, a performance priority selection strategy is adopted: if some nodes have higher performance indicators, such as faster read and write speeds or lower latency, the system can give priority to these nodes with better performance.
[0159] In one embodiment, a geographical location selection strategy is adopted: in a distributed cache system, according to the access hotspots of video files, the system can select nodes that are geographically close to the hotspots to reduce data transmission delays.
[0160] In one embodiment, a failure rate selection strategy is adopted: the system can consider the historical failure rate of the nodes and give priority to nodes with low failure rates to improve the reliability and stability of the data.
[0161] After selecting the target cache node according to any of the above preset strategies, the system will bind it as the storage node of the current video file and determine the cache address of the video file based on the network address of the node. The network address usually includes the IP address and port number of the target cache node. This cache address is then used to guide the media service or other system components to access and store video data.
[0162] For example, suppose the system detects three available cache nodes A, B, and C according to the load balancing selection strategy, among which node B has the lowest current load. The system will select node B as the target cache node and use its network address to specify the storage location of the video file. In this way, the video file will be effectively cached on node B, and the system is also ready to select other nodes according to the preset strategy when necessary.
[0163] Step S5300: When the connection beacon of the target cache node no longer exists, reselect the target cache node from other available cache nodes according to a preset strategy.
[0164] To ensure the continuity and availability of video files, the intranet storage system needs to be able to dynamically adapt to node changes. When a connection beacon that has been selected as a target cache node no longer exists, it indicates that the node may have encountered a failure or is offline and cannot continue to undertake storage tasks.
[0165] At this point, the system will initiate a reselection process, selecting a new target cache node from the current list of available cache nodes according to the same set of preset policies used to select the target cache node. This process ensures that the system can maintain its caching and data distribution functions even if some nodes fail.
[0166] For example, if the system adopts a load balancing selection strategy and the current target cache node suddenly goes offline, the system will re-evaluate the load of each node in the available node list and select a new node with the lowest load as the new target cache node. If the system adopts a performance priority selection strategy, it will select the node with the best performance to take over the storage task.
[0167] After the target cache node is reselected, the system will update the file index library or related data structures to reflect this change. In this way, when media services or other system components try to access video files, they will be directed to the new cache address, thereby continuing seamless video playback and data access.
[0168] Through this mechanism, the intranet cache system can not only cope with the immediate failure of cache nodes, but also flexibly adjust resource allocation according to the current status of the system and preset strategies, ensuring the stability and availability of video content and providing users with continuous and reliable services.
[0169] According to the above embodiments, the robustness of the intranet cache system is significantly improved by introducing the connection beacon mechanism. As a periodic broadcast signal of the active status of the cache node, the connection beacon enables the system to monitor and dynamically evaluate the health status of each node in real time. This real-time monitoring capability allows the system to respond quickly to any changes in the node, such as failures or offline conditions, and ensures the continuity and reliability of data storage and distribution operations by instantly updating the list of available nodes. In addition, the system uses a preset strategy to quickly reselect the target cache node based on the status of the connection beacon, thereby achieving rapid recovery from failures and flexible adjustment of resources. This dynamic management and rapid response mechanism based on connection beacons not only improves the system's fault tolerance, but also optimizes resource utilization, extends the service life of hardware, reduces maintenance costs, and provides users with a more stable and efficient video content caching solution.
[0170] On the basis of any embodiment of the method of the present application, constructing the cache address and the back-source address of the video file in the file index library as diversion strategy information and sending it to the media service includes:
[0171] Step S3310: Add a digital signature to the traffic diversion strategy information to obtain signature data;
[0172] In the process of building diversion strategy information, in order to ensure the security and verification of the information, a digital signature can be added to the diversion strategy information. A digital signature is an electronic signature used to prove the source and integrity of the diversion strategy information. The strategy information is processed by using a private key encryption algorithm to generate a unique string of signature data.
[0173] In one embodiment, when adding a digital signature, the diversion strategy information is encrypted using a private key known only to the system to generate signature data. Correspondingly, the recipient will use the corresponding public key to decrypt the signature data to verify whether the information has not been tampered with. It can be seen that the digital signature ensures that the diversion strategy information is sent by a trusted source, that is, the sender.
[0174] For example, when the system generates a diversion strategy information containing a video file cache address and a back-to-source address, the system will use the private key to encrypt the information and generate signature data. This signature data is then sent to the media service together with the original diversion strategy information. The media service will use the public key to decrypt the signature data to confirm the authenticity and integrity of the diversion strategy information. Step S3320: Encrypt the signature data to obtain the diversion strategy ciphertext;
[0175] In terms of ensuring the security of diversion strategy information, encrypting the signature data can further enhance security and reliability. Although the signature data is generated by a private key, in order to further protect this data from being intercepted or tampered with by unauthorized third parties during transmission, the signature data needs to be encrypted.
[0176] In one embodiment, when encrypting the signature data, a suitable encryption algorithm, such as AES, RSA or other industry standard encryption technology, is selected to encrypt the signature data. A secure key management system is used to store and use encryption keys to ensure the confidentiality and integrity of the keys. The encrypted signature data is converted into a secure form, i.e., a diversion strategy ciphertext, for transmission in an insecure channel.
[0177] For example, once the signature data is generated, the carousel streaming service will encrypt the data using an encryption key to create a ciphertext as the diversion strategy ciphertext. This ciphertext contains the signature data consisting of the diversion strategy information and its digital signature, which will be sent to the media server.
[0178] In this way, even if the data is intercepted during transmission, the true content of the signed data cannot be read without the correct decryption key, thus ensuring the security and confidentiality of the diversion strategy information. This encryption measure provides an additional layer of security for information transmission, making information more secure and reliable when transmitted in a complex network environment.
[0179] Step S3330: Serialize the traffic diversion strategy ciphertext into a binary data stream and transmit it to the media service, so that the media service performs a reverse conversion according to the binary data stream to obtain the traffic diversion strategy information.
[0180] Before transmitting the diversion policy ciphertext, it needs to be converted into a format suitable for network transmission. Serialization is the key to this process, which converts the diversion policy ciphertext into a transmittable format, such as a binary data stream. This format facilitates efficient transmission on the network and can be restored to the original data structure at the receiving end.
[0181] The diversion policy ciphertext will be serialized into a binary data stream before being sent and then transmitted to the media server, where the media service will reversely convert the received binary data stream, i.e., deserialize it, to restore the original diversion policy ciphertext.
[0182] Based on the traffic diversion policy ciphertext, the media service uses the pre-shared key to decrypt the ciphertext and obtain the original signature data and traffic diversion policy information. Subsequently, the signature data is decrypted by applying the public key to obtain the traffic diversion policy information, and then the authenticity of the information is verified with the traffic diversion policy information carried along. Once the verification is passed, the media service can extract the cache address and the back-to-source address from the traffic diversion policy information and pull the video file based on these addresses.
[0183] According to the above embodiments, through the serialization and deserialization process, the security and integrity of the diversion strategy information during transmission are guaranteed, and the media service can accurately obtain and use this key information. This mechanism provides a secure and efficient transmission protocol for the distribution of video content.
[0184] Based on any embodiment of the method of the present application, the method further includes:
[0185] Step S8100, obtaining call statistics formed by counting the video files that have been historically called, wherein the call statistics include popular video files in the video files cached in the intranet cache system and their call peak time periods and call hotspot areas;
[0186] The call statistics are generated in advance. The original data for statistics comes from the user's access records of video files in the intranet cache system. Whenever a user requests a video file, relevant information such as the video file feature identifier, request time, user geographic location, etc. is recorded in the log system.
[0187] The first step in generating call statistics is data collection, for example, by monitoring and recording the user's access activities to video files. The collected data includes but is not limited to the video file ID, user IP address, request timestamp, and the user's geographic region.
[0188] Subsequently, these raw data go through data preprocessing steps such as cleaning, deduplication and formatting for easy analysis. The preprocessed data are input into the statistical analysis module, which uses statistical methods to identify and calculate the access frequency, peak hours and hot spots of video files.
[0189] For example, in one embodiment, time series analysis is used to identify peak hours of user access, such as a specific time of day or a specific day of the week. At the same time, the geographic location corresponding to the user's IP address is analyzed through a geographic information system (GIS), thereby determining the hot spots of video content.
[0190] Through the above analysis, the system can build a statistical table containing popular video files, peak call time periods, and call hotspots. Each record in the table reflects the user's access pattern to a specific video file, including the identifier of the video file, the most frequently accessed time period, and the most frequently visited geographical location, which is the call hotspot.
[0191] This statistical process is automated and can be executed periodically by the backend of the carousel streaming service to ensure the real-time and accuracy of the call statistics. The generated call statistics provide important decision support for subsequent video content optimization and distribution strategies, allowing video services to more accurately meet user needs.
[0192] Step S8200: During each peak calling period, the popular video file is pushed to the optimal storage node in the streaming storage network for the calling hotspot area of the popular video file, and the streaming address of the popular video file corresponding to the optimal storage node is determined;
[0193] After obtaining the call statistics, intelligent push operations can be performed based on this data to optimize the distribution efficiency of video content. Specifically, the carousel push service identifies popular video files, peak call times, and hot call areas, and dynamically adjusts the storage location of video files in the push storage network based on this information.
[0194] Peak call times are specific time periods when user traffic increases significantly, such as prime time in the evening or holidays. The carousel push service uses this data to predict future user access patterns and prepare in advance. Before these peak times arrive, the carousel push service will proactively push popular video files to the push storage network to ensure that these files can respond quickly during periods of high user traffic.
[0195] The goal of the push operation is to select the optimal storage node, which is usually determined after a comprehensive evaluation of factors such as geographic location, network latency, and storage performance. The optimal storage nodes are those that can provide the fastest access speeds for users in hot spots. For example, if a video file is very popular among users in the eastern United States, the carousel push service will select a storage node that is geographically close to that area and push the video file to that node.
[0196] After determining the optimal storage node, the carousel streaming service will generate a streaming address for the popular video file. This address is the specific access path of the video file in the streaming storage network. The streaming address is designed to be easy to understand and remember, so that the media service can access it quickly.
[0197] For example, assuming that a video file has a large number of viewing demands in the New York area between 8 and 10 p.m. every day, the carousel push streaming service will recognize this pattern and push the video file to the optimal storage node in the New York area before 7 p.m. Subsequently, the carousel push streaming service will generate a push streaming address, such as "http: / / streaming-server.com / popu l ar_video_new_york_8pm", which is specifically used for access during the peak time period of 8 p.m. Step S8300, push the popular video list containing the feature identifier of the popular video file and its push streaming address to the media service, so that the media service will preferentially query and obtain the corresponding push streaming address from the popular video list according to the feature identifier for live broadcast during any peak call period.
[0198] After the popular video files are identified and the streaming addresses are determined, a popular video list can be generated and pushed to the media service. This list contains the characteristic identifiers of the popular video files and the corresponding streaming addresses, which are obtained by calling the statistical data analysis.
[0199] The process of generating a popular video list begins by collecting information about all popular video files, including their feature identifiers and corresponding streaming addresses. This information is organized into a structured list, and each entry contains enough information to facilitate the media service to quickly locate and access the video content.
[0200] Each entry in the list clearly indicates a specific feature identifier of a video file, such as a video ID or name, and the corresponding streaming address. For example, an entry in the list may look like this:
[0201] Video ID: vid123
[0202] Streaming address: http: / / streaming-server.com / popul ar_video_new_york_8pm
[0203] This list is then pushed to the media service, allowing it to quickly access these popular video files during peak call times. Pushing can be achieved through various communication protocols, such as HTTP, HTTPS, or other protocols suitable for communication between the media service and the carousel streaming service.
[0204] After receiving the popular video list, the media service can quickly search and obtain the corresponding streaming address in the list according to the feature identifier of the user's request. In this way, when the user requests to watch a popular video, the media service can directly pull the video content from the optimal storage node, thereby providing a faster and more reliable video playback experience.
[0205] For example, if a user requests to watch a popular video in the New York area at 8 p.m., the media service will use the video's feature identifier to search in the popular video list and quickly find the corresponding streaming address. The media service then uses this address to pull the video content directly from the streaming storage network, achieving fast response and efficient playback.
[0206] According to the above embodiments, the popular data obtained based on historical data can achieve the following further technical advantages:
[0207] First, by analyzing historical call data, this embodiment can accurately identify popular video files and their peak access patterns, and achieve optimal allocation of resources in the streaming storage network. This data-based prediction and pre-allocation mechanism significantly improves the access speed of video content and the overall performance of the system.
[0208] Secondly, the automated push process described in this embodiment reduces human intervention and reduces errors and delays caused by manual operations. The intelligent push mechanism ensures that video files are cached to the best node in time before the peak demand, improving the system's responsiveness and user viewing experience.
[0209] In addition, the content distribution strategy can be dynamically adjusted based on real-time statistical data to adapt to changing user needs and network conditions. This flexibility and adaptability ensures that video playback remains stable and smooth even when user demand surges or the network environment changes.
[0210] See also Figure 3According to one aspect of the present application, a carousel streaming control device is provided, including a request response module 3100, a back-to-source cache module 3200, and a diversion control module 3300, wherein the request response module 3100 is configured to receive a carousel video acquisition request submitted by a media service and determine a feature identifier of a video file required by the request; the back-to-source cache module 3200 is configured to query a file index library of an intranet cache system according to the feature identifier to determine whether the video file has been cached, and when the video file has not been cached, back-to-source obtain the video file from an external storage system according to the feature identifier. The video file is cached to the intranet cache system, and the characteristic identifier of the cached video file is associated with the back-source address and the cache address and stored in the file index library; the diversion control module 3300 is configured to, when the video file has been cached, construct the cache address and the back-source address of the video file in the file index library as diversion strategy information, and send it to the media service, so that the media service first pulls the video file according to the cache address for live broadcast, and when the media service does not obtain the video file, it pulls the video file according to the back-source address for live broadcast.
[0211] Based on any embodiment of the device of the present application, in the diversion control module 3300, when the media service fails to obtain the video file, the video file is pulled according to the return-to-source address, including: when the media service fails to obtain the video file according to the cache address in the diversion strategy information, the video file is pulled according to the return-to-source address in the diversion strategy information; when the media service cannot obtain the diversion strategy information and fails to obtain the video file, the return-to-source address corresponding to the feature identifier is obtained from the external storage system, and the video file is directly pulled according to the return-to-source address.
[0212] On the basis of any embodiment of the device of the present application, after the operation of the back-to-source cache module 3200, the device also includes: a type identification module, configured to determine whether the cached video file belongs to a large file or a small file, and when it belongs to a small file, directly organize the file index data of the small file into the video data header of the small file; a file slicing module, configured to, when it belongs to a large file, first split the large file into multiple small files, and then organize the file index data of each small file into the video data header of the corresponding small file; a file upload module, configured to upload the small file with the completed file index data to the external storage system for storage.
[0213] Based on any embodiment of the device of the present application, the back-to-source cache module 3200 includes: a back-to-source address acquisition module, which is configured to send a back-to-source request carrying the characteristic identifier to an external storage system to obtain a back-to-source address returned by the external storage system; a target storage area determination module, which is configured to determine the target cache area provided by an available hard disk in a target cache node in the intranet cache system according to the back-to-source address; and a video download cache module, which is configured to download a corresponding video file according to the back-to-source address and store the video file in the target cache area.
[0214] Based on any embodiment of the device of the present application, the target storage area determination module includes: an available quantity update module, which is configured to update the number of available hard disks of the target cache node in response to a hot plug event or a fault enable / disable event of the target cache node; a hash mapping conversion module, which is configured to apply a hash algorithm to convert the return source address of the video file obtained from the external storage system into an integer value; an available addressing determination module, which is configured to take the remainder of the integer value and the number of available hard disks of the target cache node in the intranet cache system, and use the cache area provided by the available hard disk corresponding to the remainder as the target cache area.
[0215] On the basis of any embodiment of the device of the present application, prior to the operation of the target storage area determination module, it includes: a node on-off monitoring module, which is configured to monitor the connection beacons of each cache node in the intranet cache system, and determine the cache node with a continuous connection beacon as an available cache node; a target node selection module, which is configured to select an available cache node according to a preset strategy, bind it as a target cache node, and determine the cache address of the video file cached therein according to the network address of the target cache node; a target node disaster recovery module, which is configured to re-select the target cache node from other available cache nodes according to a preset strategy when the connection beacon of the target cache node no longer exists.
[0216] Based on any embodiment of the device of the present application, the diversion control module 3300 includes: a digital signature module, configured to add its digital signature to the diversion strategy information to obtain signature data; a data encryption module, configured to encrypt the signature data to obtain a diversion strategy ciphertext; a data transmission module, configured to serialize the diversion strategy ciphertext into a binary data stream and then transmit it to the media service, so that the media service performs a reverse conversion according to the binary data stream to obtain the diversion strategy information.
[0217] On the basis of any embodiment of the device of the present application, the device also includes: a statistical analysis module, configured to obtain call statistics formed by statistics of historically called video files, the call statistics including popular video files in the video files cached in the intranet cache system and their peak call periods and call hot spots; a preheating streaming module, configured to push the popular video files to the optimal storage node in the streaming storage network facing the call hot spots of the popular video files in each peak call period, and determine the streaming address corresponding to the popular video file in the optimal storage node; a list push module, configured to push a popular video list containing the feature identifier of the popular video file and its streaming address to the media service, so that the media service can preferentially query and obtain the corresponding streaming address from the popular video list according to the feature identifier for live broadcast during any peak call period.
[0218] Another embodiment of the present application also provides a carousel streaming control device. Figure 4 As shown, a schematic diagram of the internal structure of a carousel streaming control device. The carousel streaming control device includes a processor, a computer-readable storage medium, a memory, and a network interface connected via a system bus. Among them, the computer-readable non-volatile readable storage medium of the carousel streaming control device stores an operating system, a database, and computer-readable instructions. The database may store an information sequence. When the computer-readable instructions are executed by the processor, the processor can implement a carousel streaming control method.
[0219] The processor of the carousel streaming control device is used to provide computing and control capabilities to support the operation of the entire carousel streaming control device. The memory of the carousel streaming control device may store computer-readable instructions, which, when executed by the processor, may enable the processor to execute the carousel streaming control method of the present application. The network interface of the carousel streaming control device is used to connect and communicate with a terminal.
[0220] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the scheme of the present application, and does not constitute a limitation on the carousel streaming control device to which the scheme of the present application is applied. The specific carousel streaming control device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0221] In this embodiment, the processor is used to execute Figure 3The memory stores the program code and various data required to execute the above modules or submodules. The network interface is used to realize data transmission between user terminals or servers. The non-volatile readable storage medium in this embodiment stores the program code and data required to execute all modules in the carousel streaming control device of this application, and the server can call the program code and data of the server to execute the functions of all modules.
[0222] The present application also provides a non-volatile readable storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the carousel streaming control method of any embodiment of the present application.
[0223] The present application also provides a computer program product, including a computer program / instruction, which implements the steps of the method described in any embodiment of the present application when executed by one or more processors.
[0224] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments of the present application can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a computer-readable storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
Claims
1. A method for controlling a carousel streaming, characterized in that: include: Receive a request for obtaining a carousel video submitted by a media service, and determine a feature identifier of a video file required by the request; According to the feature identifier, query the file index library of the intranet cache system to determine whether the video file has been cached. If not, retrieve the video file from the external storage system according to the feature identifier and cache it in the intranet cache system, and associate the feature identifier of the cached video file with the source address and the cache address and store it in the file index library; When the video file has been cached, the cache address and the return source address of the video file in the file index library are constructed as diversion strategy information and sent to the media service, so that the media service first pulls the video file according to the cache address for live broadcast. When the media service does not obtain the video file, it pulls the video file according to the return source address for live broadcast.
2. The method for controlling the streaming of a carousel according to claim 1, characterized in that: After obtaining the video file from the external storage system according to the feature identifier and caching it in the intranet cache system, the method further includes: Determine whether the cached video file is a large file or a small file. If it is a small file, directly regularize the file index data of the small file to the video data header of the small file. When it is a large file, the large file is first divided into multiple small files, and then the file index data of each small file is regularized to the video data header of the corresponding small file; The small files with neatened file index data are uploaded to the external storage system for storage.
3. The method for controlling the streaming of a carousel according to claim 1, characterized in that: According to the feature identifier, the video file is retrieved from the external storage system and cached in the intranet cache system, including: Sending a return-to-source request carrying the characteristic identifier to the external storage system, and obtaining a return-to-source address returned by the external storage system; Determine, according to the back-to-source address, a target cache area provided by an available hard disk in a target cache node in the intranet cache system; The corresponding video file is downloaded according to the return-to-source address, and the video file is stored in the target cache area.
4. The method for controlling the streaming of a carousel according to claim 3, characterized in that: Determining a target cache area provided by an available hard disk in a target cache node in an intranet cache system according to the back-to-source address includes: In response to a hot-plug event or a fault-enabling event of a target cache node, updating the number of available hard disks of the target cache node; Apply a hash algorithm to convert the source address of the video file obtained from the external storage system into an integer value; The integer value is modulo the number of available hard disks of the target cache node in the intranet cache system, and the cache area provided by the available hard disk corresponding to the remainder is used as the target cache area.
5. The method for controlling the streaming of a carousel according to claim 3, characterized in that: Before determining the target cache area provided by the available hard disk in the target cache node in the intranet cache system according to the back-to-source address, the method includes: Monitor the connection beacons of each cache node in the intranet cache system, and determine the cache node with the continuous connection beacon as the available cache node; An available cache node is selected according to a preset strategy, and is bound to the target cache node, so as to determine a cache address of the video file cached therein according to the network address of the target cache node; When the connection beacon of the target cache node no longer exists, the target cache node is reselected from other available cache nodes according to a preset strategy.
6. The method for controlling the streaming of a carousel according to claim 1, characterized in that: Constructing the cache address and the source address of the video file in the file index library as diversion strategy information and sending it to the media service, including: Adding a digital signature to the diversion strategy information to obtain signature data; Encrypting the signature data to obtain a traffic diversion strategy ciphertext; The diversion strategy ciphertext is serialized into a binary data stream and then transmitted to the media service, so that the media service performs a reverse conversion according to the binary data stream to obtain the diversion strategy information.
7. The method for controlling the streaming of a carousel according to any one of claims 1 to 6, characterized in that: The method further includes: Obtain call statistics formed by counting the video files that have been historically called, wherein the call statistics include popular video files among the video files cached in the intranet cache system and their call peak time periods and call hotspot areas; During each peak calling period, the popular video file is pushed to the optimal storage node in the streaming storage network for the calling hotspot area of the popular video file, and the streaming address of the popular video file corresponding to the optimal storage node is determined; A popular video list including the characteristic identifier of the popular video file and its streaming address is pushed to the media service, so that the media service can preferentially query and obtain the corresponding streaming address from the popular video list according to the characteristic identifier for live broadcast during any peak calling period.
8. A carousel streaming control device, characterized in that: include: A request response module, configured to receive a request for obtaining a carousel video submitted by a media service, and determine a feature identifier of a video file required by the request; A back-to-source cache module is configured to query a file index library of an intranet cache system according to the feature identifier to determine whether the video file has been cached. If the video file has not been cached, the module retrieves the video file from an external storage system according to the feature identifier and caches the video file in the intranet cache system, and associates the feature identifier of the cached video file with the back-to-source address and the cache address and stores the cached video file in the file index library; The diversion control module is configured to, when the video file has been cached, construct the cache address and the return source address of the video file in the file index library as diversion strategy information, and send it to the media service, so that the media service first pulls the video file according to the cache address for live broadcast, and when the media service does not obtain the video file, pulls the video file according to the return source address for live broadcast.
9. A carousel streaming control device, comprising a central processing unit and a memory, characterized in that: The central processing unit is used to call and run the computer program stored in the memory to execute the steps of the method according to any one of claims 1 to 7.
10. A non-volatile readable storage medium, characterized in that: It stores a computer program implemented according to the carousel streaming control method in the form of computer-readable instructions. When the computer program is called and executed by a computer, the steps included in the method as claimed in any one of claims 1 to 7 are executed.