CN115695919A - Decentralized video processing method and device and electronic equipment - Google Patents

Decentralized video processing method and device and electronic equipment Download PDF

Info

Publication number
CN115695919A
CN115695919A CN202211190538.4A CN202211190538A CN115695919A CN 115695919 A CN115695919 A CN 115695919A CN 202211190538 A CN202211190538 A CN 202211190538A CN 115695919 A CN115695919 A CN 115695919A
Authority
CN
China
Prior art keywords
network terminal
computing power
transcoding task
video stream
transcoding
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211190538.4A
Other languages
Chinese (zh)
Inventor
程俊华
张剑
蒋浩东
彭亮
龚菡洁
陆晔
罗渝平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Telecom Corp Ltd
Original Assignee
China Telecom Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Telecom Corp Ltd filed Critical China Telecom Corp Ltd
Priority to CN202211190538.4A priority Critical patent/CN115695919A/en
Publication of CN115695919A publication Critical patent/CN115695919A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The application discloses a decentralized video processing method and device, and belongs to the technical field of video processing. The method comprises the following steps: responding to a video playing instruction, and acquiring video stream information of a first video stream aimed at by the video playing instruction; determining the amount of computational power required to perform a first transcoding task of a first video stream according to the video stream information; determining a scheduling result according to the calculation capacity quantity, a cluster node calculation capacity list locally stored in a current network terminal and a cluster node transcoding task list; and broadcasting the scheduling result to schedule the target network terminal to transcode the first video stream to obtain a second video stream for playing. The method optimally matches the amount of the computing power required by the transcoding task with the computing power index of the network terminal by sharing the computing power of the peer network terminals in the local area network so as to improve the transcoding speed of the video stream, thereby avoiding the problem of unsmooth video transcoding and playing caused by low performance of host equipment of a browser.

Description

Decentralized video processing method and device and electronic equipment
Technical Field
The present application relates to the field of video processing technologies, and in particular, to a method and an apparatus for decentralized video processing, an electronic device, and a computer-readable storage medium.
Background
In the video monitoring industry, most of original video streams are RTSP protocols, and new coding technologies such as H265 are increasingly used, and video streams using these coding technologies cannot be directly played in a browser. To solve this problem, there are generally two solutions in the industry. The first solution is to build a platform-type codec cluster, pull an original video stream by a platform, transcode the original video stream into a video stream which can be directly played in a browser by a server cluster, and provide the video stream to a user side through a public network. The second solution is to use a WebAssembly-based codec component to transcode and play the original video in the browser.
The video processing scheme in the prior art has at least the following defects: the first solution requires a dedicated high-cost server and a high-bandwidth network on a hardware level, and requires a professional engineer to perform software type selection, construction and maintenance, and secondary development to open decoding capability to users in the form of interfaces, so that the environmental deployment and system maintenance costs high and difficulty is high. In the second solution, encoding and decoding processing of multiple video streams is not supported, and the efficiency of video decoding is affected by the performance of the host device running the browser, which may cause video playing pause due to slow decoding speed.
It can be seen that the video processing method in the prior art needs to be improved.
Disclosure of Invention
The embodiment of the application provides a decentralized video processing method and device, namely electronic equipment, complex cluster deployment work of encoding and decoding equipment is not needed, transcoding of video streams can be executed through cluster equipment, maintenance of professionals is not needed, implementation is convenient, maintenance is not needed, and the problem that video transcoding playing is blocked due to the fact that host equipment of a browser is low in performance can be solved.
In a first aspect, an embodiment of the present application discloses a decentralized video processing method, including:
responding to a video playing instruction, and acquiring video stream information of a first video stream aimed at by the video playing instruction;
determining the amount of computational power required for executing a first transcoding task of the first video stream according to the video stream information;
determining a scheduling result comprising a scheduling matching relation between the first transcoding task and a target network terminal according to the computing power quantity, a cluster node computing power list and a cluster node transcoding task list which are locally stored in the current network terminal;
and broadcasting the scheduling result to schedule the target network terminal to execute the first transcoding task to transcode the first video stream to obtain a second video stream for playing.
Optionally, the determining, according to the video stream information, the amount of computational power required to perform the first transcoding task of the first video stream includes:
determining the amount of computational power required to perform a first transcoding task for the first video stream based on one or more of the following information included in the video stream information: video frame rate, encoding protocol, transport protocol, video resolution.
Optionally, the cluster node calculation power list includes: calculating power indexes of all network terminals in the cluster to which the current network terminal belongs; the cluster node transcoding task list comprises the following steps: the network terminal in the cluster is in scheduling matching relation with second transcoding tasks, and the amount of computing power required for executing each second transcoding task;
determining a scheduling result comprising a scheduling matching relationship between the first transcoding task and a target network terminal according to the computing power quantity, a cluster node computing power list locally stored by the current network terminal and a cluster node transcoding task list, wherein the scheduling result comprises:
determining a scheduling matching relationship between the first transcoding task and each second transcoding task and each network terminal according to the amount of computing power required for executing the first transcoding task, the amount of computing power required for executing each second transcoding task, and the amount of computing power indicated by the computing power index of each network terminal in the cluster and a principle that the amount of computing power is positively correlated with the amount of computing power;
and obtaining a scheduling result according to the matching relation.
Optionally, the cluster node calculation power list includes: computing power indexes of all network terminals in the cluster to which the current network terminal belongs; the cluster node transcoding task list comprises the following steps: the network terminal in the cluster is in scheduling matching relation with second transcoding tasks, and the amount of computing power required for executing each second transcoding task;
determining a scheduling result comprising a scheduling matching relationship between the first transcoding task and the target network terminal according to the computing power quantity, a cluster node computing power list and a cluster node transcoding task list locally stored by the current network terminal, wherein the scheduling result comprises:
acquiring an idle network terminal in the cluster according to the cluster node calculation power list and the scheduling matching relation;
determining the idle network terminals with the calculation capacity indexes meeting the calculation capacity required by executing the first transcoding task as the target network terminals to obtain a scheduling matching relation between the first transcoding task and the target network terminals;
and obtaining a scheduling result according to the scheduling matching relation.
Optionally, the cluster node calculation power list is updated by the following method:
responding to the received computing power information broadcasted in the local area network, and acquiring a network terminal identifier and a computing power index carried in the computing power information; according to the network terminal identification and the calculation power index, the corresponding relation between the corresponding network terminal and the calculation power index is recorded in an incremental manner in a cluster node calculation power list;
and in response to that the broadcast information of the designated network terminal in the cluster node calculation power list is not received within a preset time length, deleting the corresponding relation between the designated network terminal and the calculation power index from the cluster node calculation power list.
Optionally, the method further includes:
executing a preset calculation operation, and acquiring execution duration for executing the preset calculation operation;
determining the calculation power index of the current network terminal according to the execution duration;
and broadcasting computing power information carrying the computing power index, so that each network terminal in the cluster to which the current network terminal belongs updates a cluster node computing power list locally stored by each network terminal based on the broadcasted computing power information.
Optionally, the method further includes:
in response to receiving the scheduling result broadcasted by the other network terminal, updating the cluster node transcoding task list locally stored by the current network terminal according to the scheduling matching relation carried in the received scheduling result;
and executing a corresponding transcoding task according to the updated cluster node transcoding task list.
In a second aspect, an embodiment of the present application discloses a decentralized video processing device, including:
the video stream information acquisition module is used for responding to a video playing instruction and acquiring video stream information of a first video stream aimed at by the video playing instruction;
the computational power quantity determining module is used for determining the quantity of computational power required for executing a first transcoding task of the first video stream according to the video stream information;
a transcoding scheduling result determining module, configured to determine a scheduling result including a scheduling matching relationship between the first transcoding task and a target network terminal according to the amount of computing power, a cluster node computing power list locally stored in the current network terminal, and a cluster node transcoding task list;
and the scheduling transcoding module is used for broadcasting the scheduling result so as to schedule the target network terminal to execute the first transcoding task to transcode the first video stream and obtain a second video stream for playing.
Optionally, the calculation power amount determining module is further configured to:
determining the amount of computational power required to perform a first transcoding task for the first video stream based on one or more of the following information included in the video stream information: video frame rate, encoding protocol, transport protocol, video resolution.
Optionally, the cluster node computation force list includes: calculating power indexes of all network terminals in the cluster to which the current network terminal belongs; the cluster node transcoding task list comprises the following steps: the network terminal in the cluster is in scheduling matching relation with second transcoding tasks, and the amount of computing power required for executing each second transcoding task;
the transcoding scheduling result determining module is further configured to:
determining a scheduling matching relationship between the first transcoding task and each second transcoding task and each network terminal according to the amount of computing power required for executing the first transcoding task, the amount of computing power required for executing each second transcoding task, and the amount of computing power indicated by the computing power index of each network terminal in the cluster and a principle that the amount of computing power is positively correlated with the amount of computing power; and obtaining a scheduling result according to the matching relation.
Optionally, the cluster node calculation power list includes: calculating power indexes of all network terminals in the cluster to which the current network terminal belongs; the cluster node transcoding task list comprises the following steps: the network terminal in the cluster is in scheduling matching relation with second transcoding tasks, and the amount of computing power required for executing each second transcoding task;
the transcoding scheduling result determining module is further configured to:
acquiring an idle network terminal in the cluster according to the cluster node calculation power list and the scheduling matching relation; then, determining the idle network terminals of which the computing power indexes meet the quantity of the computing power required by executing the first transcoding task as the target network terminals to obtain a scheduling matching relation between the first transcoding task and the target network terminals; and obtaining a scheduling result according to the scheduling matching relation.
Optionally, the apparatus further comprises: a cluster node computation power list update module to:
responding to received computing power information broadcasted in a local area network, and acquiring a network terminal identifier and a computing power index carried in the computing power information; according to the network terminal identification and the computing power index, the corresponding relation between the corresponding network terminal and the computing power index is recorded in an incremental manner in a cluster node computing power list; alternatively, the first and second electrodes may be,
and in response to that the broadcast information of the designated network terminal in the cluster node calculation power list is not received within a preset time length, deleting the corresponding relation between the designated network terminal and the calculation power index from the cluster node calculation power list.
Optionally, the apparatus further comprises:
the terminal computing power acquisition module is used for executing preset computing operation and acquiring the execution time length for executing the preset computing operation; determining the calculation power index of the current network terminal according to the execution duration;
the terminal computing power acquisition module is further configured to broadcast computing power information carrying the computing power index, so that each network terminal in a cluster to which the current network terminal belongs updates a cluster node computing power list locally stored by each network terminal based on the broadcasted computing power information.
Optionally, the apparatus further comprises:
the transcoding module is used for responding to the received scheduling result broadcasted by the other network terminal and updating the cluster node transcoding task list locally stored by the current network terminal according to the scheduling matching relation carried in the received scheduling result; and executing a corresponding transcoding task according to the updated cluster node transcoding task list.
In a third aspect, an embodiment of the present application further discloses an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the decentralized video processing method according to the embodiment of the present application when executing the computer program.
In a fourth aspect, embodiments of the present application disclose a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, performs the steps of the method for decentralized video processing disclosed in embodiments of the present application.
The decentralized video processing method disclosed by the embodiment of the application comprises the steps of responding to a video playing instruction, and obtaining video stream information of a first video stream aimed at by the video playing instruction; determining the amount of computational power required for executing a first transcoding task of the first video stream according to the video stream information; determining a scheduling result comprising a scheduling matching relation between the first transcoding task and a target network terminal according to the computing power quantity, a cluster node computing power list and a cluster node transcoding task list which are locally stored in the current network terminal; and broadcasting the scheduling result to schedule the target network terminal to execute the first transcoding task to transcode the first video stream to obtain a second video stream for playing, so that the problem of video transcoding playing pause caused by low performance of host equipment of a browser can be effectively solved.
The foregoing description is only an overview of the technical solutions of the present application, and the present application can be implemented according to the content of the description in order to make the technical means of the present application more clearly understood, and the following detailed description of the present application is given in order to make the above and other objects, features, and advantages of the present application more clearly understandable.
Drawings
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
FIG. 1 is a flow chart of a method for decentralized video processing according to an embodiment of the present application;
fig. 2 is a schematic diagram of a cluster structure in the decentralized video processing method disclosed in the embodiment of the present application;
FIG. 3 is a second flowchart of a decentralized video processing method according to an embodiment of the present application;
fig. 4 is a schematic view of an application scenario of the decentralized video processing method disclosed in the embodiment of the present application;
FIG. 5 is a schematic structural diagram of a decentralized video processing device according to an embodiment of the present application;
FIG. 6 is a second schematic structural diagram of a decentralized video processing apparatus according to an embodiment of the present application;
FIG. 7 schematically shows a block diagram of an electronic device for performing a method according to the present application; and
fig. 8 schematically shows a storage unit for holding or carrying program code implementing a method according to the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making any creative effort belong to the protection scope of the present application.
The invention provides a technical scheme for forming self-organized decentralized coding and decoding clusters by using common terminal equipment (capable of operating browsers supporting WebAssembly and achieving network intercommunication, such as computers, tablet computers and raspberry products in a local area network) without the support of professionals and professional servers, and different transcoding tasks can be dispatched to the most appropriate network terminal equipment in the clusters according to the computing power requirements of video transcoding tasks, so that the computing power of all network terminal equipment in the local area network is fully exerted.
According to the solution described by the invention, the video coding and decoding cluster can be built in a self-organization manner only by installing the same software on a common network terminal, namely the self-organization building system disclosed by the invention, the calculation capacity rating of the terminals in the cluster is automatically carried out, and different transcoding tasks are distributed to the network terminal equipment with the most matched calculation capacity.
The following describes a specific implementation of the decentralized video processing method disclosed in the embodiment of the present application by way of example.
As shown in fig. 1, a method for decentralized video processing disclosed in an embodiment of the present application includes: step 110 to step 140.
Step 110, responding to a video playing instruction, and acquiring video stream information of a first video stream targeted by the video playing instruction.
The decentralized video processing method in the embodiment of the present application is applied to a network terminal, where the network terminal may be: computers, tablets, smart phones, raspberry pi products, and the like. The network terminal needs to access a local area network and can run a browser supporting WebAssembly. Therefore, after the local area network is accessed, the network terminal can automatically establish a cluster with other network terminals in the local area network by sending the preset broadcast information and receiving the preset broadcast information, and the network terminals in the cluster can share the video stream transcoding resource, i.e. can provide video stream transcoding service for each other.
Taking the cluster structure shown in fig. 2 as an example, the network terminals 210, 220, 230, and 240 in fig. 2 are peer network terminals accessing the switch 200 in the local area network, and the network terminals 210, 220, 230, and 240 are pre-installed with WebAssembly plug-ins to support the operation of browsers. When the network terminals 210, 220, 230, and 240 autonomously form a cluster, the network terminals 210, 220, 230, and 240 respectively serve as a cluster node in the cluster to provide transcoding power for each terminal device in the cluster.
Taking the video monitoring field as an example, when a certain network terminal in a cluster detects user triggering and plays a selected monitoring video through a browser, the network terminal (hereinafter referred to as "current network device") first acquires video stream information of a real-time video stream (hereinafter referred to as "first video stream") corresponding to the monitoring video. In some embodiments of the present application, the video stream information includes, but is not limited to: the video stream pulls information such as address, video frame rate, encoding protocol, transport protocol, resolution, etc.
The video stream pull address is a storage address (such as a server, a video storage device, and the like) of a video stream to be played. And the video stream stored in the video stream pulling address is the video stream of the preset coding protocol. The encoding protocol included in the video stream information is used to indicate the encoding protocol (e.g., H265, RTSP encoding protocol, etc.) of the real-time video stream. The video frame number is used for indicating the playing frame rate of the video. The transport protocol is used to indicate a network transport protocol for the video stream.
In some embodiments of the present application, the video stream information may be obtained by using an ffprobe tool preset in the network terminal. ffprobe is a tool for reading video streams or video information. For example, using the "ffprobe-show _ streams address" command, the video stream information of the video stream specified by the stream address can be acquired.
And step 120, determining the amount of computational power required for executing the first transcoding task of the first video stream according to the video stream information.
After the current network terminal acquires the video stream information of the first video stream to be played, the amount of computing power required for executing a transcoding task (referred to as a "first transcoding task" in the text) when transcoding the first video stream is further determined according to the video stream information.
In the implementation of the present application, the computing power is used to represent the computing power of the network device. The amount of the calculated force is a quantitative representation of the magnitude of the calculated force. That is, in the embodiment of the present application, the amount of computation power is a quantitative representation of the amount of computation power required to perform the task of transcoding video streams. For example, for a video stream with a higher resolution, more computation power is required, that is, a network terminal is required to have stronger computing power, and accordingly, the number of determined computation power is larger; for another example, for a video stream with a lower video frame rate, less computation is required, that is, the network terminal does not need to have a strong computing power, and accordingly, the determined amount of computation is smaller.
In the embodiment of the application, a "point" may be used as a unit of calculation power, and a corresponding relationship between 1-point calculation power and a consumed first time length is determined according to a first time length consumed by a network terminal to perform a preset calculation. For example, when the first duration is 1 second, the computing power of the network terminal may be determined to be 1-point computing power. And then, according to the proportional relation between the second time consumed by the network terminal for transcoding the specified video stream and the first time, determining the number of points of the computing power (namely the number of the computing power) required for transcoding the specified video stream.
In some embodiments of the present application, the determining, according to the video stream information, an amount of computational power required to perform a first transcoding task for the first video stream includes: determining the amount of computational power required to perform a first transcoding task of the first video stream according to one or more of the following information included in the video stream information: video frame rate, encoding protocol, transport protocol, video resolution.
For example, a video stream with a specified duration and different video frame rates, different resolutions, and different encoding protocols (e.g., H265, RTSP, etc.) may be transcoded by the foregoing network terminal, and a time consumed by transcoding is recorded as the second duration, and by analyzing the second duration, a corresponding relationship between video stream information such as the video frame rates, the resolutions, and the encoding protocols and the amount of computing power is defined according to an analysis result. For example, when a period of H265 real-time video stream with a 1 minute time length and a resolution of 1080P frame rate of 60 needs to be decoded for 10 seconds by the network terminal, the amount of calculation power needed for decoding the H265 real-time video stream with the 1 minute time length and the resolution of 1080P frame rate of 60 may be defined as 10 points. For another example, when the network terminal needs to decode 5 seconds for a period of H265 real-time video stream with a 1 minute duration and a 1080P frame rate of 30, the amount of effort required to decode the H265 real-time video stream with the 1 minute duration and the 1080P frame rate of 30 may be defined as 5 points. Therefore, after the video stream information of the video stream to be played is acquired, the point value of the computational power required for transcoding the video stream to be played can be determined according to the video stream information and the corresponding relation.
In some embodiments of the present application, the computation power of different network terminals may be evaluated by the time taken by different network terminals to perform the same preset computation.
Step 130, determining a scheduling result including a scheduling matching relationship between the first transcoding task and the target network terminal according to the computation amount, a cluster node computation amount list and a cluster node transcoding task list locally stored in the current network terminal.
In some embodiments of the present application, a network terminal may automatically join a cluster automatically established by a plurality of network terminals in a local area network by broadcasting computing power information to other network terminals in the local area network. In the cluster, each network terminal needs to broadcast information according to a preset time interval requirement so as to maintain a computing power sharing state with other network terminals in the cluster.
Meanwhile, each network terminal joining the cluster stores a cluster node calculation capacity list locally so as to record the network terminals included in the cluster as cluster nodes and the calculation capacity index of each network terminal. The computing power index is used to indicate the computing power of the corresponding network terminal, for example, the computing power index may be the number of computing powers.
In some embodiments of the present application, each network terminal joining the cluster further stores a cluster node transcoding task list locally, for storing current scheduling information of each network device in the cluster, for example, a scheduling matching relationship between each network terminal in the cluster and a second transcoding task (for example, the network terminal is in an idle state, or in a state scheduled to execute a certain second transcoding task), and an amount of computing power required for executing each said second transcoding task (for example, for a network terminal in a state scheduled to execute a certain second transcoding task, a corresponding relationship between the network terminal and the second transcoding task is stored in the cluster, and an amount of computing power required for executing the second transcoding task is stored).
After the amount of computing power required by the first transcoding task of the first video stream is obtained, a network terminal suitable for executing the first transcoding task is determined to serve as a target network terminal according to the payment scheduling state of the network terminals recorded in the cluster node transcoding task list and the computing power of each network terminal recorded in the cluster node computing power list, and a scheduling matching relationship between the first transcoding task and the target network terminal is determined.
In the embodiment of the application, if the target network terminal is currently in an idle state, the scheduling matching relationship corresponding to other network terminals does not need to be adjusted. In this case, only the scheduling matching relationship between the first transcoding task and the target network terminal may be used as the scheduling result.
In other embodiments of the present application, if the target network terminal is currently in a scheduled state, that is, the target network terminal has currently established a scheduling matching relationship with other transcoding tasks (for example, the foregoing second transcoding task), the scheduling matching relationship needs to be adjusted by integrating the computational power of each network terminal and the computational power of the first transcoding task and the second transcoding task, so as to obtain a new scheduling matching relationship between the network terminal and the transcoding task. In this case, the adjusted scheduling may be matched as a scheduling result.
In the embodiment of the application, only the newly added or adjusted scheduling matching relationship may be used as the scheduling result, or the scheduling matching relationships between all current network terminals and transcoding tasks may be used as the scheduling result.
Step 140, broadcasting the scheduling result to schedule the target network terminal to execute the first transcoding task to transcode the first video stream, so as to obtain a second video stream for playing.
In some embodiments of the present application, broadcasting the scheduling result to schedule the target network terminal to execute the first transcoding task to transcode the first video stream to obtain a second video stream for playing, includes: and broadcasting the scheduling result, so that the target network terminal updates the scheduling matching relationship in the locally stored cluster node transcoding task list according to the scheduling result, determines a self-matched first transcoding task according to the updated cluster node transcoding task list, and then executes the first transcoding task to transcode the first video stream to obtain a second video stream for playing.
After the current network terminal obtains the scheduling result, the scheduling result can be broadcasted in the local area network in a mode of broadcasting the scheduling message so as to inform each network terminal in the cluster of updating the locally stored cluster node transcoding task list in time.
After each network terminal in the cluster receives the broadcasted scheduling information, the scheduling matching relation recorded in the locally stored cluster node transcoding task list is updated according to the scheduling result carried in the scheduling information, and the corresponding transcoding task is executed according to the scheduling matching relation recorded in the updated cluster node transcoding task list, so that the transcoded video stream is obtained.
In the embodiment of the application, because the network terminals (i.e. the cluster nodes) in the cluster maintain the cluster node transcoding task list, it is possible to determine which transcoding task of a video stream needs to be executed currently according to the scheduling matching relationship recorded in the updated cluster node transcoding task list, and each network terminal knows which transcoding task of a video stream is executed currently, and certainly knows which video stream is being transcoded. Taking the network terminal 220 in fig. 2 as an example, if the network terminal 220 is transcoding a video stream corresponding to "rtsp:// 207.194.83.47" (which can be understood as performing the aforementioned second transcoding task), the scheduling matching relationship that may exist in the updated transcoding task list of cluster nodes is described below as an example of a scheduling process based on the scheduling result.
When the network terminal 220 has a scheduling matching relationship with the video stream corresponding to "rtsp:// 207.194.83.47/9013/9 b112c3" in the updated transcoding task list of the cluster node, that is, the video stream corresponding to the transcoding task is not changed, the network terminal 220 continues to execute the transcoding task of the original video stream. When the updated cluster node transcoding task list does not have a scheduling matching relationship with any video stream, the network terminal 220 stops the transcoding task of the original video stream and enters an idle state. When the network terminal 220 has a scheduling matching relationship with the video stream "rtsp:// 107.94.183.147", i.e. the video stream corresponding to the transcoding task changes in the updated cluster node transcoding task list, the network terminal 220 stops executing the transcoding task of the original video stream (i.e. the video stream corresponding to "rtsp:// 207.194.83.47.
In some embodiments of the present application, after the network terminals in the cluster execute the transcoding tasks corresponding to the network terminals themselves, the current network terminal may be notified to access the target network terminal by broadcasting a transcoding completion message, so as to pull the second video stream obtained by transcoding. In other embodiments of the present application, after the network terminal in the cluster executes the transcoding task corresponding to itself, the second video stream obtained by transcoding may also be actively pushed to the current network terminal. In other embodiments of the present application, the network terminal may also reach the second video stream obtained by transcoding to a browser for executing video playing in other manners. In this embodiment of the application, a specific implementation manner of a network terminal executing a transcoding task to reach the second video stream obtained by transcoding to a browser or a network terminal for executing video playing is not limited.
After the second video stream obtained by transcoding the first video stream is obtained, the current network terminal can play the video based on the second video stream through the browser.
In order to more clearly understand the present solution, a specific implementation of the steps of the decentralized video processing method disclosed in the embodiment of the present application is further illustrated in the following with reference to fig. 3 and fig. 4.
In an embodiment of the application, the cluster node computation force list is dynamically updated. That is, in the process of the network terminal in the local area network operating the decentralized video processing method, the network terminal may broadcast the computing power information of the network device itself according to the trigger of the user, or automatically broadcast the computing power information of the network device itself after being connected to the local area network, so that the network terminal in the local area network may synchronously update the locally stored cluster node computing power list according to the computing power information broadcast by other network terminals.
As shown in fig. 3, the method further comprises: and step 105.
Step 105, updating the cluster node power list.
In the embodiment of the present application, the cluster node power list is updated by the following two methods.
The first method is that in response to receiving computing power information broadcasted in a local area network, network terminal identification and computing power indexes carried in the computing power information are obtained; and according to the network terminal identification and the computing power index, incrementally recording the corresponding relation between the corresponding network terminal and the computing power index in a cluster node computing power list.
The calculation information broadcast by the network terminal includes, but is not limited to: host name, IP address, mac address, and computing power index. The network terminal broadcasts the calculation force information of the network terminal to other network terminals in the local area network in a mode of broadcasting messages, and meanwhile receives the calculation force information broadcast by other network terminals through receiving the broadcast messages. The network terminal can add a corresponding relation between the network terminal and the computing power index in the locally stored cluster node computing power list according to the received computing power information when receiving a piece of computing power information broadcasted by a new access local area network or a network terminal newly opening a shared computing power function so as to update the locally stored cluster node computing power list. Therefore, each network terminal in the local area network can timely find the computing power node newly added into the cluster according to the computing power information broadcasted in the local area network, and update the locally stored cluster node computing power list.
A second method, in response to not receiving broadcast information of a specified network terminal in the cluster node power list within a preset time period, deletes the corresponding relationship between the specified network terminal and the power index from the cluster node power list. Wherein, the appointed network terminal is a network terminal except for the appointed network terminal.
When the network terminals in the cluster are offline or the user closes the function of sharing computing power (for example, quits the application of executing the decentralized video processing method disclosed in the embodiment of the present application), the computing power list of the cluster nodes stored in each network terminal in the cluster also needs to be updated in time. In some embodiments of the present application, the status of each network terminal in the cluster may be determined by information broadcast by each network terminal in the computation power list of the cluster node. For example, if the network terminal a does not receive any information broadcast by the network terminal B within a preset time period, it may be considered that the network terminal B has exited the cluster. In this case, the network terminal a deletes the corresponding relationship between the computing power of the network terminal B and the computing power of the network terminal B from the locally stored cluster node computing power list, so as to update the locally stored cluster node computing power list of the network terminal a.
Because each network terminal in the cluster locally stores the same cluster node calculation power list and executes the same judgment operation as the network terminal a, after the network terminal B exits the cluster, other network terminals delete the calculation power size corresponding relation between the network terminal B and the network terminal B from the locally stored cluster node calculation power list in time so as to update the locally stored cluster node calculation power list of each network terminal.
In some embodiments of the present application, before broadcasting the computing power information to other network terminals in the local area network, each network terminal needs to evaluate along with its computing power to obtain a computing power index of the network terminal itself.
As shown in fig. 3, the method further comprises: step 101, step 102 and step 103.
Step 101, executing a preset computing operation, and acquiring an execution duration for executing the preset computing operation.
For example, a large number of character strings and H265 hash values thereof may be preset in the network terminal, and then each character string is obtained, and hash operations are performed on each character string and each character string, and the execution time length required for calculating all hash values is recorded.
And step 102, determining the calculation power index of the current network terminal according to the execution duration.
The computing power index is an index for measuring how much computing power is, and for example, may be the number of computing powers.
In some embodiments of the present application, a preset budget may be executed on the execution duration, and an obtained result is used as the computing power index of the network terminal. For example, a preset positive number is divided by the execution duration, and the obtained quotient is used as the calculation power index of the network terminal. Specifically, for example, the method described above may be adopted, where "point" is used as a unit of computing power, and the number of the execution durations included in 1 second is determined as the number of computing power points matched by the network terminal. Namely, if the network terminal executes a round of the preset calculation operation within 1 second (namely, the execution time is 1 second), the calculation force matched by the network terminal can be considered as 1 point; if the network terminal executes two times of the preset calculation operations within 1 second (namely, the execution time is 0.5 second), the calculation power matched with the network terminal can be considered as 2 points.
In other embodiments of the present application, a corresponding relationship between the execution duration value-taking interval and the computation power index may also be preset, and then, the value of the computation power index corresponding to the execution duration obtained in step 101 is determined according to the corresponding relationship.
In other embodiments of the present application, the calculated force indicator may also be a level of calculated force. For example, the network terminals may be ranked according to the execution duration obtained by the network terminals executing step 101. In this way, network terminals with different computation power levels have different transcoding computation capabilities.
In the embodiment of the application, the calculation power index value is positively correlated with the transcoding calculation capability of the network terminal.
103, broadcasting computing power information carrying the computing power index, so that each network terminal in the cluster to which the current network terminal belongs updates a cluster node computing power list locally stored by each network terminal based on the broadcasted computing power information.
After obtaining the computing power index of the network terminal, each network terminal (such as the current network terminal) further generates computing power information according to the information of the network terminal, such as the IP address, the mac address, the network name and the like of the network terminal and the obtained computing power index, and broadcasts the computing power information to the local area network. In the embodiment of the application, the IP address and the mac address can be used as the unique identifier of the network terminal.
In some embodiments of the present application, the transcoding task list of the cluster node needs to be updated synchronously while the computing power list of the cluster node is updated. That is, as shown in fig. 3, after step 105, the method further includes: and step 106.
And 106, updating the cluster node transcoding task list.
For example, after a certain network terminal exits from a cluster, if the network terminal is in an idle state in the cluster node transcoding task list, the scheduling matching relationship corresponding to the network terminal can be directly deleted from the cluster node transcoding task list; if the network terminal is scheduled to execute a certain transcoding task in the cluster node transcoding task list, rescheduling the transcoding task scheduled to the network terminal after deleting the scheduling matching relation corresponding to the network terminal from the cluster node transcoding task list, and updating the cluster node transcoding task list according to a scheduling result obtained by rescheduling.
Based on the foregoing description of the creation and update schemes of the cluster node computation force list and the cluster node transcoding task list, the scheduling scheme of the first transcoding task is further described through the following two specific embodiments.
The first approach, comprehensive ordering scheduling.
As mentioned above, the cluster node calculation force list includes: computing power indexes of all network terminals in the cluster to which the current network terminal belongs; the cluster node transcoding task list comprises the following steps: the network terminal in the cluster is in scheduling matching relation with second transcoding tasks, and the amount of computing power required for executing each second transcoding task; determining a scheduling result comprising a scheduling matching relationship between the first transcoding task and the target network terminal according to the computing power quantity, a cluster node computing power list and a cluster node transcoding task list locally stored by the current network terminal, wherein the scheduling result comprises: determining a scheduling matching relationship between the first transcoding task and each second transcoding task and each network terminal according to the amount of computing power required for executing the first transcoding task, the amount of computing power required for executing each second transcoding task, and the amount of computing power indicated by the computing power index of each network terminal in the cluster and a principle that the amount of computing power is positively correlated with the amount of computing power; and obtaining a scheduling result according to the matching relation.
For example, the first transcoding tasks and the second transcoding tasks indicated by the scheduling matching relationships in the cluster node transcoding task list can be comprehensively sorted according to the descending order of the required computation power, and meanwhile, the network terminals in the cluster node computation power list are arranged according to the descending order of the computation power indexes; and then, dispatching the transcoding task with the largest amount of required computing power to the network terminal with the highest computing power index, dispatching the transcoding task with the second largest amount of required computing power to the network terminal with the second highest computing power index, and repeating the steps until the network terminal processes the transcoding task with the high computing power requirement according to the strategy of processing the transcoding task with the high computing power requirement by the high computing power network terminal, and reestablishing the dispatching matching relationship between the network terminal and the transcoding task. And then, taking the reestablished scheduling matching relationship as a scheduling result, and broadcasting the scheduling result to other network terminals in the local area network.
For example, in a cluster including 3 network terminals, it is assumed that the network terminal 1 matches 15 computational power, the network terminal 2 matches 9 computational power, the network terminal 3 matches 6 computational power, and the scheduling matching relationship currently recorded in the cluster node transcoding task list is: the transcoding task 1 requires 10 computational power and is currently dispatched to the network terminal 1; transcoding task 2 requires 7 points of capacity, currently scheduled to network terminal 2. The network terminal 3 is in an idle state. At this time, the network terminal 3 generates a new transcoding task 3 (such as the aforementioned first transcoding task) requiring 15 o' clock capacity, the network terminal 3 executes the above-mentioned comprehensive sequencing scheduling method to schedule the task with high computing power to the network terminal with high computing power as much as possible for transcoding, and the scheduling matching relationship between the network terminal and the transcoding task which are re-established is: the transcoding task 3 is dispatched to the network terminal 1, the transcoding task 1 is dispatched to the network terminal 2, and the transcoding task 2 is dispatched to the network terminal 3.
The second way, idle adaptation scheduling.
As mentioned above, the cluster node calculation force list includes: calculating power indexes of all network terminals in the cluster to which the current network terminal belongs; the cluster node transcoding task list comprises the following steps: the network terminal in the cluster is in scheduling matching relation with second transcoding tasks, and the amount of computing power required for executing each second transcoding task; determining a scheduling result comprising a scheduling matching relationship between the first transcoding task and the target network terminal according to the computing power quantity, a cluster node computing power list and a cluster node transcoding task list locally stored by the current network terminal, wherein the scheduling result comprises: acquiring an idle network terminal in the cluster according to the cluster node calculation power list and the scheduling matching relation; determining the idle network terminals with the calculation capacity indexes meeting the calculation capacity required by executing the first transcoding task as the target network terminals to obtain a scheduling matching relation between the first transcoding task and the target network terminals; and obtaining a scheduling result according to the scheduling matching relation.
For example, after the amount of computing power required by the first transcoding task of the first video stream is obtained, an idle network terminal may be obtained by searching the cluster node transcoding task list, then the computing power of the idle network terminal is further obtained by searching the cluster node computing power list, and then a network terminal with the computing power of the amount meeting the computing power required by the first transcoding task is selected from the idle network terminals as a target network terminal, so as to determine the scheduling matching relationship between the first transcoding task and the target network terminal.
In some embodiments of the present application, the scheduling matching relationship between the first transcoding task and the target network terminal may be used as a scheduling result, and broadcast to the local area network. In other embodiments of the present application, the scheduling matching relationship between the first transcoding task and the target network terminal may also be added to the cluster node transcoding task list locally stored in the current network terminal to update the scheduling matching relationship in the cluster node transcoding task list locally stored in the current network terminal, and then, all the scheduling matching relationships in the updated cluster node transcoding task list are broadcast to the local area network as a batch of scheduling results.
In some embodiments of the present application, when a second scheduling manner is used for scheduling a transcoding task, if the idle network terminal whose computational power index meets the computational power required for executing the first transcoding task is not found, a first manner may be further used for scheduling the transcoding task.
In other embodiments of the present application, other scheduling manners may also be adopted to schedule the transcoding task, which are not listed in this embodiment.
In some embodiments of the present application, as shown in fig. 3, when the network terminal plays a role of contributing to computing power, the method further includes: step 150 and step 160.
Step 150, in response to receiving the scheduling result broadcasted by the other network terminal, updating the cluster node transcoding task list locally stored by the current network terminal according to the scheduling matching relationship carried in the received scheduling result.
For example, when the current network terminal a receives the scheduling result broadcasted by the network terminal B, the cluster node transcoding task list locally stored by the current network terminal a is updated according to the scheduling matching relationship between the network terminal and the transcoding task carried in the received scheduling result. For example, when the scheduling matching relationship between all network terminals in the cluster and the transcoding task is carried in the scheduling result, the current network terminal a may update all the scheduling matching relationships in the locally stored cluster node transcoding task list through the received scheduling matching relationship.
And 160, executing a corresponding transcoding task according to the updated cluster node transcoding task list.
And then, the current network terminal A further executes a corresponding transcoding task or enters an idle state according to the updated cluster node transcoding task list.
In the embodiment of the application, when the network terminal executes the transcoding task, the network terminal may use the ffmpeg compiled by the WebAssembly technology to transcode the video stream corresponding to the transcoding task according to a preset or later configured ffmpeg command, so as to obtain the transcoded video stream.
The execution sequence of the steps shown in fig. 3 is only one possible execution sequence of the decentralized video processing method disclosed in the embodiment of the present application, and is not an exclusive execution sequence, and should not be construed as a limitation to the present application. In order to make the application document concise and understandable, all possible execution sequences of the steps of the decentralized video processing method disclosed in the embodiments of the present application are not listed again.
In other embodiments of the present application, only some, but not all, of the steps shown in fig. 3 may be performed. For example, only step 101, step 102, step 103, step 105, step 106, step 150, and step 160 may be executed in a certain network terminal. It should be understood by those skilled in the art that when the network terminal in the cluster is in a video playing state or a different state providing computing power, it may selectively perform the steps in the decentralized video processing method disclosed in the embodiment of the present application to implement the corresponding functions.
Taking the application scenario shown in fig. 4 as an example, the network terminal 410 and the network terminal 420 access the same local area network through a switch, and the network terminals 410 and 420 perform the decentralized video processing method disclosed in the embodiment of the present application, perform self-computing power evaluation by performing the foregoing steps 101, 102, and 103, and then notify the self-computing power information to the other party by broadcasting the self-computing power information. Meanwhile, after receiving the computing power information broadcast by the network terminal of the other party, the network terminal 410 and the network terminal 420 execute the aforementioned steps 105 and 106, and update the respective locally stored cluster node computing power list and cluster node transcoding task list. At this time, if the user plays the real-time video stream through the browser operated by the network terminal 410, the network terminal 410 performs steps 110 to 140 to broadcast the transcoding task scheduling result of the real-time video stream to the network terminal 420.
If the network terminal 420 is in the idle state at this time and the computation power index of the network terminal 420 is higher than that of the network terminal 410, the network terminal 410 schedules the transcoding task (i.e., the aforementioned first transcoding task) for determining the real-time video stream to the network terminal 420 when performing step 130. Thus, after receiving the broadcast scheduling result, the network terminal 420 executes steps 150 and 160 to perform the transcoding task of the real-time video stream.
The network terminal 410 may then play the video based on the video stream transcoded by the network terminal 420.
If the network terminal 410 is in the idle state at this time, and the computation power index of the network terminal 410 is higher than that of the network terminal 420, the network terminal 410 schedules the transcoding task (i.e., the aforementioned first transcoding task) for determining the real-time video stream to itself when performing step 130. Thus, after receiving the broadcast scheduling result, the network terminal 410 will execute steps 150 and 160 to perform the transcoding task of the real-time video stream.
Similarly, if the user plays the real-time video stream through the browser operated by the network terminal 420, the network terminal 420 performs steps 110 to 140 to broadcast the transcoding task scheduling result of the real-time video stream to the network terminal 410.
Therefore, the network terminals which join the cluster in the local area network share the computing power and perform transcoding scheduling on the same side, and the transcoding computing power of each terminal device is fully utilized.
The decentralized video processing method disclosed by the embodiment of the application is used for responding to a video playing instruction to acquire video stream information of a first video stream aimed at by the video playing instruction; determining the amount of computation power required for executing a first transcoding task of the first video stream according to the video stream information; determining a scheduling result comprising a scheduling matching relationship between the first transcoding task and a target network terminal according to the computing power quantity, a cluster node computing power list locally stored by the current network terminal and a cluster node transcoding task list; and broadcasting the scheduling result to schedule the target network terminal to execute the first transcoding task to transcode the first video stream to obtain a second video stream for playing, so that the problem of video transcoding playing pause caused by low performance of host equipment of a browser can be effectively solved.
According to the decentralized video processing method disclosed by the embodiment of the application, the network terminals in the local area network automatically establish the cluster, then the transcoding computing power of each network terminal is shared, each network terminal serves as a peer node, transcoding scheduling is carried out on all the network terminals according to the same transcoding task scheduling strategy, the optimal matching of the computing power quantity required by the transcoding tasks and the computing power indexes of the network terminals is achieved, the transcoding tasks requiring high computing power are scheduled to the network terminals providing high computing power, the transcoding speed of video streams is improved, and the problem that video transcoding playing is unsmooth due to the fact that host equipment performance of a browser is low is avoided.
The decentralized video processing method disclosed by the embodiment of the application realizes a self-organizing and decentralized transcoding cluster scheme, a central node is not arranged in the transcoding cluster, cluster information is updated by continuously sending broadcasts through a network terminal, the implementation is convenient, professional maintenance is not needed, and high-configuration hardware is not needed to be deployed. A network terminal will be automatically removed from the cluster as soon as it has timed out not to broadcast a message. Each network terminal maintains cluster information, obtains the same transcoding task scheduling strategy according to the same algorithm, has the capability of issuing and scheduling the transcoding task, fully utilizes computational resources of the network terminals in the local area network, and obviously improves the video stream playing pause phenomenon.
Correspondingly, an embodiment of the present application further discloses a decentralized video processing apparatus, as shown in fig. 5, the apparatus includes:
a video stream information obtaining module 510, configured to, in response to a video playing instruction, obtain video stream information of a first video stream targeted by the video playing instruction;
a calculation power amount determining module 520, configured to determine, according to the video stream information, an amount of calculation power required to perform a first transcoding task of the first video stream;
a transcoding scheduling result determining module 530, configured to determine a scheduling result including a scheduling matching relationship between the first transcoding task and the target network terminal according to the computation amount, a cluster node computation amount list locally stored in the current network terminal, and a cluster node transcoding task list;
and a scheduling transcoding module 540, configured to broadcast the scheduling result, so as to schedule the target network terminal to execute the first transcoding task to transcode the first video stream, thereby obtaining a second video stream for playing.
Optionally, the calculation power amount determining module 520 is further configured to:
determining the amount of computational power required to perform a first transcoding task for the first video stream based on one or more of the following information included in the video stream information: video frame rate, encoding protocol, transport protocol, video resolution.
Optionally, the cluster node computation force list includes: computing power indexes of all network terminals in the cluster to which the current network terminal belongs; the cluster node transcoding task list comprises the following steps: the network terminal in the cluster is in scheduling matching relation with second transcoding tasks, and the amount of computing power required for executing each second transcoding task;
the transcoding scheduling result determining module 530 is further configured to:
determining a scheduling matching relationship between the first transcoding task and each second transcoding task and each network terminal according to the amount of computing power required for executing the first transcoding task, the amount of computing power required for executing each second transcoding task, and the amount of computing power indicated by the computing power index of each network terminal in the cluster and a principle that the amount of computing power is positively correlated with the amount of computing power; and obtaining a scheduling result according to the matching relation.
Optionally, the cluster node calculation power list includes: calculating power indexes of all network terminals in the cluster to which the current network terminal belongs; the cluster node transcoding task list comprises the following steps: the network terminal in the cluster is in scheduling matching relation with second transcoding tasks, and the amount of computing power required for executing each second transcoding task;
the transcoding scheduling result determining module 530 is further configured to:
acquiring an idle network terminal in the cluster according to the cluster node calculation power list and the scheduling matching relation; then, determining the idle network terminals of which the computing power indexes meet the quantity of the computing power required by executing the first transcoding task as the target network terminals to obtain a scheduling matching relation between the first transcoding task and the target network terminals; and obtaining a scheduling result according to the scheduling matching relation.
Optionally, as shown in fig. 6, the apparatus further includes:
a cluster node calculation power list updating module 505, configured to respond to received calculation power information broadcasted in a local area network, and obtain a network terminal identifier and a calculation power index carried in the calculation power information; according to the network terminal identification and the calculation power index, the corresponding relation between the corresponding network terminal and the calculation power index is recorded in an incremental manner in a cluster node calculation power list; alternatively, the first and second liquid crystal display panels may be,
the cluster node computation power list updating module 505 is configured to, in response to that the broadcast information of the designated network terminal in the cluster node computation power list is not received within a preset time period, delete the corresponding relationship between the designated network terminal and the computation power index from the cluster node computation power list.
Optionally, as shown in fig. 6, the apparatus further includes:
the terminal computation power acquisition module 501 is configured to execute a preset computation operation and acquire an execution duration for executing the preset computation operation; determining the calculation power index of the current network terminal according to the execution duration;
the terminal computation power acquisition module 501 is further configured to broadcast computation power information carrying the computation power index, so that each network terminal in a cluster to which the current network terminal belongs updates a cluster node computation power list locally stored by each network terminal based on the broadcasted computation power information.
Optionally, as shown in fig. 6, the apparatus further includes:
the transcoding module 550 is configured to, in response to receiving the scheduling result broadcasted by the other network terminal, update the cluster node transcoding task list locally stored by the current network terminal according to the scheduling matching relationship carried in the received scheduling result; and executing a corresponding transcoding task according to the updated cluster node transcoding task list.
The decentralized video processing device disclosed in the embodiment of the present application is used to implement the decentralized video processing method described in the embodiment of the present application, and specific implementation of each module of the device is not described again, and reference may be made to specific implementation of corresponding steps in the method embodiment.
The decentralized video processing device disclosed by the embodiment of the application responds to a video playing instruction to acquire video stream information of a first video stream aimed at by the video playing instruction; determining the amount of computational power required for executing a first transcoding task of the first video stream according to the video stream information; determining a scheduling result comprising a scheduling matching relation between the first transcoding task and a target network terminal according to the computing power quantity, a cluster node computing power list and a cluster node transcoding task list which are locally stored in the current network terminal; and broadcasting the scheduling result to schedule the target network terminal to execute the first transcoding task to transcode the first video stream to obtain a second video stream for playing, so that the problem of video transcoding playing jam caused by low performance of host equipment of a browser can be effectively solved.
The decentralized video processing device disclosed in the embodiment of the application automatically builds a cluster through network terminals in a local area network, then shares transcoding computing power of each network terminal, each network terminal serves as a peer node, transcoding scheduling is performed on all network terminals according to the same transcoding task scheduling strategy, optimal matching of the number of computing power required by a transcoding task and computing power indexes of the network terminals is achieved, the transcoding task requiring high computing power is scheduled to the network terminals providing high computing power, video stream transcoding speed is increased, and the problem that video transcoding playing is blocked due to low performance of host equipment of a browser is avoided.
The decentralized video processing device disclosed by the embodiment of the application is convenient to implement, does not need professional maintenance, does not need to deploy high-configuration hardware, and obviously improves the video stream playing pause phenomenon.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
The foregoing detailed description is directed to a decentralized video processing method and apparatus, and specific examples are applied herein to illustrate the principles and implementations of the present application, which are merely used to help understand the method and a core idea of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
The various component embodiments of the present application may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functionality of some or all of the components in an electronic device according to embodiments of the present application. The present application may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present application may be stored on a computer readable medium or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
For example, fig. 7 illustrates an electronic device that may implement a method in accordance with the present application. The electronic device can be a PC, a mobile terminal, a personal digital assistant, a tablet computer and the like. The electronic device conventionally comprises a processor 710 and a memory 720 and program code 730 stored on said memory 720 and executable on the processor 710, said processor 710 implementing the method described in the above embodiments when executing said program code 730. The memory 720 may be a computer program product or a computer readable medium. The memory 720 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read only memory), an EPROM, a hard disk, or a ROM. The memory 720 has a storage space 7201 for program code 730 of a computer program for performing any of the method steps of the above-described method. For example, the storage space 7201 for the program code 730 may include respective computer programs for implementing the various steps in the above methods, respectively. The program code 730 is computer readable code. The computer programs may be read from or written to one or more computer program products. These computer program products comprise a program code carrier such as a hard disk, a Compact Disc (CD), a memory card or a floppy disk. The computer program comprises computer readable code which, when run on an electronic device, causes the electronic device to perform the method according to the above embodiments.
The embodiment of the present application also discloses a computer-readable storage medium, on which a computer program is stored, which when executed by a processor, implements the steps of the decentralized video processing method according to the first embodiment of the present application.
Such a computer program product may be a computer-readable storage medium that may have memory segments, memory spaces, etc. arranged similarly to memory 720 in the electronic device shown in fig. 7. The program code may be stored in a computer readable storage medium, for example, compressed in a suitable form. The computer readable storage medium is typically a portable or fixed storage unit as described with reference to fig. 8. Typically, the storage unit comprises computer readable code 730', said computer readable code 730' being code read by a processor, which when executed by the processor implements the steps of the method described above.
Reference herein to "one embodiment," "an embodiment," or "one or more embodiments" means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the present application. Furthermore, it is noted that instances of the word "in one embodiment" are not necessarily all referring to the same embodiment.
In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the application may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The application may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (10)

1. A method for decentralized video processing, the method comprising:
responding to a video playing instruction, and acquiring video stream information of a first video stream aimed at by the video playing instruction;
determining the amount of computational power required for executing a first transcoding task of the first video stream according to the video stream information;
determining a scheduling result comprising a scheduling matching relation between the first transcoding task and a target network terminal according to the computing power quantity, a cluster node computing power list and a cluster node transcoding task list which are locally stored in the current network terminal;
and broadcasting the scheduling result to schedule the target network terminal to execute the first transcoding task to transcode the first video stream to obtain a second video stream for playing.
2. The method of claim 1, wherein determining the amount of computational power required to perform the first transcoding task for the first video stream based on the video stream information comprises:
determining the amount of computational power required to perform a first transcoding task for the first video stream based on one or more of the following information included in the video stream information: video frame rate, encoding protocol, transport protocol, video resolution.
3. The method of claim 1, wherein the cluster node computation force list comprises: computing power indexes of all network terminals in the cluster to which the current network terminal belongs; the cluster node transcoding task list comprises the following steps: the network terminal in the cluster is in scheduling matching relation with second transcoding tasks, and the amount of computing power required for executing each second transcoding task;
determining a scheduling result comprising a scheduling matching relationship between the first transcoding task and a target network terminal according to the computing power quantity, a cluster node computing power list locally stored by the current network terminal and a cluster node transcoding task list, wherein the scheduling result comprises:
determining a scheduling matching relationship between the first transcoding task and each second transcoding task and each network terminal according to the amount of computing power required for executing the first transcoding task, the amount of computing power required for executing each second transcoding task, and the amount of computing power indicated by the computing power index of each network terminal in the cluster and a principle that the amount of computing power is positively correlated with the amount of computing power;
and obtaining a scheduling result according to the matching relation.
4. The method of claim 1, wherein the cluster node computation force list comprises: computing power indexes of all network terminals in the cluster to which the current network terminal belongs; the cluster node transcoding task list comprises the following steps: the network terminal in the cluster is in scheduling matching relation with second transcoding tasks, and the amount of computing power required for executing each second transcoding task;
determining a scheduling result comprising a scheduling matching relationship between the first transcoding task and the target network terminal according to the computing power quantity, a cluster node computing power list and a cluster node transcoding task list locally stored by the current network terminal, wherein the scheduling result comprises:
acquiring an idle network terminal in the cluster according to the cluster node calculation power list and the scheduling matching relation;
determining the idle network terminals with the calculation capacity indexes meeting the calculation capacity required by executing the first transcoding task as the target network terminals to obtain a scheduling matching relation between the first transcoding task and the target network terminals;
and obtaining a scheduling result according to the scheduling matching relation.
5. The method according to any of claims 1 to 4, wherein the cluster node power list is updated by:
responding to received computing power information broadcasted in a local area network, and acquiring a network terminal identifier and a computing power index carried in the computing power information; according to the network terminal identification and the computing power index, the corresponding relation between the corresponding network terminal and the computing power index is recorded in an incremental manner in a cluster node computing power list;
and in response to that the broadcast information of the designated network terminal in the cluster node calculation power list is not received within a preset time length, deleting the corresponding relation between the designated network terminal and the calculation power index from the cluster node calculation power list.
6. The method of any of claims 1 to 4, further comprising:
executing a preset computing operation, and acquiring the execution time length for executing the preset computing operation;
determining the calculation power index of the current network terminal according to the execution duration;
and broadcasting the computing power information carrying the computing power index, so that each network terminal in the cluster to which the current network terminal belongs updates a cluster node computing power list locally stored by each network terminal based on the broadcasted computing power information.
7. The method of any of claims 1 to 4, further comprising:
in response to receiving the scheduling result broadcasted by the other network terminal, updating the cluster node transcoding task list locally stored by the current network terminal according to the scheduling matching relation carried in the received scheduling result;
and executing a corresponding transcoding task according to the updated cluster node transcoding task list.
8. A decentralized video processing device, comprising:
the video stream information acquisition module is used for responding to a video playing instruction and acquiring video stream information of a first video stream aimed at by the video playing instruction;
the calculation capacity determining module is used for determining the calculation capacity required by executing the first transcoding task of the first video stream according to the video stream information;
a transcoding scheduling result determining module, configured to determine a scheduling result including a scheduling matching relationship between the first transcoding task and a target network terminal according to the computation amount, a cluster node computation amount list and a cluster node transcoding task list locally stored in a current network terminal;
and the scheduling transcoding module is used for broadcasting the scheduling result so as to schedule the target network terminal to execute the first transcoding task to transcode the first video stream and obtain a second video stream for playing.
9. An electronic device comprising a memory, a processor, and program code stored on the memory and executable on the processor, wherein the processor implements the decentralized video processing method according to any one of claims 1 to 7 when executing the program code.
10. A computer-readable storage medium having stored thereon program code means for implementing the steps of the method of decentralized video processing according to any one of claims 1 to 7 when said program code means are executed by a processor.
CN202211190538.4A 2022-09-28 2022-09-28 Decentralized video processing method and device and electronic equipment Pending CN115695919A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211190538.4A CN115695919A (en) 2022-09-28 2022-09-28 Decentralized video processing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211190538.4A CN115695919A (en) 2022-09-28 2022-09-28 Decentralized video processing method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN115695919A true CN115695919A (en) 2023-02-03

Family

ID=85065503

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211190538.4A Pending CN115695919A (en) 2022-09-28 2022-09-28 Decentralized video processing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN115695919A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116437127A (en) * 2023-06-13 2023-07-14 典基网络科技(上海)有限公司 Video cartoon optimizing method based on user data sharing

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116437127A (en) * 2023-06-13 2023-07-14 典基网络科技(上海)有限公司 Video cartoon optimizing method based on user data sharing
CN116437127B (en) * 2023-06-13 2023-08-11 典基网络科技(上海)有限公司 Video cartoon optimizing method based on user data sharing

Similar Documents

Publication Publication Date Title
US20230281037A1 (en) Cross-device task relay method, cloud platform, and non-transitory storage medium
CN113569117B (en) Cloud platform system and method based on industrial internet big data service
US9727318B2 (en) Techniques to identify and purge unused code
CN110399213B (en) Method, device, electronic equipment and medium for determining resource demand of application program
CN113434294A (en) Data processing method, computer equipment and readable storage medium
CN110413673B (en) Database data unified acquisition and distribution method and system
CN102882829A (en) Transcoding method and system
CN109271130B (en) Audio playing method, medium, device and computing equipment
CN101334739B (en) Method for managing evolving user preferences, method and circuit for managing user preferences information
TWM539648U (en) Predictive control systems
EP1259030A2 (en) System and method for predicting network performance
CN102045553A (en) Multimedia transcoding device and method and multimedia player
CN101505284A (en) Intelligent information dynamic pushing method and system
CN104579768A (en) Client upgrading method and device
CN108337127B (en) Application performance monitoring method, system, terminal and computer readable storage medium
CN110471735A (en) Operational view interface method for pushing and device
CN115695919A (en) Decentralized video processing method and device and electronic equipment
CN104092555A (en) Parameter value updating method, device and system
CN113676754A (en) Live video transcoding method and device
CN113891114B (en) Transcoding task scheduling method and device
CN104834649B (en) It can realize the smart machine and multiple-equipment team working method of more equipment collaborations
CN112418058A (en) Video processing method and device
WO2023077813A1 (en) Method and apparatus for determining fake traffic in live broadcast room
CN105874852A (en) Mobile device power control
CN112910708B (en) Distributed service calling method and device

Legal Events

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