A management method and system for live video data storage service
By introducing a distributed storage architecture and intelligent allocation plan into live video transfer, the problem of single point of failure and dynamic expansion and contraction is solved, efficient and reliable live video data storage is achieved, and the risk of data loss and resource waste is reduced. .
Patent Information
- Application Number
- CN202410892487.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-04
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2044-07-04
AI Technical Summary
The existing live video transfer solution has the risk of single point of failure and the inability to dynamically expand and shrink the capacity, resulting in data loss and resource waste.
Adopting a distributed architecture, through multiple available storage nodes, each node runs the data storage process, generates an allocation plan to indicate the target live video data stored by each node, monitors the node status in real time, and dynamically adjusts resources to achieve the allocation of storage tasks and troubleshooting.
It reduces the risk of single points of failure, realizes dynamic expansion and contraction of resources, improves storage efficiency and system reliability, and ensures data integrity and user experience.
Smart Images

Figure CN118450161B
Abstract
Description
Technical Field
[0001] The present application relates to the field of live video storage technology, and in particular to a management method and system for live video data storage services. Background Art
[0002] With the rapid development of Internet technology, live video has become a widely used form of entertainment, communication and online teaching. Its real-time, interactive and rich features are well-received by users and widely used in various Internet products. However, after the live broadcast, in order to facilitate subsequent learning and research, company operation quality inspection and other needs, the live broadcast content usually needs to be converted into video files for storage.
[0003] At present, the mainstream live video transfer solution mainly relies on high-configuration servers running the ffmpeg program to convert and store live streams by pulling the live stream address. However, this solution has the following problems:
[0004] Single point failure risk: Since all live broadcast room video transfer tasks are concentrated on a single server, once the server fails, the video storage of all live broadcast rooms will be affected, and there is a risk of data loss.
[0005] Difficulty in dynamic expansion and contraction: As the live broadcast business develops, the number of live broadcast rooms may change rapidly. However, the existing solution cannot dynamically adjust server resources according to business needs, resulting in resource waste or failure to meet business needs.
[0006] It can be seen that in the prior art, when transferring live video, there is a risk of single point failure and the problem of being unable to dynamically expand or shrink capacity. Summary of the invention
[0007] The purpose of this application is to provide a management method and system for a live video data storage service, so as to solve the problem in the prior art that there is a single point failure risk and the capacity cannot be dynamically expanded or reduced when the live video is transferred.
[0008] In order to achieve the above purpose, the technical solution adopted in this application is as follows:
[0009] According to one aspect of an embodiment of the present application, a management method for a live video data storage service is provided, which is applied to a storage service management end, and includes: obtaining at least one available storage node reported by a storage end of the live video, and multiple live video data to be stored, wherein the available storage node runs a data storage process for storing the live video data; generating an allocation plan based on all available storage nodes and the live video data, wherein the allocation plan is used to indicate target live video data that each available storage node among the multiple live video data needs to store; according to the allocation plan, sending a start storage command to each available storage node, so that each available storage node starts the data storage process to store the target live video data after receiving the start storage command, wherein the start storage command carries information for indicating the target live video data to be stored.
[0010] According to the above technical means, by introducing multiple available storage nodes, each available storage node runs a data storage process, and can store multiple live video data at the same time. This distributed architecture makes the video transfer task no longer concentrated on a single server, thereby greatly reducing the risk of single point failure. In addition, the management method can dynamically add or delete storage nodes according to business needs to achieve dynamic expansion and contraction of resources.
[0011] Furthermore, an allocation plan is generated based on all available storage nodes and live video data, including: determining the amount of target live video data that each available storage node needs to store based on the total amount of live video data and the number of available storage nodes; determining the target live video data according to preset rules based on the amount of target live video data and the live video data; and generating an allocation plan by making a one-to-one correspondence between each available storage node and the target live video data.
[0012] According to the above technical means, the storage service management end can intelligently generate an allocation plan based on the information of all available storage nodes reported by the storage end and the multiple live video data to be stored. This allocation plan can ensure that each node receives an appropriate amount of storage tasks based on its performance, load and available storage space, thereby improving the overall storage efficiency.
[0013] Further, after sending a start storage command to each available storage node according to the allocation plan, it includes: receiving node information continuously reported by each available storage node; determining whether there is a target storage node whose service is unavailable among all available storage nodes based on the node information reported by all available storage nodes; when it is determined that there is a target storage node, eliminating the target storage node and sending an end storage command to terminate storage to the target storage node, so that the target storage node terminates the currently running data storage process.
[0014] According to the above technical means, by monitoring the execution of the storage command during the live video transfer process, the integrity and accuracy of the data in the storage process can be ensured. Through real-time monitoring, potential faults can be discovered and resolved in a timely manner, system performance can be optimized, and reasonable allocation of resources can be achieved to meet compliance requirements. At the same time, security risks are reduced, thereby improving user experience and ensuring reliable storage and efficient access to live video data.
[0015] Furthermore, based on the node information reported by all available storage nodes, a target storage node whose service is unavailable among the available storage nodes is determined, including: obtaining a target time interval between two consecutive reports of node information from each available storage node; if the target time interval is greater than a first preset time interval and no node information reported by the available storage node is received, it is determined that the available storage node service is unavailable, and the available storage node is the target storage node.
[0016] According to the above technical means, by monitoring the time interval between two consecutive reports of node information by each available storage node, the service status of the storage node can be accurately evaluated. When this time interval exceeds the preset first time interval and no node information is received during this period, the system can quickly determine that the target storage node service may be unavailable. Such a time monitoring method ensures the timely response and stability of the storage service, provides users with a more reliable data storage experience, and allows administrators to quickly take necessary repair measures to ensure the continued availability of data.
[0017] Further, after obtaining at least one available storage node reported by the storage end of the live video, it includes: after determining that the node information reported by the storage end is received, sending confirmation information to each available storage node, wherein the confirmation information is used to indicate that the storage service management end has received the node information reported by the available storage node.
[0018] According to the above technical means, by sending confirmation information, the communication reliability and data consistency between the storage service management end and the storage node are ensured. By sending confirmation information, the management end can promptly confirm to the storage node that it has received the node information reported by it, which can not only enhance the robustness of the system, but also provide clear tracking and audit clues when failures or problems occur. In addition, this mechanism also helps to improve the automation of the system and reduce the need for human intervention, thereby improving the overall service quality and efficiency.
[0019] Furthermore, after sending a start storage command to each available storage node according to the allocation plan, it includes: receiving node information continuously reported by each available storage node; regenerating the allocation plan at every second preset time interval based on the node information and live video data reported by all available storage nodes; when it is determined that the regenerated allocation plan is different from the original allocation plan, sending a notification message to the administrator, and resending the start storage command to each available storage node according to the regenerated allocation plan.
[0020] According to the above technical means, by responding to the state changes of storage nodes in real time, the live video data is ensured to be allocated and stored in the best state. By receiving the continuously reported node information, the system can accurately grasp the real-time status of each node; regenerate the allocation plan at every preset time interval, optimize the data distribution based on the latest node information, and improve storage efficiency and stability; when the allocation plan changes, timely notify the administrator, enhance the transparency and response speed of management; finally, resend the start storage command according to the new allocation plan to ensure that the data can be stored according to the latest optimization strategy, thereby ensuring the security, reliability and high availability of live video data.
[0021] According to another aspect of the embodiment of the present application, a management method for a live video data storage service is also provided, which is applied to a storage end, including: each available storage node in the storage end receives a start storage command sent by the storage service management end, wherein the start storage command carries information in an allocation plan for indicating target live video data to be stored, and the allocation plan is generated by the storage service management end based on all available storage nodes reported by the storage end and multiple live video data to be stored, and the allocation plan is used to indicate the target live video data that each available storage node in the multiple live video data needs to store; each available storage node starts a corresponding data storage process to store the target live video data.
[0022] According to the above technical means, by introducing multiple available storage nodes, each available storage node runs a data storage process and can store multiple live video data at the same time. This distributed architecture makes the video transfer task no longer concentrated on a single server, thereby greatly reducing the risk of single point failure; and the management method can dynamically add or delete storage nodes according to business needs to achieve dynamic expansion and contraction of resources.
[0023] Furthermore, before each available storage node starts a corresponding data storage process to store the target live video data, it includes: verifying whether the live video data currently to be stored in the target live video data is being stored.
[0024] According to the above technical means, by checking each received live streaming address to verify whether the address is currently running a storage process, repeated storage operations caused by network retries, command sending errors or other abnormal situations can be avoided. By checking to ensure that each streaming address corresponds to only one running storage process, the use of storage resources can be optimized, unnecessary storage overhead can be reduced, and the risk of data confusion or errors caused by repeated storage can be reduced.
[0025] Further, after each available storage node starts the corresponding data storage process to store the target live video data, it includes: every third preset time interval, each available storage node reports the corresponding node information to the storage service management end; after determining that the storage service management end has received the reported corresponding node information, each available storage node will receive a confirmation message sent by the storage service management end, wherein the confirmation information is used to indicate that the storage service management end has received the node information reported by the available storage node; if the available storage node does not receive the confirmation message sent by the storage service management end after the third preset time interval, it is confirmed that the report has failed and the corresponding node information is re-reported; if the available storage node does not receive the confirmation message sent by the storage service management end within a continuous preset number of retries, the available storage node loses contact with the storage service management end, the available storage node is a lost storage node, the data storage process corresponding to the lost storage node is terminated, and the storage end sends an alarm message to the administrator.
[0026] According to the above technical means, when the communication between the live video storage service and the storage service management end fails for three consecutive times, by terminating all running data storage processes and issuing an alarm message, it is possible to ensure the effective use of system resources, prevent invalid video storage operations, and promptly notify the administrator to handle potential failures, thereby ensuring the stability and reliability of the live broadcast service. This processing method can quickly respond to communication failures, reduce potential risks, and improve the maintainability and user experience of the overall system.
[0027] According to another aspect of an embodiment of the present application, a management system for a live video data storage service is also provided, including: a storage service management end and a storage end; the storage service management end is configured to execute any management method for a live video data storage service applied on the storage service management end; the storage end is configured to execute any management method for a live video data storage service applied on the storage end.
[0028] According to another aspect of the embodiment of the present application, a management device for a live video data storage service is also provided, which is applied to a storage service management end, and includes: a first receiving module, used to obtain at least one available storage node reported by the storage end of the live video, and multiple live video data to be stored, wherein the available storage node runs a data storage process for storing the live video data; a dynamic allocation module, used to generate an allocation plan based on all available storage nodes and live video data, wherein the allocation plan is used to indicate the target live video data that each available storage node among the multiple live video data needs to store; a first sending module, used to send a start storage command to each available storage node according to the allocation plan, so that each available storage node starts the data storage process to store the target live video data after receiving the start storage command, wherein the start storage command carries information for indicating the target live video data to be stored.
[0029] According to another aspect of the embodiment of the present application, a management device for a live video data storage service is also provided, which is applied to a storage end and includes: a second receiving module, which is used for each available storage node in the storage end to receive a start storage command sent by the storage service management end, wherein the start storage command carries information in an allocation plan for indicating target live video data to be stored, and the allocation plan is generated by the storage service management end based on all available storage nodes reported by the storage end and multiple live video data to be stored, and the allocation plan is used to indicate the target live video data that needs to be stored in each available storage node among the multiple live video data; a data storage module, which is used for each available storage node to start a corresponding data storage process to store the target live video data.
[0030] According to another aspect of the embodiments of the present application, there is also provided an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; wherein the memory is used to store a computer program; and the processor is used to execute the method steps in any of the above embodiments by running the computer program stored in the memory.
[0031] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the method steps in any of the above embodiments when executed.
[0032] Beneficial effects of this application:
[0033] This application introduces multiple available storage nodes, each of which runs a data storage process and can store multiple live video data at the same time. This distributed architecture makes the video transfer task no longer concentrated on a single server, thereby greatly reducing the risk of single point failure. In addition, the management method can dynamically add or delete storage nodes according to business needs to achieve dynamic expansion and contraction of resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0035] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0036] Figure 1 It is a schematic diagram of a hardware environment of an optional management method of a live video data storage service provided in an embodiment of the present application;
[0037] Figure 2 It is a flowchart of an optional management method of a live video data storage service provided in an embodiment of the present application;
[0038] Figure 3 A flowchart of another optional management method of a live video data storage service provided in an embodiment of the present application;
[0039] Figure 4 It is a structural block diagram of a management system of an optional live video data storage service provided in an embodiment of the present application;
[0040] Figure 5 It is a structural block diagram of an optional management device for live video data storage service provided in an embodiment of the present application;
[0041] Figure 6 It is a structural block diagram of another optional management device for live video data storage service provided in an embodiment of the present application;
[0042] Figure 7 It is a structural block diagram of an optional electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0043] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0044] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0045] According to one aspect of an embodiment of the present application, a management method for a live video data storage service is provided, and the method is applied to a storage service management end. Optionally, in this embodiment, the management method for the live video data storage service can be applied to a hardware environment consisting of a terminal and a server. The server is connected to the terminal via a network, and can be used to provide services to the terminal or a client installed on the terminal. A database can be set on the server or independently of the server to provide data storage services for the server.
[0046] The above network may include but is not limited to at least one of the following: wired network, wireless network. The above wired network may include but is not limited to at least one of the following: wide area network, metropolitan area network, local area network, and the above wireless network may include but is not limited to at least one of the following: WIFI (Wireless Fidelity), Bluetooth. The terminal may not be limited to a PC, a mobile phone, a tablet computer, etc.
[0047] The management method of the live video data storage service of the embodiment of the present application can be executed by the server, or by the terminal, or by both the server and the terminal. The terminal can also execute the management method of the live video data storage service of the embodiment of the present application by the client installed thereon.
[0048] Taking the management method of the live video data storage service in this embodiment executed by the server as an example, please refer to Figure 1 , Figure 1 Schematic diagram of a hardware environment of an optional management method of a live video data storage service provided in an embodiment of the present application, such as Figure 1 As shown, the hardware environment of the management method of the live video data storage service includes: a terminal 102, and a server 104 connected to the terminal 102 through a network. The server 104 is used to execute the management method of the live video data storage service of the embodiment of the present application, monitor and manage the status of the available storage nodes and the operation of the data storage process running in the available storage nodes, and generate an allocation plan; the terminal 102 is used to display the status of the above-mentioned available storage nodes and the operation of the video storage process; the terminal 102 is also used to display the change information to the administrator when the allocation plan changes.
[0049] The management method of the live video data storage service in this embodiment can be applied to the scenario of live video transfer. At present, the mainstream live video transfer solution mainly relies on a high-configuration server to run the ffmpeg program, and converts and stores it by pulling the live stream address. However, this solution has the following problems: Single point failure risk: Since the video transfer tasks of all live broadcast rooms are concentrated on a single server, once the server fails, the video storage of all live broadcast rooms will be affected, and there is a risk of data loss. Difficulty in dynamic expansion and contraction: With the development of the live broadcast business, the number of live broadcast rooms may change rapidly. However, the existing solution cannot dynamically adjust server resources according to business needs, resulting in resource waste or failure to meet business needs.
[0050] To solve the above problems, this embodiment provides a management method for a live video data storage service running on the above server, where the server serves as a storage service management terminal and is configured with a storage service management service. Figure 2 , Figure 2 FIG. 1 is a flow chart of an optional method for managing a live video data storage service provided in an embodiment of the present application, and the method is applied to a storage service management end. Figure 2 As shown, the management method of the live video data storage service of the embodiment of the present application specifically includes the following steps:
[0051] Step S201, obtaining at least one available storage node reported by a storage terminal of the live video and a plurality of live video data to be stored, wherein the available storage node runs a data storage process for storing the live video data;
[0052] Step S202, generating an allocation plan according to all available storage nodes and live video data, wherein the allocation plan is used to indicate the target live video data that each available storage node in the multiple live video data needs to store;
[0053] Step S203, according to the allocation plan, a start storage command is sent to each available storage node, so that each available storage node starts a data storage process to store the target live video data after receiving the start storage command, wherein the start storage command carries information for indicating the target live video data to be stored.
[0054] Through the above steps S201 to S203, by introducing multiple available storage nodes, each available storage node runs a data storage process and can store multiple live video data at the same time. This distributed architecture makes the video transfer task no longer concentrated on a single server, thereby greatly reducing the risk of single point failure; and the management method can dynamically add or delete storage nodes according to business needs to achieve dynamic expansion and contraction of resources, and solve the problem of single point failure risk and inability to dynamically expand and contract when transferring live video in related technologies. By introducing multiple available storage nodes and intelligent allocation plans, the beneficial effects of reducing single point failure risk, dynamic expansion and contraction, improving system reliability and optimizing storage efficiency are achieved.
[0055] In this application, the storage service management end is the live-schedul-server service end, which is a web service developed in the go language and provides HTTP and grpc interfaces. It is mainly used as the control center for all live video storage services, and monitors and manages all live video storage services. In this article, in order to maintain consistency in terminology, we will use "live-schedul-server service end" to refer to the original "storage service management end." The choice of this term is intended to more accurately reflect the core function of this component in the system, which is to manage storage services. Unless otherwise specified, the "storage service management end" in this article refers to this meaning.
[0056] The storage end is deployed and run in a containerized manner using Kubernetes (K8s), an open source container orchestration engine for K8s that supports automated deployment, large-scale scalability, and application containerized management. Multiple pods that execute live video storage services are configured on the storage end. Each pod that executes live video storage services is a storage node in the live-schedul-server server. Each available storage node uses a node reporting mechanism to regularly report its current status and the data storage process being executed to the live-schedul-server server. The live-schedul-server server, as the scheduling center for the live video storage service, is responsible for the management and monitoring of all pods that execute live video storage services on the storage end and the data storage processes in the pods.
[0057] Combine the following Figure 2 The management method of the live video data storage service applied on the storage service management end in the embodiment of the present application is explained.
[0058] In the technical solution of step S201, at least one available storage node reported by the storage end of the live video and a plurality of live video data to be stored are obtained, wherein the available storage node runs a data storage process for storing the live video data.
[0059] Live video data refers to the audio and video data of the live broadcast room. Since live video is time-sensitive, it is generally transferred by obtaining the pull stream address corresponding to the live video using a specific program. Therefore, in this application, live video data specifically refers to the pull stream address corresponding to the live video. Available storage nodes are pods that perform live video storage services in the storage end.
[0060] In practice, first start the live-schedul-server server to prepare to receive the report information of the live video storage service pod. At the same time, the storage end starts the pod that executes the live video storage service. After the pod is started, it immediately reports its own node information to the live-schedul-server server. The node information includes the pod name and the data storage process information running in the pod.
[0061] In this application, the data storage process is the ffmpeg process. The ffmpeg process is a program instance for processing audio and video data. When the ffmpeg command is run in the system, one or more ffmpeg processes are started to perform specific tasks, such as video conversion, streaming media processing, etc. The ffmpeg process receives audio and video data from sources such as files, network streams, and cameras.
[0062] As an optional embodiment, after obtaining at least one available storage node reported by the storage end of the live video, it includes: after determining that the node information reported by the storage end is received, sending confirmation information to each available storage node, wherein the confirmation information is used to indicate that the storage service management end has received the node information reported by the available storage node.
[0063] When the live-schedul-server receives the report information from the pod that executes the live video storage service, it will reply with confirmation information to the pod that executes the live video storage service, and store the pod name and the ffmpeg process information that the pod is running in the local cache or other databases. The confirmation information is used to indicate that the live-schedul-server has received the node information reported by the pod that executes the live video storage service. The confirmation information is included in the HTTP response, and the live-schedul-server server replies with the confirmation information by responding to the HTTP request sent by the pod that executes the live video storage service.
[0064] It should be noted that in the initialization state, since there is no started ffmpeg process, the node information reported by the pod that executes the live video storage service in the server only contains the pod name, so the live-schedul-server server stores the pod name.
[0065] It is understandable that by sending confirmation information, the communication reliability and data consistency between the storage service management end and the storage node are ensured. By sending confirmation information, the management end can promptly confirm to the storage node that it has received the node information reported by it, which not only enhances the robustness of the system, but also provides clear tracking and audit trails when failures or problems occur. In addition, this mechanism also helps to improve the automation of the system and reduce the need for human intervention, thereby improving the overall service quality and efficiency.
[0066] In the technical solution of step S202, an allocation plan is generated according to all available storage nodes and live video data. The allocation plan is used to indicate the target live video data that each available storage node needs to store in the multiple live video data. The multiple live video data are multiple stream pull addresses, and the target live video data are a part of the stream pull addresses in the multiple stream pull addresses.
[0067] It can be understood that by using the allocation plan, it can be ensured that each storage node can fully utilize its hardware resources, such as storage space, processor and bandwidth, etc. This optimization can reduce resource waste and improve resource utilization efficiency.
[0068] As an optional embodiment, an allocation plan is generated based on all available storage nodes and live video data, including: determining the amount of target live video data that each available storage node needs to store based on the total amount of live video data and the number of available storage nodes; determining the target live video data according to preset rules based on the amount of target live video data and the live video data; and generating an allocation plan by matching each available storage node with the target live video data one by one.
[0069] In specific practice, assuming the total amount of live video data is M and the number of available storage nodes is N, the amount of target live video data P can be determined according to the following formula: P=M / N, M is a positive integer ≥ 1, and N is a positive integer ≥ 1.
[0070] After determining the number P of target live video data that each storage node needs to store, the target live video data can be determined according to preset rules. The preset rules are set according to actual conditions, and can be started from the first live video data and P live video data are taken in sequence.
[0071] In order to better illustrate the generation method of the allocation plan, an example is given. Assume that the live-schedul-server has received the node information reported by 2 pods, and there are 4 live video streaming addresses that need to be transferred. Then, according to the above formula, it can be determined that the number of target live video data that each pod needs to store is 2. Then, starting from the first of the 4 streaming addresses, 2 streaming addresses are taken in turn, and the 2 streaming addresses are matched with the pod nodes to generate an allocation plan. In the corresponding process, any rules can be used, and there is no restriction here.
[0072] It is understandable that the storage service management end can intelligently generate an allocation plan based on the information of all available storage nodes reported by the storage end and the multiple live video data to be stored. This allocation plan can ensure that each node receives an appropriate amount of storage tasks based on its performance, load, and available storage space, thereby improving the overall storage efficiency.
[0073] In the technical solution of step S203, according to the allocation plan, a start storage command is sent to each available storage node, so that each available storage node starts the data storage process to store the target live video data after receiving the start storage command, wherein the start storage command carries information for indicating the target live video data to be stored.
[0074] In practice, when each pod that executes the live video storage service is started, a live video start storage interface for receiving the corresponding start storage command is provided. The live-schedul-server server sends a start storage command to the corresponding pod that executes the live video storage service on the server through the live video start storage interface. The start storage command carries information about the target live video data to be stored that is allocated to each storage node in the allocation plan.
[0075] As an optional embodiment, after sending a start storage command to each available storage node according to an allocation plan, it includes: receiving node information continuously reported by each available storage node; determining whether there is a target storage node whose service is unavailable among all available storage nodes based on the node information reported by all available storage nodes; if it is determined that there is a target storage node, eliminating the target storage node and sending an end storage command to terminate storage to the target storage node, so that the target storage node terminates the currently running data storage process.
[0076] After sending the start storage command, the live-schedul-server will monitor the execution of the start storage command to ensure that each pod that executes the live video storage service receives and stores the allocated live video data as planned. If a pod that executes the live video storage service encounters a problem when executing the start storage command (such as network failure, insufficient storage space, etc.), the live-schedul-server will take appropriate measures in a timely manner, such as reallocating storage tasks and notifying operation and maintenance personnel to handle the problem.
[0077] In specific practice, the live-schedul-server service determines whether there is a problem with each pod that executes the live video storage service based on the node information reported by each pod that executes the live video storage service, for example: the service of the pod that executes the live video storage service is unavailable. When it is determined that the service of the pod that executes the live video storage service is unavailable, the pod that executes the live video storage service is removed, and a storage end command is sent to the target storage node to cause the target storage node to terminate the currently running data storage process. For the pod that executes the live video storage service for which the service is unavailable, the live-schedul-server service will not subsequently assign live video storage tasks to it. In the present application, when each pod that executes the live video storage service is started, a live video storage end interface for receiving the corresponding storage end command is provided. Therefore, the live-schedul-server service sends a storage end command to the pod that executes the live video storage service for which the service is unavailable through the live video storage end interface.
[0078] It is understandable that by monitoring the execution of the storage command during the live video transfer process, the integrity and accuracy of the data during the storage process can be ensured. Through real-time monitoring, potential faults can be discovered and resolved in a timely manner, system performance can be optimized, and reasonable allocation of resources can be achieved to meet compliance requirements while reducing security risks, thereby improving user experience and ensuring reliable storage and efficient access to live video data.
[0079] As an optional embodiment, based on the node information reported by all available storage nodes, a target storage node whose service is unavailable among the available storage nodes is determined, including: obtaining a target time interval between two consecutive reports of node information from each available storage node; if the target time interval is greater than a first preset time interval and no node information reported by the available storage node is received, it is determined that the available storage node service is unavailable, and the available storage node is the target storage node.
[0080] In specific practice, by analyzing the node information reported by each pod that performs live video storage service, it can be determined whether the service of each pod that performs live video storage service is unavailable. Since each pod that performs live video storage service will report its own node data and the currently running ffmpeg process every 5 seconds after startup, it can be determined whether its service is unavailable based on the target time interval of the node information reported twice in a row by each pod that performs live video storage service. Here, a time threshold can be set, that is, a first preset time interval, and the target time interval is compared with the first time interval. If the node information reported by a pod that performs live video storage service is not received after the first time interval, it is determined that the service of the pod that performs live video storage service is unavailable, and the pod that performs live video storage service is the target storage node. In specific practice, the first time interval can be set according to the actual situation, for example, it can be set to 15 seconds. Therefore, it can also be considered that when a pod that performs live video storage service fails to report its own node information for 3 consecutive times, the service of the pod that performs live video storage service is unavailable.
[0081] It is understandable that by monitoring the time interval between two consecutive reports of node information by each available storage node, the service status of the storage node can be accurately evaluated. When this time interval exceeds the preset first time interval and no node information is received during this period, the system can quickly determine that the target storage node service may be unavailable. This time monitoring method ensures the timely response and stability of the storage service, provides users with a more reliable data storage experience, and allows administrators to quickly take necessary repair measures to ensure the continued availability of data.
[0082] As an optional embodiment, after sending a start storage command to each available storage node according to the allocation plan, it includes: receiving node information continuously reported by each available storage node; regenerating the allocation plan at every second preset time interval based on the node information and live video data reported by all available storage nodes; when it is determined that the regenerated allocation plan is different from the original allocation plan, sending a notification message to the administrator, and resending the start storage command to each available storage node according to the regenerated allocation plan.
[0083] After sending the start storage command, the live-schedul-server server regenerates the allocation plan at every second time interval based on the node information reported by all pods that execute the live video storage service and the current live video data to be stored, and redistributes the target live video data that needs to be stored in the ffmpeg processes running on all current pods that execute the live video storage service, ensuring that the pressure on each pod that executes the live video storage service is as even as possible, and then recovers the live video data stored in the ffmpeg processes running on the pods that execute the live video storage service that were previously removed. In specific practice, the second time interval can be set according to actual conditions, for example, it can be set to 20 seconds.
[0084] In this application, the allocation plan is regenerated based on the following principles: new live video data is allocated first to the pod that executes the live video storage service with the least data storage processes; the pod that executes the live video storage service with more currently running processes is appropriately allocated to the pod that executes the live video storage service with the least processes, ensuring that the data storage process on each pod that executes the live video storage service has minimal changes.
[0085] For the newly generated allocation plan, the live-schedul-server server will also check whether it is the same as the previous allocation plan. If the allocation plan changes, the live-schedul-server server will send a notification message to the administrator and resend the start storage command to each pod that executes the live video storage service.
[0086] It is understandable that by responding to the status changes of storage nodes in real time, the live video data is ensured to be allocated and stored in the best state. By receiving the continuously reported node information, the system can accurately grasp the real-time status of each node; regenerate the allocation plan at every preset time interval, optimize the data distribution based on the latest node information, and improve storage efficiency and stability; when the allocation plan changes, timely notify the administrator, enhance the transparency and response speed of management; finally, resend the start storage command according to the new allocation plan to ensure that the data can be stored according to the latest optimization strategy, thereby ensuring the security, reliability and high availability of the live video data.
[0087] According to another aspect of the embodiment of the present application, a management method for a live video data storage service is also provided, and the method is applied to a storage end. Optionally, in this embodiment, the management method for the live video data storage service can also be applied to Figure 1 In the hardware environment shown in the figure. Figure 1As shown, the hardware environment of the management method of the live video data storage service includes: a terminal 102, and a server 104 connected to the terminal 102 through a network. The server 104 is used to execute the management method of the live video data storage service of the embodiment of the present application, and run the data storage process in the available storage node to store the live video; the terminal 102 is used to display alarm information to the administrator when an abnormality occurs in the data storage process.
[0088] This embodiment provides a management method for a live video data storage service running on the above server. The server is used as a storage end and is configured with a storage service. Figure 3 , Figure 3 FIG. 1 is a flow chart of another optional management method of a live video data storage service provided by an embodiment of the present application, and the method is applied to the storage end. Figure 3 As shown, the management method of the live video data storage service of the embodiment of the present application specifically includes the following steps:
[0089] Step S301: Each available storage node in the storage end receives a start storage command sent by the storage service management end, wherein the start storage command carries information in the allocation plan for indicating the target live video data to be stored, and the allocation plan is generated by the storage service management end according to all available storage nodes reported by the storage end and the multiple live video data to be stored, and the allocation plan is used to indicate the target live video data that each available storage node in the multiple live video data needs to store;
[0090] Step S302: Each available storage node starts a corresponding data storage process to store target live video data.
[0091] Through the above steps S301 to S302, by introducing multiple available storage nodes, each available storage node runs a data storage process, and can store multiple live video data at the same time. This distributed architecture makes the video transfer task no longer concentrated on a single server, thereby greatly reducing the risk of single point failure; and the management method can dynamically add or delete storage nodes according to business needs to achieve dynamic expansion and contraction of resources. The problem of single point failure risk and inability to dynamically expand and contract in the related art when transferring live video is solved. By introducing multiple available storage nodes and intelligent allocation plans, the beneficial effects of reducing single point failure risk, dynamic expansion and contraction, improving system reliability and optimizing storage efficiency are achieved.
[0092] Combine the following Figure 3 The management method of the live video data storage service applied on the storage end in the embodiment of the present application is explained.
[0093] In the technical solution of step S301, each available storage node in the storage end receives a start storage command sent by the storage service management end.
[0094] In this application, the storage service management end is the live-schedul-server server end, which is a web service developed in the go language, providing HTTP and grpc interfaces, and is mainly used as the control center for all live video storage services, monitoring and managing all live video storage services. The storage end uses Kubernetes (K8s) to deploy and run in a containerized manner. K8s is an open source container orchestration engine that supports automated deployment, large-scale scalability, and application containerized management. Multiple pods that execute live video storage services are configured on the storage end, and each pod that executes live video storage services is a storage node in the live-schedul-server server end. Each available storage node uses a node reporting mechanism to regularly report its current status and the data storage process being executed to the live-schedul-server server end. The live-schedul-server server end, as the scheduling center of the live video storage service, is responsible for the management and monitoring of all pods that execute live video storage services in the storage end and the data storage processes in the pods.
[0095] In this application, live video data specifically refers to the streaming address corresponding to the live video. The available storage node is the pod that executes the live video storage service in the storage end, multiple live video data are multiple streaming addresses, and the target live video data is a part of the streaming addresses among the multiple streaming addresses. The allocation plan is generated by the live-schedul-server service end based on all the pods that execute the live video storage service and the multiple streaming addresses to be stored reported by the storage end. The allocation plan is used to indicate part of the multiple streaming addresses that need to be stored by each pod that executes the live video storage service. The start storage command carries information about the streaming addresses to be stored allocated to each pod that executes the live video storage service in the allocation plan.
[0096] In the technical solution of step S302, each available storage node starts a corresponding data storage process to store the target live video data.
[0097] In this application, the data storage process is the ffmpeg process. The ffmpeg process is a program instance for processing audio and video data. When the ffmpeg command is run in the system, one or more ffmpeg processes are started to perform specific tasks, such as video conversion, streaming media processing, etc. The ffmpeg process receives audio and video data from sources such as files, network streams, and cameras.
[0098] The ffmpeg process obtains the pull stream address corresponding to the live video and uses the corresponding command to store the live video data. The specific steps of using the ffmpeg process to store the live video data are no longer limited in this application.
[0099] As an optional embodiment, before each available storage node starts a corresponding data storage process to store the target live video data, it includes: verifying whether the live video data currently to be stored in the target live video data is being stored. In order to prevent repeated command reception due to network retries and other reasons, before each available storage node starts a corresponding data storage process to store the target live video data, it is also necessary to verify each received live streaming address to verify whether the streaming address is currently running a storage process.
[0100] In practice, you can use the system PS command to check whether the pull stream address corresponding to the live video data to be stored is being stored. If the command line parameters of the ffmpeg process contain the pull stream address and there is also an output file path, then it can be determined that the ffmpeg process is using the pull stream address to store live video data. If no matching process is found, it can be assumed that no ffmpeg process is currently using your pull stream address for storage.
[0101] It is understandable that by verifying each received live streaming address and verifying whether the address is currently running a storage process, repeated storage operations caused by network retries, command sending errors, or other abnormal situations can be avoided. By verifying and ensuring that each streaming address corresponds to only one running storage process, the use of storage resources can be optimized, unnecessary storage overhead can be reduced, and the risk of data confusion or errors that may be caused by duplicate storage can be reduced.
[0102] As an optional embodiment, after each available storage node starts the corresponding data storage process to store the target live video data, it includes: every third preset time interval, each available storage node reports the corresponding node information to the storage service management end; after determining that the storage service management end has received the reported corresponding node information, each available storage node will receive a confirmation message sent by the storage service management end, wherein the confirmation information is used to indicate that the storage service management end has received the node information reported by the available storage node; if the available storage node does not receive the confirmation message sent by the storage service management end after the third preset time interval, it is confirmed that the report has failed and the corresponding node information is re-reported; if the available storage node does not receive the confirmation message sent by the storage service management end within a consecutive preset number of retries, the available storage node loses contact with the storage service management end, the available storage node is a lost storage node, the data storage process corresponding to the lost storage node is terminated, and the storage end sends an alarm message to the administrator.
[0103] In specific practice, the pod that executes the live video storage service reports the corresponding node information to the live-schedul-server service end at every third preset time interval. In this application, the third preset time interval is set to 5 seconds. Specifically, the HTTP request sent by the pod that executes the live video storage service reports the corresponding node information to the live-schedul-server service end.
[0104] After confirming that the live-schedul-server has received the corresponding node information, each pod that executes the live video storage service will receive a confirmation message sent by the live-schedul-server, which indicates that the live-schedul-server has received the node information reported by the pod that executes the live video storage service. If the pod that executes the live video storage service does not receive the confirmation message sent by the live-schedul-server for more than 5 seconds, it is confirmed that the report has failed and the corresponding node information is re-reported; if the pod that executes the live video storage service does not receive the confirmation message sent by the live-schedul-server within the preset number of consecutive retries, the pod that executes the live video storage service loses contact with the live-schedul-server, and the pod that executes the live video storage service is a lost storage node. The data storage process corresponding to the lost storage node is terminated, and the storage end sends an alarm message to the administrator.
[0105] It is understandable that when the live video storage service fails to communicate with the storage service management end for three consecutive times, by terminating all running data storage processes and issuing alarm information, it can ensure the effective use of system resources, prevent invalid video storage operations, and promptly notify the administrator to handle potential failures, thereby ensuring the stability and reliability of the live broadcast service. This processing method can quickly respond to communication failures, reduce potential risks, and improve the maintainability and user experience of the overall system.
[0106] As an optional embodiment, after receiving the preStop message, the available storage node of the storage end ends the running data storage process and no longer reports the node information to the storage service management end.
[0107] Kubernetes (K8s) itself provides lifecycle hooks, among which the preStop hook allows the container to perform some cleanup operations before termination. For example: when Kubernetes decides to stop or restart the container of the live video storage service, it sends a preStop message to the container.
[0108] In this application, when the pod executing the live video storage service receives the preStop message, the running ffmpeg process is terminated. Since the container is about to be managed by Kubernetes, it is no longer necessary to report to the live-schedul-server service end at this time, because any further reports may not be correctly processed or responded to.
[0109] It is understandable that by implementing the preStop hook of Kubernetes, the live video storage service can end all running ffmpeg processes before the container is terminated or restarted, ensuring that the container can exit cleanly. This processing method avoids resource leakage or data inconsistency caused by sudden termination of the container, and improves the stability and reliability of the system. At the same time, since the container will be managed by Kubernetes, it no longer needs to be reported to the live-schedul-server service, reducing unnecessary communication and potential error handling, and simplifying system operation.
[0110] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0111] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM (Read-Only Memory, read-only memory) / RAM (Random Access Memory, random access memory), a disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of each embodiment of the present application.
[0112] According to another aspect of the embodiment of the present application, a management system for a live video data storage service is provided for implementing the management method of the live video data storage service. Figure 4 , Figure 4 is a structural block diagram of an optional management system for live video data storage services provided in an embodiment of the present application, such as Figure 4 As shown, the system includes: a storage service management end 401 and a storage end 402; the storage service management end 401 is connected to the storage end 402 via a network, and the storage service management end 401 is configured to execute any management method of a live video data storage service applied on the storage service management end; the storage end 402 is configured to execute any management method of a live video data storage service applied on the storage end.
[0113] The above network may include but is not limited to at least one of the following: wired network, wireless network. The above wired network may include but is not limited to at least one of the following: wide area network, metropolitan area network, local area network, and the above wireless network may include but is not limited to at least one of the following: WIFI (Wireless Fidelity), Bluetooth.
[0114] Regarding the management system of the live video data storage service in this embodiment, the specific manner in which its storage service management end 401 and the storage end 402 execute the management method of the above-mentioned live video data storage service has been described in detail in the embodiment of the management method of the live video data storage service, and will not be elaborated here.
[0115] It is understandable that the system introduces multiple available storage nodes, each of which runs a data storage process and can store multiple live video data at the same time. This distributed architecture makes the video transfer task no longer concentrated on a single server, thereby greatly reducing the risk of single point failure. Moreover, the management method can dynamically add or delete storage nodes according to business needs to achieve dynamic expansion and contraction of resources.
[0116] According to another aspect of the embodiment of the present application, a management device for a live video data storage service is provided for implementing the management method for the live video data storage service. Figure 5 , Figure 5 is a structural block diagram of an optional management device for live video data storage service provided in an embodiment of the present application. The management device for live video data storage service is arranged at a storage service management end, such as Figure 5 As shown, the device may include:
[0117] The first receiving module 501 is used to obtain at least one available storage node reported by the storage end of the live video and a plurality of live video data to be stored, wherein the available storage node runs a data storage process for storing the live video data;
[0118] A dynamic allocation module 502, used to generate an allocation plan according to all available storage nodes and live video data, wherein the allocation plan is used to indicate the target live video data that each available storage node in the plurality of live video data needs to store;
[0119] The first sending module 503 is used to send a start storage command to each available storage node according to the allocation plan, so that each available storage node starts a data storage process to store target live video data after receiving the start storage command, wherein the start storage command carries information for indicating the target live video data to be stored.
[0120] It should be noted that the first receiving module 501 in this embodiment can be used to execute the above step S201, the dynamic allocation module 502 in this embodiment can be used to execute the above step S202, and the first sending module 503 in this embodiment can be used to execute the above step S203.
[0121] Regarding the management device of the live video data storage service in this embodiment, the specific manner in which its first receiving module 501, dynamic allocation module 502 and first sending module 503 execute the above-mentioned management method of the live video data storage service has been described in detail in the embodiment of the management method of the live video data storage service, and will not be elaborated here.
[0122] It can be understood that the technical solution provided by this embodiment, each module in the management device of the live video data storage service, by introducing multiple available storage nodes, each available storage node runs a data storage process, and can store multiple live video data at the same time. This distributed architecture makes the video transfer task no longer concentrated on a single server, thereby greatly reducing the risk of single point failure. Moreover, the management method can dynamically add or delete storage nodes according to business needs to achieve dynamic expansion and contraction of resources.
[0123] As an optional embodiment, the device further includes: a service status monitoring module 504, which is used to determine whether there is a target storage node with unavailable service among all available storage nodes based on the node information reported by all available storage nodes; if it is determined that there is a target storage node, the target storage node is removed and a storage termination command is sent to the target storage node so that the target storage node terminates the currently running data storage process. It should be noted that the above service status monitoring module 504 is not Figure 5 Shown in.
[0124] The device in this embodiment, in addition to the above modules, may also include a module for executing any method in any of the above-mentioned embodiments of the management method of the live video data storage service.
[0125] It should be noted that the above modules and corresponding steps implement the same examples and application scenarios, but are not limited to the contents disclosed in the above embodiments. It should be noted that the above modules, as part of the device, can be run in the implementation of Figure 1 The hardware environment of the method shown may be implemented by software or hardware, wherein the hardware environment includes a network environment.
[0126] According to another aspect of the embodiment of the present application, a management device for a live video data storage service is provided for implementing the management method for the live video data storage service. Figure 6 , Figure 6 is a structural block diagram of another optional management device for live video data storage service provided in an embodiment of the present application. The management device for live video data storage service is arranged at a storage end, such as Figure 6 As shown, the device may include:
[0127] The second receiving module 601 is used for each available storage node in the storage end to receive a start storage command sent by the storage service management end, wherein the start storage command carries information in the allocation plan for indicating the target live video data to be stored, and the allocation plan is generated by the storage service management end according to all available storage nodes reported by the storage end and the multiple live video data to be stored, and the allocation plan is used to indicate the target live video data that each available storage node in the multiple live video data needs to store;
[0128] The data storage module 602 is used for each available storage node to start a corresponding data storage process to store the target live video data.
[0129] It should be noted that the first receiving module 601 in this embodiment can be used to execute the above step S301, and the dynamic data storage module 602 in this embodiment can be used to execute the above step S302.
[0130] Regarding the management device of the live video data storage service in this embodiment, the specific manner in which its second receiving module 601 and the data storage module 602 execute the management method of the above-mentioned live video data storage service has been described in detail in the embodiment of the management method of the live video data storage service, and will not be elaborated here.
[0131] It can be understood that the technical solution provided by this embodiment, each module in the management device of the live video data storage service, by introducing multiple available storage nodes, each available storage node runs a data storage process, and can store multiple live video data at the same time. This distributed architecture makes the video transfer task no longer concentrated on a single server, thereby greatly reducing the risk of single point failure. Moreover, the management method can dynamically add or delete storage nodes according to business needs to achieve dynamic expansion and contraction of resources.
[0132] As an optional embodiment, the device further includes: a second sending module 603, which is used for each available storage node to report corresponding node information to the storage service management end at every third preset time interval; a verification module 604, which is used for starting the corresponding data storage process at each available storage node to verify whether the live video data currently to be stored in the target live video data is being stored before storing the target live video data. It should be noted that the above-mentioned second sending module 603 and verification module 604 are not Figure 6 Shown in.
[0133] The device in this embodiment, in addition to the above modules, may also include a module for executing any method in any of the above-mentioned embodiments of the management method of the live video data storage service.
[0134] It should be noted that the above modules and corresponding steps implement the same examples and application scenarios, but are not limited to the contents disclosed in the above embodiments. It should be noted that the above modules, as part of the device, can be run in the implementation of Figure 1 The hardware environment of the method shown may be implemented by software or hardware, wherein the hardware environment includes a network environment.
[0135] According to another aspect of an embodiment of the present application, an electronic device for implementing the management method of the above-mentioned live video data storage service is also provided. The electronic device may be a server, a terminal, or a combination thereof.
[0136] According to another embodiment of the present application, an electronic device is also provided. Figure 7 , Figure 7 is a structural block diagram of an optional electronic device provided in an embodiment of the present application, such as Figure 7 As shown, the electronic device may include: a processor 1501 , a communication interface 1502 , a memory 1503 and a communication bus 1504 , wherein the processor 1501 , the communication interface 1502 , and the memory 1503 communicate with each other via the communication bus 1504 .
[0137] Memory 1503, used for storing computer programs;
[0138] The processor 1501 is used to implement the following steps when executing the program stored in the memory 1503:
[0139] Step S201, obtaining at least one available storage node reported by a storage terminal of the live video and a plurality of live video data to be stored, wherein the available storage node runs a data storage process for storing the live video data;
[0140] Step S202, generating an allocation plan according to all available storage nodes and live video data, wherein the allocation plan is used to indicate the target live video data that each available storage node in the multiple live video data needs to store;
[0141] Step S203, according to the allocation plan, a start storage command is sent to each available storage node, so that each available storage node starts a data storage process to store the target live video data after receiving the start storage command, wherein the start storage command carries information for indicating the target live video data to be stored.
[0142] The processor 1501 is used to execute the program stored in the memory 1503, or implement the following steps:
[0143] Step S301: Each available storage node in the storage end receives a start storage command sent by the storage service management end, wherein the start storage command carries information in the allocation plan for indicating the target live video data to be stored, and the allocation plan is generated by the storage service management end according to all available storage nodes reported by the storage end and the multiple live video data to be stored, and the allocation plan is used to indicate the target live video data that each available storage node in the multiple live video data needs to store;
[0144] Step S302: Each available storage node starts a corresponding data storage process to store target live video data.
[0145] It can be understood that the technical solution provided in this embodiment is that the processor of the electronic device can store multiple live video data at the same time by introducing multiple available storage nodes, each of which runs a data storage process. This distributed architecture makes the video transfer task no longer concentrated on a single server, thereby greatly reducing the risk of single point failure. Moreover, the management method can dynamically add or delete storage nodes according to business needs to achieve dynamic expansion and contraction of resources.
[0146] Optionally, in this embodiment, the above-mentioned communication bus can be a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The communication interface is used for communication between the above-mentioned electronic device and other devices.
[0147] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0148] The above-mentioned processor can be a general-purpose processor, which can include but not be limited to: CPU (Central Processing Unit), NP (Network Processor), etc.; it can also be DSP (Digital Signal Processor), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
[0149] According to another aspect of the embodiments of the present application, a computer-readable storage medium is also provided, the storage medium includes a stored program, wherein when the program is run, the method steps of the embodiment of the management method of the live video data storage service are executed.
[0150] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a ROM, a RAM, a mobile hard disk, a magnetic disk, or an optical disk.
[0151] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0152] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which can be personal computers, servers or network devices, etc.) to execute all or part of the steps of the methods of each embodiment of the present application.
[0153] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0154] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0155] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution provided in this embodiment.
[0156] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0157] The above are only preferred implementations of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A management method for a live video data storage service, applied to a storage service management end, characterized in that: include: Acquire at least one available storage node reported by a storage end of the live video, and a plurality of live video data to be stored, wherein the available storage node runs a data storage process for storing the live video data; Generate an allocation plan based on all the available storage nodes and the live video data, including: determine the amount of target live video data that each of the available storage nodes needs to store based on the total amount of the live video data and the number of the available storage nodes; determine the target live video data according to a preset rule based on the amount of the target live video data and the live video data; and generate the allocation plan by making each of the available storage nodes correspond to the target live video data one by one, wherein the allocation plan is used to indicate the target live video data that each of the available storage nodes needs to store among the multiple live video data; According to the allocation plan, a start storage command is sent to each of the available storage nodes, so that each of the available storage nodes starts the data storage process to store the target live video data after receiving the start storage command, wherein the start storage command carries information for indicating the target live video data to be stored; After sending a start storage command to each of the available storage nodes according to the allocation plan, the method includes: receiving node information continuously reported by each of the available storage nodes; determining whether there is a target storage node with unavailable service among all the available storage nodes based on the node information reported by all the available storage nodes; if it is determined that the target storage node exists, eliminating the target storage node and sending an end storage command to terminate storage to the target storage node, so that the target storage node terminates the currently running data storage process.
2. The management method of the live video data storage service according to claim 1, characterized in that: The determining, according to the node information reported by all the available storage nodes, a target storage node whose service is unavailable among the available storage nodes comprises: Obtaining a target time interval between two consecutive reports of node information from each of the available storage nodes; If the target time interval is greater than the first preset time interval and the node information reported by the available storage node is not received, it is determined that the service of the available storage node is unavailable, and the available storage node is the target storage node.
3. The management method of the live video data storage service according to claim 1, characterized in that: After obtaining at least one available storage node reported by the storage end of the live video, the method includes: After determining that the node information reported by the storage end is received, confirmation information is sent to each of the available storage nodes, wherein the confirmation information is used to indicate that the storage service management end has received the node information reported by the available storage node.
4. The management method of the live video data storage service according to claim 1, characterized in that: After sending a start storage command to each of the available storage nodes according to the allocation plan, the method further comprises: Receiving node information continuously reported by each of the available storage nodes; At every second preset time interval, regenerating an allocation plan according to the node information reported by all the available storage nodes and the live video data; When it is determined that the regenerated allocation plan is different from the original allocation plan, a notification message is sent to the administrator, and a start storage command is resent to each of the available storage nodes according to the regenerated allocation plan.
5. A management method for a live video data storage service, applied to a storage end, characterized in that: include: Each available storage node in the storage end receives a start storage command sent by the storage service management end, wherein the start storage command carries information in an allocation plan for indicating target live video data to be stored, the allocation plan is generated by the storage service management end according to all the available storage nodes reported by the storage end and the multiple live video data to be stored, and the allocation plan is used to indicate the target live video data that each of the available storage nodes in the multiple live video data needs to store; Each of the available storage nodes starts a corresponding data storage process to store the target live video data; After each of the available storage nodes starts the corresponding data storage process to store the target live video data, it includes: every third preset time interval, each of the available storage nodes reports the corresponding node information to the storage service management end; after determining that the storage service management end has received the reported corresponding node information, each of the available storage nodes will receive confirmation information sent by the storage service management end, wherein the confirmation information is used to indicate that the storage service management end has received the node information reported by the available storage node; if the available storage node does not receive the confirmation information sent by the storage service management end after the third preset time interval, it is confirmed that the report has failed and the corresponding node information is re-reported; if the available storage node does not receive the confirmation information sent by the storage service management end within the consecutive preset number of retries, the available storage node loses contact with the storage service management end, the available storage node is a lost storage node, the data storage process corresponding to the lost storage node is terminated, and the storage end sends an alarm message to the administrator.
6. The management method of the live video data storage service according to claim 5, characterized in that: Before each of the available storage nodes starts a corresponding data storage process to store the target live video data, the process includes: Verify whether the live video data currently to be stored in the target live video data is being stored.
7. A management system for live video data storage service, characterized in that: include: Storage service management and storage end; The storage service management terminal is configured to execute the management method of the live video data storage service according to any one of claims 1 to 4; The storage end is configured to execute the management method of the live video data storage service as described in any one of claims 5 to 6.
8. A management device for a live video data storage service, applied to a storage service management end, characterized in that: include: A first receiving module is used to obtain at least one available storage node reported by a storage end of the live video, and a plurality of live video data to be stored, wherein the available storage node runs a data storage process for storing the live video data; A dynamic allocation module is used to generate an allocation plan based on all the available storage nodes and the live video data, including: determining the amount of target live video data that each of the available storage nodes needs to store based on the total amount of the live video data and the number of the available storage nodes; determining the target live video data according to a preset rule based on the amount of the target live video data and the live video data; and generating the allocation plan by making each of the available storage nodes correspond to the target live video data one by one, wherein the allocation plan is used to indicate the target live video data that each of the available storage nodes needs to store among the multiple live video data; A first sending module is used to send a start storage command to each of the available storage nodes according to the allocation plan, so that each of the available storage nodes starts the data storage process to store the target live video data after receiving the start storage command, wherein the start storage command carries information for indicating the target live video data to be stored; The management device also includes: a service status monitoring module, which is used to receive node information continuously reported by each available storage node after sending a start storage command to each available storage node according to the allocation plan; determine whether there is a target storage node with unavailable service among all the available storage nodes based on the node information reported by all the available storage nodes; if it is determined that the target storage node exists, eliminate the target storage node and send an end storage command to the target storage node to terminate the currently running data storage process.
9. A management device for a live video data storage service, applied to a storage end, characterized in that: include: A second receiving module is used for each available storage node in the storage end to receive a start storage command sent by the storage service management end, wherein the start storage command carries information in an allocation plan for indicating target live video data to be stored, the allocation plan is generated by the storage service management end according to all the available storage nodes reported by the storage end and the multiple live video data to be stored, and the allocation plan is used to indicate the target live video data that each of the available storage nodes in the multiple live video data needs to store; A data storage module, used for each of the available storage nodes to start a corresponding data storage process to store the target live video data; The management device also includes: a second sending module, which is used to start the corresponding data storage process in each of the available storage nodes to store the target live video data, and then, at every third preset time interval, each of the available storage nodes reports the corresponding node information to the storage service management end; a module, which is used to, after determining that the storage service management end has received the reported corresponding node information, each of the available storage nodes will receive confirmation information sent by the storage service management end, wherein the confirmation information is used to indicate that the storage service management end has received the node information reported by the available storage node; if the available storage node does not receive the confirmation information sent by the storage service management end after the third preset time interval, it is confirmed that the report has failed and the corresponding node information is re-reported; if the available storage node does not receive the confirmation information sent by the storage service management end within a continuous preset number of retries, the available storage node loses contact with the storage service management end, the available storage node is a lost storage node, the data storage process corresponding to the lost storage node is terminated, and the storage end sends an alarm message to the administrator.
10. An electronic device comprising a processor, a communication interface, a memory and a communication bus, wherein: The processor, the communication interface and the memory communicate with each other via the communication bus, wherein: The memory is used to store computer programs; The processor is used to execute the management method of the live video data storage service according to any one of claims 1 to 4 or 5 to 6 by running the computer program stored in the memory.
11. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the management method of the live video data storage service as described in any one of claims 1 to 4 or 5 to 6 when running.
