CN103686224A - Method and system for transcoding task obtaining on basis of distributed locks - Google Patents

Method and system for transcoding task obtaining on basis of distributed locks Download PDF

Info

Publication number
CN103686224A
CN103686224A CN 201310738633 CN201310738633A CN103686224A CN 103686224 A CN103686224 A CN 103686224A CN 201310738633 CN201310738633 CN 201310738633 CN 201310738633 A CN201310738633 A CN 201310738633A CN 103686224 A CN103686224 A CN 103686224A
Authority
CN
Grant status
Application
Patent type
Prior art keywords
transcoding
task
node
request
acquisition
Prior art date
Application number
CN 201310738633
Other languages
Chinese (zh)
Inventor
李超
刘钧石
邢波
鲍大磊
王孝庆
Original Assignee
乐视网信息技术(北京)股份有限公司
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

Links

Abstract

The invention discloses a method and system for transcoding task obtaining on the basis of distributed locks. The method comprises the steps of utilizing a register node to receive transcoding task obtaining requests sent by a transcoding server during a transcoding task obtaining period; deleting all the transcoding task obtaining requests when determining that no specific transcoding task obtaining request is contained in all the transcoding task obtaining requests received by the register node; distributing read-write locks for the specific transcoding task obtaining requests when determining that the specific transcoding task obtaining requests are contained in all the transcoding task obtaining requests received by the register node; and sending the task obtaining requests to which the read-write locks are distributed to a control center so that the transcoding server sending the specific transcoding task obtaining requests to the register node can obtain and process transcoding tasks needing to be carried out within the transcoding task obtaining period from the position of the control center. The method and the system solve the problem that the distributed locks cannot be generated for transcoding queue of the control center.

Description

基于分布式锁的转码任务获取的方法和系统 Distributed Lock based method of transcoding jobs and acquired systems

技术领域 FIELD

[0001] 本申请涉及分布式控制领域,更具体地,涉及一种基于分布式锁的转码任务获取的方法和系统。 [0001] The present application relates to the field of distributed control, and more particularly, to a method and system for transcoding tasks based distributed lock acquired.

背景技术 Background technique

[0002] 现有技术中,视频网站中的视频文件由于受到网络传输协议、网络数据传输特性等条件的限制,并不是所有的视频格式都适合于网络传输播放,进行播放的视频都需要经过转码处理,转换成适合于网络播放的格式(如flv”格式适合于电视终端传输及播放, [0002] prior art, due to network transmission protocol, limiting video sites in the network data transmission characteristics of video files and other conditions, not all video formats are suitable for network transmission playback, video playback need to go through turn code processing, converted into a format suitable for the network player (e.g. flv "format suitable for the transmission and play television terminal,

mp4”格式适合于计算机及移动终端网络传输及播放)。为了保证用户的观看体验,视频网站通常都会提供大量的视频共用户自由选择播放。也就是说,视频网站需要建立大量的转码任务,并通过其内部的转码系统(由转码服务器构成)来执行视频的转码处理。 mp4 "format suitable for computer and mobile terminal network transmission and playback). In order to ensure the user's viewing experience and video sites usually provide a lot of video users were free to choose to play. That is, video sites need to build a lot of transcoding tasks, and performs the transcoding process through its internal video transcoding system (composed of a transcoding server).

[0003] 对于转码系统而言,其中包括控制中心和注册到控制中心的多个转码服务器。 [0003] For the transcoding system, which comprises a control center and a plurality of transcoding servers to register the control center. 控制中心根据相应的视频数据库中存储的视频资源生成对应的转码任务,以转码队列的方式将所有的转码任务进行共享,所有的转码服务器(或转码服务器中的转码进程)都可以通过向控制中心发送转码任务获取请求的方式获取到控制中心的转码队列,并针对转码队列中的转码任务进行转码处理。 Control center generates the video resources corresponding video stored in the database corresponding transcoding tasks, in a manner transcoding queue all of the transcoding task sharing, all transcoding server (or transcoding process transcoding server) It can be acquired by sending a request to the control center transfer mode code acquired transcoding tasks queue control center, and transcoding for transcoding transcoding task queue.

[0004] 由于转码系统中不同的转码服务器(或是其中的转码进程)都可以获取控制中心的转码队列进行转码处理,所以可能出现处理任务重复的情况,如:多台转码服务器都针对所获取的转码队列中的“转码任务X”进行处理,从而造成了转码资源的严重浪费。 [0004] Since different transcoding system transcoding server (or where the transcoding process) may be acquired transcoding queue control center transcoding process, the repeated processing task may be the case, such as: multiple turn code for the server to process the acquired transcoding queue "transcoding task X", resulting in a serious waste of transcoding resources.

发明内容 SUMMARY

[0005] 有鉴于此,本申请所要解决的技术问题是提供了一种基于分布式锁的转码任务获取的方法和系统,以解决不能对控制中心的转码队列生成分布式锁的问题。 [0005] Accordingly, the present application to solve the technical problem of providing a method and system based on a distributed transcoding task acquired lock, to solve the problem that a transcoding to the Control Center queue creating a distributed lock.

[0006] 为了解决上述技术问题,本申请公开了一种基于分布式锁的转码任务获取的方法,包括: [0006] In order to solve the above problems, the present application discloses a method of transcoding based on distributed task acquired lock, comprising:

[0007] 注册节点接收转码服务器在转码任务获取周期内发送的转码任务获取请求; Transcoding Task [0007] The registration server node receives transcoded within transcoding sent task acquisition period obtaining request;

[0008] 在确定出所述注册节点在所述转码任务获取周期内接收的所有转码任务获取请求中不包含特定转码任务获取请求时,删除在所述转码任务获取周期内接收到的所有转码任务获取请求;其中,所述特定转码任务获取请求是在所述转码任务获取周期内最早被发送至转码系统中的注册节点的转码任务获取请求;或者,所述特定转码任务获取请求是所述转码系统中级别最高的转码服务器发送的转码任务获取请求;所述转码系统为所述注册节点所属的转码系统,且所述转码系统至少包含一个注册节点;转码服务器的所述级别是根据转码服务器的属性信息预先设置的; [0008] When determined that all the registered node transcoding tasks received within the transcoding task acquisition period obtaining request does not include a specific transcoding task acquisition request, delete received within the transcoding task acquisition period transcoding all tasks request acquisition; wherein said specific transcoding task is the first acquisition request is transmitted to the transcoding task of the transcoding system acquisition request of registered nodes within the transcoding task acquisition period; or the transcoding specific task acquisition request transcoding is the transcoding task of the highest-level system transcoding server sends the obtaining request; the transcoding system of the transcoding system registration node belongs, and at least the transcoding system It comprises a registration node; the level of transcoding server is transcoding server according to attribute information set in advance;

[0009] 在确定出所述注册节点在所述转码任务获取周期内接收的所有转码任务获取请求中包含所述特定转码任务获取请求时,为所述特定转码任务获取请求分配读写锁; [0009] When determined that all the registered node transcoding tasks received within the transcoding task acquisition period obtaining request including the particular transcoding task acquisition request for acquiring the particular transcoding tasks assigned read request write lock;

[0010] 将被分配了所述读写锁的任务获取请求发送给控制中心,以使得向所述注册节点发送所述特定转码任务获取请求的转码服务器从所述控制中心处获得需在所述转码任务获取周期内执行的转码任务并进行处理。 [0010] will be assigned the task of acquiring the write lock request is sent to the control center, so that the transcoding server transmitting said specific task to the transcoding node registration is obtained for an acquisition request from the control center acquiring the transcoding task of the transcoding task execution cycle and processed.

[0011] 优选地,当所述转码系统中包含至少两个注册节点时,所述注册节点接收转码服务器在转码任务获取周期内发送的转码任务获取请求后,所述方法还包括: After [0011] Preferably, when the transcoding system comprises at least two nodes registered, the registration task node receives rotational transcoding server code transmitted within the transcoding task acquisition period obtaining request, the method further comprises :

[0012] 所述注册节点将所述所有转码任务获取请求和相应的接收时间戳发送给所述转码系统中的其他注册节点,并接收所述其他注册节点发送的、由所述其他注册节点在所述转码任务获取周期接收到的所有转码任务获取请求和相应的接收时间戳; [0012] The registration node transcoding tasks of all the other registration node acquiring the transcoding system and the request sent to the respective received time stamps, and the other receiving node sends the register, register by the other node in the transcoding task acquisition period all the received acquisition request transcoding tasks and a corresponding receiver time stamp;

[0013] 所述注册节点根据所述注册节点在所述转码任务获取周期接收到的所有转码任务获取请求的接收时间戳,以及所述其他注册节点在所述转码任务获取周期接收到的所有转码任务获取请求的接收时间戳,按照接收时间由先至后的顺序,对所述注册节点在所述转码任务获取周期接收到的所有转码任务获取请求以及所述其他注册节点在所述转码任务获取周期接收到的所有转码任务获取请求进行排序; [0013] The registration node based on the received registration node acquiring the transcoding task period all transcoding task acquisition request receiving time stamp, and said other node receives the registration in the transcoding task acquisition period All transcoding task acquisition request receiving time stamp, the order of acquisition time of reception of the registered post-rock at the transcoding node transcoding tasks of all the task period and the received acquisition request to the other node registration in the transcoding task acquisition period all the received transcoding tasks request acquisition sorting;

[0014] 当确定排列在第一位的转码任务获取请求为所述注册节点所接收的转码任务获取请求时,确定所述注册节点在所述转码任务获取周期内接收的所有转码任务获取请求中包含所述特定转码任务获取请求; [0014] When it is determined in the first place arranged transcoding task acquisition request transcoding task registration node received the acquisition request receiving node determines the registration in the transcoding task acquisition period all transcoding task acquiring request contains the acquiring request specific transcoding tasks;

[0015] 当确定排列在第一位的转码任务获取请求不是所述注册节点所接收的转码任务获取请求时,确定所述注册节点在所述转码任务获取周期内接收的所有转码任务获取请求中不包含所述特定转码任务获取请求。 [0015] When determining the arrangement of an acquisition request transcoding task is not the transcoding task registration acquisition request received by the node, determining a node receives all the transcoded registered in the transcoding task acquisition period a task acquisition request does not include the particular transcoding task acquisition request.

[0016] 优选地,所述注册节点接收转码服务器在转码任务获取周期内发送的转码任务获取请求后,所述方法还包括: [0016] Preferably, the transcoding task registration node transcoding server receiving transmitted within the transcoding task acquisition period obtaining request, the method further comprising:

[0017] 所述注册节点将所述所有转码任务获取请求和相应的接收时间戳发送给所述转码系统中的控制中心; The [0017] node to register all the transcoding task control center acquires the transcoding system and the request sent to the respective received time stamps;

[0018] 所述注册节点接收所述控制中心发送的关于转码任务获取请求优先级的通知消息;其中,所述通知消息是所述控制中心根据所述转码系统中的各注册节点在所述转码任务获取周期接收到的所有转码任务获取请求的接收时间戳,按照接收时间由先至后的顺序,对所述各注册节点在所述转码任务获取周期接收到的所有转码任务获取请求进行排序后发送的; [0018] The node receiving the registration control center sends the acquisition request regarding transcoding task priority notification message; wherein the notification message is the control center according to the respective nodes registered in the transcoding system of the said transcoding task acquisition period all the received transcoding task acquisition request receiving time stamp, all acquisition period received by the reception time transcoding according to the order of the respective registration node-rock in the transcoding task task acquisition request after sorting;

[0019] 在解析出所述通知消息表示对所述各注册节点在所述转码任务获取周期接收到的所有转码任务获取请求进行排序后,排列在第一位的转码任务获取请求为所述注册节点所接收的转码任务获取请求时,确定所述注册节点在所述转码任务获取周期内接收的所有转码任务获取请求中包含所述特定转码任务获取请求; [0019] After parsing the notification message indicates the transcoding task acquisition period received by all the nodes registered for each transcoding tasks request acquisition for sorting the arrangement of the first acquisition request for the transcoding tasks the registration node transcoding jobs received acquisition request, determines all the nodes registered transcoding tasks received within the transcoding task acquisition period obtaining request including the particular transcoding task acquisition request;

[0020] 在解析出所述通知消息表示对所述各注册节点在所述转码任务获取周期接收到的所有转码任务获取请求进行排序后,排列在第一位的转码任务获取请求不是所述注册节点所接收的转码任务获取请求时,确定所述注册节点在所述转码任务获取周期内接收的所有转码任务获取请求中不包含所述特定转码任务获取请求。 [0020] After parsing the notification message indicates the registration node of each received in the transcoding task acquisition period obtaining request all transcoding tasks sorts arranged acquisition request of a task is not transcoding the registration node transcoding jobs received acquisition request, the receiving node determines the registration in the transcoding task acquisition period all transcoding task acquisition request does not include the particular transcoding task acquisition request.

[0021] 优选地,所述属性信息包括下述信息的一种或多种: [0021] Preferably, the attribute information includes one or more of the following information:

[0022] 额定负载信息; [0022] rated load information;

[0023] CPU处理能力信息; [0023] CPU processing capability information;

[0024] 内存大小的信息;[0025] 与所述控制中心之间的数据传输链路的带宽信息。 [0024] The memory size information; [0025] bandwidth information and the control data transmission link between the centers.

[0026] 为了解决上述技术问题,本申请还公开了一种基于分布式锁的转码任务获取的系统,与注册节点、转码服务器以及控制中心相耦接,其特征在于,该系统包括:接收单元、识别处理单元以及获取单元,其中, [0026] In order to solve the above problems, the present application also discloses a system for transcoding tasks based distributed lock acquired, the registered nodes, and the transcoding server coupled to the control center, characterized in that the system comprising: a receiving unit, an acquisition unit and a recognition processing unit, wherein,

[0027] 所述接收单元,用于指示所述注册节点接收所述转码服务器在转码任务获取周期内发送的转码任务获取请求; [0027] the receiving unit, for instructing the registration node receiving the transcoding task transcoding server transmitted within the transcoding task acquisition period obtaining request;

[0028] 所述识别处理单元,用于确定出所述注册节点在所述转码任务获取周期内接收的所有转码任务获取请求中不包含特定转码任务获取请求时,删除所述注册节点在所述转码任务获取周期内接收到的所有转码任务获取请求; When [0028] the recognition processing unit configured to determine all of the registered node transcoding tasks received within the transcoding task acquisition period obtaining request does not contain the acquiring request specific transcoding jobs, deleting the registered nodes received within the transcoding task acquisition period obtaining request all transcoding tasks;

[0029] 确定出所述注册节点在所述转码任务获取周期内接收的所有转码任务获取请求中包含所述特定转码任务获取请求时,为所述特定转码任务获取请求分配读写锁; When the [0029] determined that all the registered node transcoding tasks received within the transcoding task acquisition period obtaining request including the particular transcoding task acquisition request for acquiring the particular transcoding tasks requesting allocation reader lock;

[0030] 其中,所述特定转码任务获取请求是在所述转码任务获取周期内最早被发送至转码系统中的注册节点的转码任务获取请求;或者,所述特定转码任务获取请求是所述转码系统中级别最高的转码服务器发送的转码任务获取请求;所述转码系统为所述注册节点所属的转码系统,且所述转码系统至少包含一个注册节点;转码服务器的所述级别是根据转码服务器的属性信息预先设置的; [0030] wherein the specific transcoding task is the first acquisition request is transmitted to the transcoding task of the transcoding system acquisition request of registered nodes within the transcoding task acquisition period; or the particular acquisition transcoding tasks transcoding task request the transcoding system the highest level of transcoding server sends the obtaining request; the transcoding system of transcoding system node belongs to the registration, and the transcoding system comprises at least one node registered; the level transcoding server is transcoding server according to attribute information set in advance;

[0031] 所述获取单元,用于将所述注册节点中被分配了所述读写锁的任务获取请求发送给所述控制中心,以使得向所述注册节点发送所述特定转码任务获取请求的转码服务器从所述控制中心处获得需在所述转码任务获取周期内执行的转码任务并进行处理。 [0031] the obtaining unit, configured to register the node is assigned the task of acquiring the read lock request is sent to the control center, so that the registration to send the node-specific transcoding task acquisition transcoding server requests the transcoding task needs to be performed to obtain within the transcoding task acquisition period from the control center and processed.

[0032] 优选地,当所述转码系统中包含至少两个注册节点时,所述注册节点接收转码服务器在转码任务获取周期内发送的转码任务获取请求后,所述识别处理单元,还用于: Transcoding tasks [0032] Preferably, when the transcoding system comprises at least two registration node, the node receiving registration server sends transcoded within transcoding task after the acquisition period obtaining request, the recognition processing unit also for:

[0033] 将一所述注册节点中所有转码任务获取请求和相应的接收时间戳发送给所述转码系统中的其他注册节点,并指示该注册节点接收所述其他注册节点发送的、由所述其他注册节点在所述转码任务获取周期接收到的所有转码任务获取请求和相应的接收时间戳; [0033] sending the registration node in a Transcoding all tasks request acquisition and receiving timestamp corresponding to other nodes registered in the transcoding system, and instructs the registration of the other node registration node receives transmitted by Get all the other nodes registered transcoding task period received at the transcoding task acquisition request and a corresponding receiver time stamp;

[0034] 根据所述注册节点在所述转码任务获取周期接收到的所有转码任务获取请求的接收时间戳,以及所述其他注册节点在所述转码任务获取周期接收到的所有转码任务获取请求的接收时间戳,按照接收时间由先至后的顺序,对所述注册节点在所述转码任务获取周期接收到的所有转码任务获取请求以及所述其他注册节点在所述转码任务获取周期接收到的所有转码任务获取请求进行排序; [0034] receiving time stamp according to the registration node acquiring the transcoding task period all the received transcoding task acquisition request, and the other nodes registered in the transcoding task acquisition period all the received transcoding receive timestamp task acquisition request, acquires a reception time according to the order of the registered-rock at the transcoding node all transcoding task duty cycle of the received obtaining request and the other nodes registered in the turn task code acquisition period all the received transcoding tasks request acquisition sorting;

[0035] 当确定排列在第一位的转码任务获取请求为所述注册节点所接收的转码任务获取请求时,确定所述注册节点在所述转码任务获取周期内接收的所有转码任务获取请求中包含所述特定转码任务获取请求; [0035] When it is determined in the first place arranged transcoding task acquisition request transcoding task registration node received the acquisition request receiving node determines the registration in the transcoding task acquisition period all transcoding task acquiring request contains the acquiring request specific transcoding tasks;

[0036] 当确定排列在第一位的转码任务获取请求不是所述注册节点所接收的转码任务获取请求时,确定所述注册节点在所述转码任务获取周期内接收的所有转码任务获取请求中不包含所述特定转码任务获取请求。 [0036] When determining the arrangement of an acquisition request transcoding task is not the transcoding task registration acquisition request received by the node, determining a node receives all the transcoded registered in the transcoding task acquisition period a task acquisition request does not include the particular transcoding task acquisition request.

[0037] 优选地,所述识别处理单元,还用于: [0037] Preferably, the recognition processing unit is further configured to:

[0038] 将所述注册节中所述所有转码任务获取请求和相应的接收时间戳发送给所述转码系统中的控制中心;[0039] 接收所述控制中心发送的关于转码任务获取请求优先级的通知消息;其中,所述通知消息是所述控制中心根据所述转码系统中的各注册节点在所述转码任务获取周期接收到的所有转码任务获取请求的接收时间戳,按照接收时间由先至后的顺序,对所述各注册节点在所述转码任务获取周期接收到的所有转码任务获取请求进行排序后发送的; [0038] The registration section transmits the acquisition request all transcoding tasks and the respective receiving time stamp to the control center the transcoding system; [0039] received on the acquisition control center transmits the transcoding task request priority notification message; wherein the notification message is the control center of each acquisition request according to the transcoding node registration system in the transcoding task acquisition period all the received transcoding tasks receiving timestamp after acquiring the transcoding tasks in the order from each of the registered node according to the received-rock period all the received transcoding task acquisition request sent by sorting;

[0040] 在解析出所述通知消息表示对所述各注册节点在所述转码任务获取周期接收到的所有转码任务获取请求进行排序后,排列在第一位的转码任务获取请求为所述注册节点所接收的转码任务获取请求时,确定所述注册节点在所述转码任务获取周期内接收的所有转码任务获取请求中包含所述特定转码任务获取请求; [0040] After parsing the notification message indicates the transcoding task acquisition period received by all the nodes registered for each transcoding tasks request acquisition for sorting the arrangement of the first acquisition request for the transcoding tasks the registration node transcoding jobs received acquisition request, determines all the nodes registered transcoding tasks received within the transcoding task acquisition period obtaining request including the particular transcoding task acquisition request;

[0041] 在解析出所述通知消息表示对所述各注册节点在所述转码任务获取周期接收到的所有转码任务获取请求进行排序后,排列在第一位的转码任务获取请求不是所述注册节点所接收的转码任务获取请求时,确定所述注册节点在所述转码任务获取周期内接收的所有转码任务获取请求中不包含所述特定转码任务获取请求。 [0041] After parsing the notification message indicates the registration node of each received in the transcoding task acquisition period obtaining request all transcoding tasks sorts arranged acquisition request of a task is not transcoding the registration node transcoding jobs received acquisition request, the receiving node determines the registration in the transcoding task acquisition period all transcoding task acquisition request does not include the particular transcoding task acquisition request.

[0042] 优选地,所述属性信息包括下述信息的一种或多种: [0042] Preferably, the attribute information includes one or more of the following information:

[0043] 额定负载信息; [0043] rated load information;

[0044] CPU处理能力信息; [0044] CPU processing capability information;

[0045] 内存大小的信息; [0045] The memory size information;

[0046] 与所述控制中心之间的数据传输链路的带宽信息。 [0046] and the data transmission link bandwidth information between the control center.

[0047] 与现有技术相比,本申请所述的一种基于分布式锁的转码任务获取的方法和系统,达到了如下效果: [0047] Compared with the prior art A method of the present application based on the distributed lock transcoding tasks and acquisition system to achieve the following results:

[0048] I)本申请通过控制中心创建的多个注册节点,将分布式锁设置于其中一个注册节点中,多个转码服务器或转码处理进程访问多个注册节点时,只有一个转码服务器或转码处理进程访问到带有分布式锁的节点,有效解决了不能对控制中心的转码队列生成分布式锁的问题。 When the [0048] I) of the present application to create a plurality of nodes registered with the control center, the distributed lock disposed therein a registered node, the plurality of transcoding servers or transcoding process accesses a plurality of registered nodes, only a transcoding transcoding process server or node with distributed access to the lock, an effective solution to the problem can not be distributed lock queue generation of transcoding control center.

[0049] 2)本申请还可以针对分布式的转码系统进行转码服务器的统一命名服务、状态同步服务、集群管理、分布式应用配置项等统一的数据管理。 [0049] 2) The application also can be distributed transcoding system for transcoding server, unified naming service, state synchronization service, cluster management, distributed application configuration items such as unified data management.

[0050] 当然,实施本申请的任一产品必不一定需要同时达到以上所述的所有技术效果。 [0050] Of course, any embodiment of the present application do not necessarily need a product must achieve all of the above technical effect. 附图说明 BRIEF DESCRIPTION

[0051] 此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。 [0051] The drawings described herein are provided for further understanding of the present disclosure, constitute part of this application, exemplary embodiments of the present disclosure used to explain the embodiment of the present application, without unduly limiting the present disclosure. 在附图中: In the drawings:

[0052] 图1是本申请实施例一所述的基于分布式锁的转码任务获取的方法的流程图。 [0052] FIG. 1 is a flowchart of a method of distributed lock based on the acquired transcoding task to an embodiment of the present application.

[0053] 图2是本申请实施例二所述的基于分布式锁的转码任务获取的方法的流程图。 [0053] FIG 2 is a flowchart of a method of transcoding tasks distributed lock acquired based on the embodiment two of the present application.

[0054] 图3和4是本申请实施例三所述的基于分布式锁的转码任务获取的方法的在转码系统中的具体应用示意图。 [0054] FIGS. 3 and 4 is a schematic diagram of the transcoding system according to a third specific application of the method according to the distributed lock transcoding task based on the acquired application to the present embodiment.

[0055] 图5是本申请实施例四所述的基于分布式锁的转码任务获取的系统的结构框图。 [0055] FIG. 5 is a block diagram of the system based on distributed lock acquired transcoding tasks of the four embodiment of the present application. 具体实施方式 detailed description

[0056] 如在说明书及权利要求当中使用了某些词汇来指称特定组件。 [0056] Certain terms as used in the specification and claims to refer to particular components. 本领域技术人员应可理解,硬件制造商可能会用不同名词来称呼同一个组件。 Those skilled in the art will appreciate, manufacturers may use different terms to refer to a component. 本说明书及权利要求并不以名称的差异来作为区分组件的方式,而是以组件在功能上的差异来作为区分的准则。 The present specification and claims is not to differ in name as a way to distinguish between the components, but rather the difference in function to the components as a criterion to distinguish. 如在通篇说明书及权利要求当中所提及的“包含”为一开放式用语,故应解释成“包含但不限定于”。 As mentioned throughout the specification and claims, "comprising" is an open-ended fashion, and thus should be interpreted to mean "including, but not limited to." “大致”是指在可接收的误差范围内,本领域技术人员能够在一定误差范围内解决所述技术问题,基本达到所述技术效果。 "Substantially" means within an error range is acceptable, those skilled in the art to solve the technical problem within a certain error range, to achieve the basic technical effect. 此外,“耦接”一词在此包含任何直接及间接的电性耦接手段。 In addition, the "couple" is intended to mean any direct and indirect electrical coupling means. 因此,若文中描述一第一装置耦接于一第二装置,则代表所述第一装置可直接电性耦接于所述第二装置,或通过其他装置或耦接手段间接地电性耦接至所述第二装置。 Accordingly, described herein if a device is coupled to a second device, said first means represents may be directly electrically coupled to the second means, or by other means or indirectly electrically coupling means coupled connected to the second device. 说明书后续描述为实施本申请的较佳实施方式,然所述描述乃以说明本申请的一般原则为目的,并非用以限定本申请的范围。 Follow the instructions described embodiment is a preferred embodiment of the present disclosure, then the disclosure of the present description are based on the general principles described for the purpose, not for limiting the scope of the application. 本申请的保护范围当视所附权利要求所界定者为准。 When the scope of the present application the following claims and their equivalents.

[0057] 实施例一 [0057] Example a

[0058] 如图1所示,为本申请实施例一所述的一种基于分布式锁的转码任务获取的方法,该方法包括: [0058] FIG. 1, according to the present embodiment one of a distributed application method lock task based on the acquired transcoding, the method comprising:

[0059] 步骤101,注册节点接收转码服务器在转码任务获取周期内发送的转码任务获取请求。 [0059] Step 101, the transcoding node receives a registration request in the server to obtain the transcoding task acquisition period transcoding jobs transmitted.

[0060] 对于步骤101,具体地,视频网站的原始视频资源(也可称为片源)存储于相应的片源服务器中,片源都是未经转码处理的视频,当视频网站需要进行视频转码时,会指示服务端的转码系统(可以由转码服务器构成)通过在所述服务端中的控制中心调取片源服务器中存储的片源进行转码处理,建立相应的转码任务,再由转码系统中不同的转码服务器或其中的转码进程访问控制中心获取任务进行转码处理。 [0060] For Step 101, specifically, the original video resources video sites (also called sources) are stored in respective server sources, video sources are not transcoded, the video site when required video transcoding, instructs the transcoding system server (which may be constituted by transcoding server) by the control center of the service end of the retrieval sources sources stored in the server performs transcoding process, to establish the appropriate transcoding task, and then accessed by different transcoding system of transcoding servers or transcoding process in which the mission control center to obtain transcoding process. 本实施例中,采用云构架的转码系统进行转码处理,即各地用户均可以将视频资源上传到相应的片源服务器,在生成相应的转码任务发送到本实施例中的转码服务器中进行转码处理,经过转码处理后,其他各地区的用户便可通过计算机终端、移动终端或电视终端访问该视频网站观看或下载相应的视频资源。 In this embodiment, using the transcoding system cloud frame transcoding process, i.e., users around both can upload video assets to appropriate sources server, generates a corresponding transcoding task to send to the present embodiment, transcoding server the transcoding process, after the transcoding process, each user can through other parts of a computer terminal, a mobile terminal or television terminals to access the video website viewing or download the appropriate video resources. 当然,对于本实施例中的转码服务器还可以是其他构架结构,并不构成对本申请的限定。 Of course, transcoding server embodiment according to the present embodiment may also be other frame structures, do not limit the present disclosure.

[0061] 其中,所述控制中心可以是具有统一数据管理能力的服务器或相应装置,该控制中心可以在其内部创建多个注册节点,也可以在转码系统中通过代理服务器创建多个注册节点,当然,所述控制中心也可以采用其他方式创建不同的注册节点,并不构成对本申请的限定。 [0061] wherein, the control center may be a data server or a corresponding device unified management, the control center may create multiple nodes in its internal register, a plurality of registered nodes may be created by transcoding proxy system of course, the control center may be other ways to create different registration node, do not limit the present disclosure. 其中,所述注册节点的数量与该转码系统中的转码服务器或其转码进程的数量相适应。 Wherein the transcoding server, or the number of transcoding node processes the registration number of the transcoding system to adapt.

[0062] 步骤102,在确定出所述注册节点在所述转码任务获取周期内接收的所有转码任务获取请求中不包含特定转码任务获取请求时,删除在所述转码任务获取周期内接收到的所有转码任务获取请求;在确定出所述注册节点在所述转码任务获取周期内接收的所有转码任务获取请求中包含所述特定转码任务获取请求时,为所述特定转码任务获取请求分配读写锁。 [0062] Step 102, when it is determined that all the registered node transcoding tasks received within the transcoding task acquisition period obtaining request does not contain the acquiring request specific transcoding jobs, deleting acquiring the transcoding task period all the received acquisition request transcoding tasks; acquiring request contains the acquiring request specific transcoding tasks of all tasks is determined that transcoding node receiving the registration in the transcoding task acquisition period, as the transcoding specific task acquisition request allocation read-write lock.

[0063] 其中,所述特定转码任务获取请求是在所述转码任务获取周期内最早被发送至转码系统中的注册节点的转码任务获取请求;或者,所述特定转码任务获取请求是所述转码系统中级别最高的转码服务器发送的转码任务获取请求;所述转码系统为所述注册节点所属的转码系统,且所述转码系统至少包含一个注册节点;转码服务器的所述级别是根据转码服务器的属性信息预先设置的。 [0063] wherein the specific transcoding task is the first acquisition request is transmitted to the transcoding task of the transcoding system acquisition request of registered nodes within the transcoding task acquisition period; or the particular acquisition transcoding tasks transcoding task request the transcoding system the highest level of transcoding server sends the obtaining request; the transcoding system of transcoding system node belongs to the registration, and the transcoding system comprises at least one node registered; the level transcoding server is transcoding server according to attribute information set in advance.

[0064] 对于步骤102,由所述控制中心创建的多个所述注册节点接收来自不同所述转码服务器或转码线程发出的转码任务获取请求,多个所述转码任务获取请求随机地发送到不同的所述注册节点中,形成“抢节点”的过程。 [0064] For Step 102, the transcoding received from different servers or transcoding transcoding task acquisition request issued by the thread of the plurality of the registration control node created by the center, a plurality of the transcoding task acquisition request random transmitted to a different node in the registration, the formation of "grab nodes". 在多个所述转码任务获取请求被所述注册节点接收的过程中,各所述转码任务获取请求被所述注册节点接收的时间不相同,有先后之分,所以,在步骤102中,将在所述转码任务获取周期内最早被发送至转码系统中的注册节点的转码任务获取请求作为所述特定转码任务获取请求;另外,各所述转码任务获取请求中也含有不同的转码服务器的级别信息,所以,在步骤102中,也可以将所述转码系统中级别最高的转码服务器发送的转码任务获取请求作为所述特定转码任务获取请求。 A plurality of tasks in the transcoding process of obtaining the registration request is received by the node, each of the transcoding task acquisition request is received the registration node is not the same time, there has points, so, in step 102 the first to be acquired as the specific transcoding requested task acquisition request to the transcoding system transcoding tasks of the nodes registered in the transcoding task acquisition period; Further, each of the transcoding task acquisition request also containing different levels of information transcoding server, so, in step 102, the switch may be transcoding system codes the highest-level task transcoding server sends the request for obtaining as the specific transcoding task acquisition request. 当然,对于所述特定转码任务获取请求的划分,还可以是其他类型或方式,并不构成对本申请的限定。 Of course, a request for obtaining said specific division transcoding tasks, or may be other types of embodiment, not intended to limit the present disclosure.

[0065] 步骤103,将被分配了所述读写锁的任务获取请求发送给控制中心,以使得向所述注册节点发送所述特定转码任务获取请求的转码服务器从所述控制中心处获得需在所述转码任务获取周期内执行的转码任务并进行处理。 [0065] Step 103 will be assigned the task of acquiring the read lock request is sent to the control center, so that the transcoding server transmits the acquisition request to the particular transcoding task registration node from said control center obtained transcoding task needs to be performed within the transcoding process and a task acquisition period.

[0066] 在步骤103中,所述读写锁具体为分布式锁,其数量为一个,所述注册节点只有在含有所述特定转码任务获取请求时才被分配该分布式锁(只有该节点获得了该分布式锁),在本实施例中,所述分布式锁由所述控制中心分配。 [0066] In step 103, the write lock is specifically distributed lock, which is a number, the registered nodes only contain the specific transcoding tasks are allocated when requested acquisition of the distributed lock (only the node obtains the distributed lock), in this embodiment, the distributed lock allocated by the control center. 所述注册节点获得该分布式锁后,即是将所述分布式锁与发出请求的所述转码服务器或转码进程进行绑定,同时删除其他注册节点或该节点收到的所有转码任务获取请求。 After obtaining the registration nodes of the distributed lock, that is, the lock and the distributed transcoding server requesting or transcoding process to bind, delete all other registered or transcoding nodes of the node received task acquisition request.

[0067] 需要说明的是,分布式锁,是控制分布式系统之间同步访问共享资源的一种方式。 [0067] Incidentally, distributed lock, is a way of synchronizing access to shared resources among distributed control system. 在分布式系统中,尤其对于视频网站服务端的分布式转码系统,资源共享端需要协调不同的获取端的同步访问操作。 In distributed systems, especially for distributed video website server transcoding systems, resource sharing side need to get synchronized access to harmonize the different end of the operation. 如果不同的系统或是同一个系统的不同主机之间共享了一个或一组资源,那么对于访问这些资源的获取端来说,就需要分布式锁的互斥特性来防止彼此干扰从而保证资源的一致性。 If a shared or a set of resources between different systems or different hosts the same system, then get access to these resources end, it needs to exclusive characteristic of a distributed lock to prevent interference with each other so as to ensure resources consistency.

[0068] 在本实施例中,所述控制中心,一般是将生成的转码队列存储于mongodb (分布式文档存储数据库)中,由于该数据库本身的特性限制,不能对存储于该数据库中的转码队列生成分布式锁,那么,对于数量巨大的转码任务,多台转码服务器极有可能进行多次重复的转码操作,从而也会导致转码资源的严重浪费,延误转码系统的转码处理进度。 [0068] In the present embodiment, the control center, is typically generated transcoding queue stored in MongoDB (distributed document storage database), due to the nature of the limitations of the database itself, not stored in the database distributed generation transcoding queue lock, then, for the huge amount of transcoding tasks, multiple transcoding server is likely to be repeated transcoding operations, which can lead to serious waste of resources, transcoding, delay transcoding system transcoding process progress. 所以,采用设置所述注册节点以获得分布式锁的方式,对多个所述转码服务器进行管理,克服了mongodb的特性限制。 Therefore, using the registration node disposed in a distributed manner to obtain a lock, a plurality of the transcoding server to manage to overcome the limitations characteristic of mongodb.

[0069] 实施例二 [0069] Second Embodiment

[0070] 如图2所示,为本申请实施例二所述的一种基于分布式锁的转码任务获取的方法,该方法包括: [0070] 2, a two-oriented application method described in Example distributed lock transcoding task based on the acquired, the method comprising:

[0071] 步骤201,由控制中心创建的注册节点接收转码服务器在转码任务获取周期内发送的转码任务获取请求。 [0071] Step 201, registered nodes created by the control center receives a transcoding server transcoding jobs transmitted within the transcoding task acquisition request acquisition period.

[0072] 其中,所述转码任务获取周期,具体为周期时长为至少I秒的获取转码任务的周期,即该转码任务获取周期就是各所述转码服务器发送所述转码任务获取请求至所述注册节点,获取所述分布式锁的周期。 [0072] wherein the transcoding task acquisition period, to obtain particularly long transcoding tasks second period is at least I, i.e., the transcoding task acquisition cycle period of each of the transcoding is the transcoding server transmitting a task acquisition registration request to the node, the distributed lock acquisition period.

[0073] 另外,对于步骤201,在有多个所述注册节点的情况下,为了便于对不同的所述注册节点的监测管理,可以针对每一个所述注册节点设置对应的编号。 [0073] Further, for the step 201, when a plurality of nodes of the registration situation, in order to facilitate monitoring and management of the different registration node may be provided for each of a number corresponding to the registration node. 当然,在本实施例中,还可以采用其他方式对所述注册节点进行监测管理,上述内容并不构成对本申请的限定。 Of course, in the present embodiment may also be other ways of monitoring the registration management node, the above do not limit the present disclosure. [0074] 步骤202,在确定出所述注册节点在所述转码任务获取周期内接收的所有转码任务获取请求中不包含最早被发送至转码系统中的注册节点的转码任务获取请求或所述转码系统中级别最高的转码服务器发送的转码任务获取请求时,删除在所述转码任务获取周期内接收到的所有转码任务获取请求; [0074] Step 202, the transcoding task of acquiring all of the determined registration node received within the transcoding task acquisition request does not include the first period is transmitted to the transcoding task of the transcoding system acquisition request of registered nodes or transcoding system the highest level of transcoding task acquisition request sent by the server to delete all of the transcoding transcoding tasks received within the transcoding task acquisition period obtaining request;

[0075] 在确定出所述注册节点在所述转码任务获取周期内接收的所有转码任务获取请求中包含最早被发送至转码系统中的注册节点的转码任务获取请求或所述转码系统中级别最高的转码服务器发送的转码任务获取请求时,为所述特定转码任务获取请求分配读写锁。 [0075] comprising a first acquisition request is transmitted to the transcoding task of the transcoding system acquisition request of registered nodes of all tasks is determined that transcoding node receiving the registration in the transcoding task acquisition period or the revolutions transcoding task code system the highest level of transcoding server transmitting the acquisition request for acquiring the particular transcoding tasks assigned read-write lock request.

[0076] 其中,所述特定转码任务获取请求是在所述转码任务获取周期内最早被发送至转码系统中的注册节点的转码任务获取请求;或者,所述特定转码任务获取请求是所述转码系统中级别最高的转码服务器发送的转码任务获取请求;所述转码系统为所述注册节点所属的转码系统,且所述转码系统至少包含一个注册节点;转码服务器的所述级别是根据转码服务器的属性信息预先设置的。 [0076] wherein the specific transcoding task is the first acquisition request is transmitted to the transcoding task of the transcoding system acquisition request of registered nodes within the transcoding task acquisition period; or the particular acquisition transcoding tasks transcoding task request the transcoding system the highest level of transcoding server sends the obtaining request; the transcoding system of transcoding system node belongs to the registration, and the transcoding system comprises at least one node registered; the level transcoding server is transcoding server according to attribute information set in advance.

[0077] 在本实施例中,当所述转码系统中包含至少两个注册节点时,所述注册节点接收转码服务器在转码任务获取周期内发送的转码任务获取请求后,需要确定所有所述注册节点接收的所述转码任务获取请求的时间先后顺序,即还包括: Transcoding Task [0077] In the present embodiment, when the transcoding system comprises at least two registration node, the node receiving registration server sends transcoded within transcoding task acquisition period after the acquisition request is determined chronologically all the nodes receiving the registration transcoding task acquisition request, i.e., further comprising:

[0078] 所述注册节点将所述所有转码任务获取请求和相应的接收时间戳发送给所述转码系统中的其他注册节点,并接收所述其他注册节点发送的、由所述其他注册节点在所述转码任务获取周期接收到的所有转码任务获取请求和相应的接收时间戳; [0078] The registration node transcoding tasks of all the other registration node acquiring the transcoding system and the request sent to the respective received time stamps, and the other receiving node sends the register, register by the other node in the transcoding task acquisition period all the received acquisition request transcoding tasks and a corresponding receiver time stamp;

[0079] 所述注册节点根据所述注册节点在所述转码任务获取周期接收到的所有转码任务获取请求的接收时间戳,以及所述其他注册节点在所述转码任务获取周期接收到的所有转码任务获取请求的接收时间戳,按照接收时间由先至后的顺序,对所述注册节点在所述转码任务获取周期接收到的所有转码任务获取请求以及所述其他注册节点在所述转码任务获取周期接收到的所有转码任务获取请求进行排序; [0079] The registration node based on the received registration node acquiring the transcoding task period all transcoding task acquisition request receiving time stamp, and said other node receives the registration in the transcoding task acquisition period All transcoding task acquisition request receiving time stamp, the order of acquisition time of reception of the registered post-rock at the transcoding node transcoding tasks of all the task period and the received acquisition request to the other node registration in the transcoding task acquisition period all the received transcoding tasks request acquisition sorting;

[0080] 当确定排列在第一位的转码任务获取请求为所述注册节点所接收的转码任务获取请求时,确定所述注册节点在所述转码任务获取周期内接收的所有转码任务获取请求中包含所述特定转码任务获取请求; [0080] When it is determined in the first place arranged transcoding task acquisition request transcoding task registration node received the acquisition request receiving node determines the registration in the transcoding task acquisition period all transcoding task acquiring request contains the acquiring request specific transcoding tasks;

[0081] 当确定排列在第一位的转码任务获取请求不是所述注册节点所接收的转码任务获取请求时,确定所述注册节点在所述转码任务获取周期内接收的所有转码任务获取请求中不包含所述特定转码任务获取请求。 [0081] When determining the arrangement of an acquisition request transcoding task is not the transcoding task registration acquisition request received by the node, determining a node receives all the transcoded registered in the transcoding task acquisition period a task acquisition request does not include the particular transcoding task acquisition request.

[0082] 步骤203,将被分配了所述读写锁的任务获取请求发送给控制中心,以使得向所述注册节点发送所述特定转码任务获取请求的转码服务器从所述控制中心处获得需在所述转码任务获取周期内执行的转码任务并进行处理。 [0082] Step 203 will be assigned the task of acquiring the read lock request is sent to the control center, so that the transcoding server transmits the acquisition request to the particular transcoding task registration node from said control center obtained transcoding task needs to be performed within the transcoding process and a task acquisition period.

[0083] 在本实施例中的另一种方式,还包括: [0083] In another embodiment of the present embodiment, further comprising:

[0084] 所述注册节点将所述所有转码任务获取请求和相应的接收时间戳发送给所述转码系统中的控制中心; [0084] The registration node transcoding tasks of all the control center acquires the transcoding system and the request sent to the respective received time stamps;

[0085] 所述注册节点接收所述控制中心发送的关于转码任务获取请求优先级的通知消息;其中,所述通知消息是所述控制中心根据所述转码系统中的各注册节点在所述转码任务获取周期接收到的所有转码任务获取请求的接收时间戳,按照接收时间由先至后的顺序,对所述各注册节点在所述转码任务获取周期接收到的所有转码任务获取请求进行排序后发送的; [0085] The node receiving the registration control center sends the acquisition request regarding transcoding task priority notification message; wherein the notification message is the control center according to the respective nodes registered in the transcoding system of the said transcoding task acquisition period all the received transcoding task acquisition request receiving time stamp, all acquisition period received by the reception time transcoding according to the order of the respective registration node-rock in the transcoding task task acquisition request after sorting;

[0086] 在解析出所述通知消息表示对所述各注册节点在所述转码任务获取周期接收到的所有转码任务获取请求进行排序后,排列在第一位的转码任务获取请求为所述注册节点所接收的转码任务获取请求时,确定所述注册节点在所述转码任务获取周期内接收的所有转码任务获取请求中包含所述特定转码任务获取请求; [0086] After parsing the notification message indicates the transcoding task acquisition period received by all the nodes registered for each transcoding tasks request acquisition for sorting the arrangement of the first acquisition request for the transcoding tasks the registration node transcoding jobs received acquisition request, determines all the nodes registered transcoding tasks received within the transcoding task acquisition period obtaining request including the particular transcoding task acquisition request;

[0087] 在解析出所述通知消息表示对所述各注册节点在所述转码任务获取周期接收到的所有转码任务获取请求进行排序后,排列在第一位的转码任务获取请求不是所述注册节点所接收的转码任务获取请求时,确定所述注册节点在所述转码任务获取周期内接收的所有转码任务获取请求中不包含所述特定转码任务获取请求。 [0087] After parsing the notification message indicates the registration node of each received in the transcoding task acquisition period obtaining request all transcoding tasks sorts arranged acquisition request of a task is not transcoding the registration node transcoding jobs received acquisition request, the receiving node determines the registration in the transcoding task acquisition period all transcoding task acquisition request does not include the particular transcoding task acquisition request.

[0088] 其中,所述属性信息包括下述信息的一种或多种:额定负载信息;CPU处理能力信息;内存大小的信息;与所述控制中心之间的数据传输链路的带宽信息。 [0088] wherein the attribute information includes one or more of the following information: information on the rated load; the CPU processing capability information; memory size information; bandwidth information and the control data transmission link between the centers.

[0089] 另外,在本实施例中,监测到设置有分布式锁的注册节点所对应的所述转码服务器将转码任务处理完成时,解除该注册节点中的所述分布式锁,该注册节点可以继续接收其他所述转码服务器发送的所述请求信息。 [0089] Further, in the present embodiment is provided with the monitored nodes distributed lock register corresponding to the transcoding server transcoding task processing is completed, releases the lock of the distributed registration node, the Register node may continue to receive the other of said transcoding server request information transmitted.

[0090] 需要说明的是,在本实施例中,所述转码服务器或转码线程在接收到所述控制中心预置的任务处理指令后,便可以进行相应的任务处理操作,任务处理的状态实时反映到该注册节点中,为了避免其他转码服务器或转码进程的等待状态造成转码资源的浪费,所以,任务处理完成,无论处理成功还是失败,都将所述分布式锁解除,其中,所述转码任务处理成功,进一步为所述转码任务处理完成后生成视频成品;所述转码任务处理失败,进一步为所述转码任务处理完成后未生成视频成品。 [0090] Incidentally, in the present embodiment, the transcoding server or transcode thread after receiving the command center controlled by the duty preset, it may be appropriate task processing operations, processing tasks to reflect the real-time state registration node, in order to avoid other transcoding server or wait state transcoding transcoding process the waste of resources, so tasking is completed, regardless of treatment success or failure, will be distributed lock the lift, wherein the transcoding task processing is successful, generates a video is finished after the completion of further processing the transcoding task; the transcoding task processing failed, further processing is not generated after the completion of the finished video transcoding tasks.

[0091] 可以将设置有所述分布式锁的注册节点上形成相应的标识(在此对标识的种类和标识的形成方法不进行限定,当然也可以采用其他的方式),从而,具有标识的所述注册节点就表明设置了所述分布式锁,在重新设置所述分布式锁时,将带有所述标识的注册节点排除,未设置有所述分布式锁的注册节点接续接收所述转码服务器发送的所述请求信息。 [0091] The nodes may be provided on the registration of the distributed lock is formed with a corresponding identifier (here identifying the kind and forming method is not limited in the identification, of course, other methods may be used), so that, with an identification of the registration node is provided to show that the distributed lock, when the distributed lock resetting the register with the node identification of said excluded, is not provided with a register of the node receiving the distributed lock connection the transcoding server request information transmitted.

[0092] 实施例三 [0092] Example three

[0093] 下面结合图3和4,对所述基于分布式锁的转码任务获取的方法的具体应用进行详细说明: [0093] below with reference to FIGS. 3 and 4, a specific application of the method of distributed lock acquiring the transcoding task will be described in detail based on:

[0094] 设定:在如图3所示的转码系统中,转码服务器I至4从所述控制中心获取相应的转码任务进行转码处理。 [0094] is set: In the transcoding system as shown in FIG. 3, transcoding server I 4 from the control center to obtain the corresponding transcoding transcoding tasks.

[0095] 基于分布式锁的转码任务获取的过程为: [0095] distributed lock transcoding process based on the acquired task is:

[0096] 步骤一,如图3所示,转码任务获取周期内,由控制中心创建的不同的注册节点接收与该注册节点对应的转码服务器I至4发送的请求信息。 [0096] Step a, as shown, the transcoding task acquisition cycle 3, different registration node created by the control center receives the register corresponding to the node I to the transcoding server 4 to request information.

[0097] 步骤二,各所述注册节点确定其接收的所述转码任务获取请求中是否包含所述特定转码任务获取请求,当然,也可以由所述控制中心监测确定,确定出145号注册节点中包含所述特定转码任务获取请求最先接收到该请求信息(所述特定转码任务获取请求是在所述转码任务获取周期内最早被发送至注册节点的转码任务获取请求,该特定转码任务获取请求由转码服务器I发送)。 [0097] Step two, each node determines that the registration received the transcoding task acquiring request contains the acquiring request specific transcoding tasks, of course, determined by the control center may be monitored by determining the number 145 Register node contains the particular transcoding task acquisition request receiving the first request information (the specific transcoding task acquisition request is the first request is acquired within the transcoding task is sent to the registered nodes acquisition period transcoding tasks the particular transcoding task acquisition request transmitted from the transcoding server I).

[0098] 步骤三,将所述分布式锁分配在145号注册节点中的特定转码任务获取请求,并指示该145号注册节点对应的转码服务器I对转码任务处理,同时,删除其他注册节点收到的转码服务器2至4所述转码任务获取请求。 [0098] Step three, the distributed lock register 145 partitioned nodes particular transcoding task acquisition request, and indicating that the node number register 145 corresponding to a transcoding server I transcoding process task, and deleting other Register node receives transcoding server 2 to 4, the transcoding task acquisition request.

[0099] 当然,控制中心可以实时监测145号注册节点中所述特定转码任务获取请求所对应的所述转码服务器I对转码任务的处理状态,任务处理完成,解除145号注册节点中的所述分布式锁。 [0099] Of course, the control center may monitor in real time the number of registered nodes 145 specific transcoding task acquisition request corresponding to said transcoding server process state I transcoding tasks, task processing is completed, releasing node registration No. 145 the distributed lock. 其中,所述任务处理成功,具体为转码任务处理完成后生成视频成品;所述任务处理失败,具体为转码任务处理完成后未生成视频成品。 Wherein said task processing is successful, particularly after the completion of the finished product to generate a video transcoding task processing; failure of the task processing, particularly for the transcoding task processing is not generated after the completion of the finished video.

[0100] 具体地: [0100] In particular:

[0101] 对于步骤一,如图3所示,转码服务器I至4分别将转码处理请求发送至控制中心创建的多个所述注册节点。 [0101] For a step, as shown in FIG transcoding server I to 4 3, respectively transcoding request to register the plurality of nodes created by the control center. 当然,在实际应用中,所述转码系统中包括几十或上百台服务器,图3为了便于说明只示出4台,并不构成对本申请的限定。 Of course, in practical applications, the transcoding system includes tens or hundreds of servers, for convenience of explanation in FIG. 3 shows only four, do not limit the present disclosure.

[0102] 为了便于对不同的所述注册节点的监测管理,该控制中心针对每一个所述注册节点设置对应的编号(本实施例中以阿拉伯数字进行编号),便于对所述分布式锁进行分配时,在本实施例中将该分布式锁指定分配于其中的一个所述注册节点中(如图4所示,将所述分布式锁分配于145号注册节点中)。 [0102] In order to facilitate the monitoring and management of different registration node, the control center for each of the registered node is provided corresponding to the number of (in this embodiment are numbered with Arabic numerals), for facilitating the distributed lock assigning, in the present embodiment, the distributed lock the embodiment specifies a partitioned register in which the node (shown in Figure 4, the distributed lock partitioned registration node 145).

[0103] 对于步骤二,转码服务器I至4共同向多个所述注册节点发出请求信息,按照时间先后的顺序,所述转码服务器I所发出的所述请求信息最先被145号注册节点接收。 [0103] For step two, transcoding server I to 4 common to a plurality of nodes requesting the registration information, in chronological order, and the transcoding server issued the request information I is registered first 145 node receives.

[0104] 所以,对于步骤三来说,如图4所示,此时,将所述分布式锁分配给该145号注册节点同时,所述控制中心指示所述转码服务器I对所述转码任务处理,该转码服务器I便可以进行转码任务的处理。 [0104] Therefore, for step three, as shown in FIG At this time, the distributed lock allocated to the node 145 while registered, the control center 4 indicating the transcoding server forwarding the I code-tasking, the transcoding server I will be able to process transcoding tasks.

[0105] 在图4中,146号注册节点接收了转码服务器2发出的请求信息,但是,由于该146号注册节接收的所述转码服务器2发出的请求信息晚于所述145号注册节点,所以,146号注册节点并未分配所述分布式锁,即转码服务器2并不能进行转码任务的处理。 [0105] In Figure 4, node 146 receives the registration request message sent by the transcoding server 2, however, due to the late request information registration section 146 received the transcoding server 2 is sent to the register 145 node, so that node 146 is not registered in the distributed allocation lock, i.e., transcoding server 2 and can not be processed transcoding tasks.

[0106] 另外,为了避免其他转码服务器的等待状态造成转码资源的浪费,无论所述转码服务器I所处理的转码任务是否成功,只要该转码任务处理完成(可能失败),都将145号注册节点中的所述分布式锁进行解除,解除该分布式锁后,145号注册节点可以再接收所述转码服务器发送的所述请求信息。 [0106] In addition, in order to avoid a wait state other transcoding servers wasted transcoding resources, whether the transcoding server transcoding tasks I dealt with success, as long as the transcoding task processing is complete (may fail), both the DLM 145 of registered nodes were released after releasing the distributed lock, node 145 may then register the transcoding server receiving the transmission request information.

[0107] 实施例四 [0107] Fourth Embodiment

[0108] 本申请实施例四中所述的一种针对转码服务升级处理的系统,可以设置于所述注册节点内部,也可以设置于所述注册节点外部并与该注册节点相耦接,本实施例中,如图5所示,该系统设置于所述注册节点内,与注册节点、转码服务器以及控制中心相耦接,该系统包括:接收单元501、识别处理单元502和获取单元503,其中, [0108] This application is one of four for the embodiment according to Example transcoding service upgrade processing system may be provided to the internal node registration, registration node may be provided to the external and the register coupled to the node, in this embodiment, shown in Figure 5, the system is provided in the node registration, and registration node, transcoding server and is coupled to the control center, the system comprising: a receiving unit 501, recognition unit 502 and the processing unit acquires 503, which,

[0109] 所述接收单元501,与所述注册节点、转码服务器以及识别处理单元502相耦接,用于指示所述注册节点接收所述转码服务器在转码任务获取周期内发送的转码任务获取请求。 [0109] The receiving unit 501, the registration node, transcoding server and an identification processing unit 502 coupled for rotation of the registration node indicating the transcoding server receiving transmitted within the transcoding task acquisition period code task acquisition request.

[0110] 所述识别处理单元502,与所述接收单元501和获取单元503相耦接,用于 [0110] The identification processing unit 502, the receiving unit 501 and access unit 503 coupled to, for

[0111] 确定出所述注册节点在所述转码任务获取周期内接收的所有转码任务获取请求中不包含特定转码任务获取请求时,删除所述注册节点在所述转码任务获取周期内接收到的所有转码任务获取请求; When the [0111] determined that all the registered node transcoding tasks received within the transcoding task acquisition period obtaining request does not contain the acquiring request specific transcoding jobs, deleting the node registration period acquiring the transcoding task all the received acquisition request transcoding tasks;

[0112] 确定出所述注册节点在所述转码任务获取周期内接收的所有转码任务获取请求中包含所述特定转码任务获取请求时,为所述特定转码任务获取请求分配读写锁。 When the [0112] determined that all the registered node transcoding tasks received within the transcoding task acquisition period obtaining request including the particular transcoding task acquisition request for acquiring the particular transcoding tasks requesting allocation reader lock.

[0113] 其中,所述特定转码任务获取请求是在所述转码任务获取周期内最早被发送至转码系统中的注册节点的转码任务获取请求;或者,所述特定转码任务获取请求是所述转码系统中级别最高的转码服务器发送的转码任务获取请求;所述转码系统为所述注册节点所属的转码系统,且所述转码系统至少包含一个注册节点;转码服务器的所述级别是根据转码服务器的属性信息预先设置的。 [0113] wherein the specific transcoding task is the first acquisition request is transmitted to the transcoding task of the transcoding system acquisition request of registered nodes within the transcoding task acquisition period; or the particular acquisition transcoding tasks transcoding task request the transcoding system the highest level of transcoding server sends the obtaining request; the transcoding system of transcoding system node belongs to the registration, and the transcoding system comprises at least one node registered; the level transcoding server is transcoding server according to attribute information set in advance.

[0114] 所述获取单元503,与所述识别处理单元502、控制中心相耦接,用于将所述注册节点中被分配了所述读写锁的任务获取请求发送给所述控制中心,以使得向所述注册节点发送所述特定转码任务获取请求的转码服务器从所述控制中心处获得需在所述转码任务获取周期内执行的转码任务并进行处理。 [0114] The acquisition unit 503, the recognition processing unit 502, coupled to the control center, for the registration node is assigned the task of acquiring the read lock request is sent to the control center, so that the transmission of the particular task to a transcoding node acquisition request to the registration server obtains transcoding transcoding task needs to be performed within the transcoding task acquisition period from the control center and processed.

[0115] 在本实施例中,所述控制中心可以是具有统一数据管理能力的服务器或相应装置,该控制中心可以在其内部创建多个注册节点,也可以在转码系统中通过代理服务器创建多个注册节点,当然,所述控制中心也可以采用其他方式创建不同的注册节点,并不构成对本申请的限定。 [0115] In the present embodiment, the control center may be a data server or a corresponding device unified management, the control center may create multiple nodes in its internal register can also be created by transcoding proxy system a plurality of registration node, of course, the control center may also be used in other ways to create different registration node, do not limit the present disclosure. 其中,所述注册节点的数量与该转码系统中的转码服务器或其转码进程的数量相适应。 Wherein the transcoding server, or the number of transcoding node processes the registration number of the transcoding system to adapt.

[0116] 需要说明的是,所述控制中心创建多个所述注册节点,为了便于对不同的所述注册节点的监测管理,可以针对每一个所述注册节点设置对应的编号。 [0116] Incidentally, the control center to create a plurality of the registered nodes, in order to facilitate monitoring and management of the different registration node may be provided for each of a number corresponding to the registration node. 当然,在本实施例中,该系统还可以采用其他方式进行监测管理,设置所述上述内容并不构成对本申请的限定。 Of course, in the present embodiment, the system may also employ other means monitoring and management, provided the above do not limit the present disclosure.

[0117] 对于识别处理单元502,由所述控制中心创建的多个所述注册节点接收来自不同所述转码服务器或转码线程发出的转码任务获取请求,多个所述转码任务获取请求随机地发送到不同的所述注册节点中,形成“抢节点”的过程。 [0117] For the recognition processing unit 502, receives the transcoding server different from or transcoding transcoding task acquisition request issued by the thread of the plurality of the registration control node created by the center, a plurality of the transcoding task acquisition request sent randomly to the different nodes in the registration, the formation of "grab nodes". 在多个所述转码任务获取请求被所述注册节点接收的过程中,各所述转码任务获取请求被所述注册节点接收的时间不相同,有先后之分,所以,所述识别处理单元502,将在所述转码任务获取周期内最早被发送至转码系统中的注册节点的转码任务获取请求作为所述特定转码任务获取请求;另外,各所述转码任务获取请求中也含有不同的转码服务器的级别信息,所以,所述识别处理单元502,也可以将所述转码系统中级别最高的转码服务器发送的转码任务获取请求作为所述特定转码任务获取请求。 A plurality of tasks in the transcoding node acquisition request is received by the registration process, each of the transcoding task acquisition request is received the registration node is not the same time, there has points, so the identification process unit 502, the first to be transmitted to the transcoding system transcoding tasks of the acquisition request of registered nodes as the specific transcoding task acquisition request within the transcoding task acquisition period; Further, each of the transcoding task acquisition request also contains information of different levels of transcoding server, so that the recognition processing unit 502, the transcoding task is also the highest level in the transcoding system transcoding server transmitting a request may be acquired as the specific transcoding tasks acquisition request. 当然,对于所述特定转码任务获取请求的划分,还可以是其他类型或方式,并不构成对本申请的限定。 Of course, a request for obtaining said specific division transcoding tasks, or may be other types of embodiment, not intended to limit the present disclosure.

[0118] 在本实施例中,当所述转码系统中包含至少两个注册节点时,所述注册节点接收转码服务器在转码任务获取周期内发送的转码任务获取请求后,所述识别处理单元502,还用于: Transcoding Task [0118] In the present embodiment, when the transcoding system comprises at least two registration node, the node receiving registration server sends transcoded within transcoding task after the acquisition period obtaining request, the recognition processing unit 502 is further configured to:

[0119] 将一所述注册节点中所有转码任务获取请求和相应的接收时间戳发送给所述转码系统中的其他注册节点,并指示该注册节点接收所述其他注册节点发送的、由所述其他注册节点在所述转码任务获取周期接收到的所有转码任务获取请求和相应的接收时间戳; [0119] sending the registration node in a Transcoding all tasks request acquisition and receiving timestamp corresponding to other nodes registered in the transcoding system, and instructs the registration of the other node registration node receives transmitted by Get all the other nodes registered transcoding task period received at the transcoding task acquisition request and a corresponding receiver time stamp;

[0120] 根据所述注册节点在所述转码任务获取周期接收到的所有转码任务获取请求的接收时间戳,以及所述其他注册节点在所述转码任务获取周期接收到的所有转码任务获取请求的接收时间戳,按照接收时间由先至后的顺序,对所述注册节点在所述转码任务获取周期接收到的所有转码任务获取请求以及所述其他注册节点在所述转码任务获取周期接收到的所有转码任务获取请求进行排序; [0120] receiving time stamp according to the registration node acquiring the transcoding task period all the received transcoding task acquisition request, and the other nodes registered in the transcoding task acquisition period all the received transcoding receive timestamp task acquisition request, acquires a reception time according to the order of the registered-rock at the transcoding node all transcoding task duty cycle of the received obtaining request and the other nodes registered in the turn task code acquisition period all the received transcoding tasks request acquisition sorting;

[0121]当确定排列在第一位的转码任务获取请求为所述注册节点所接收的转码任务获取请求时,确定所述注册节点在所述转码任务获取周期内接收的所有转码任务获取请求中包含所述特定转码任务获取请求; [0121] When it is determined in the first place arranged transcoding task acquisition request transcoding task registration node received the acquisition request receiving node determines the registration in the transcoding task acquisition period all transcoding task acquiring request contains the acquiring request specific transcoding tasks;

[0122] 当确定排列在第一位的转码任务获取请求不是所述注册节点所接收的转码任务获取请求时,确定所述注册节点在所述转码任务获取周期内接收的所有转码任务获取请求中不包含所述特定转码任务获取请求。 [0122] When determining the arrangement of an acquisition request transcoding task is not the transcoding task registration acquisition request received by the node, determining a node receives all the transcoded registered in the transcoding task acquisition period a task acquisition request does not include the particular transcoding task acquisition request.

[0123] 在本实施例中的另一种情况下, [0123] In the present embodiment the case in the other,

[0124] 所述识别处理单元502,还用于: [0124] The identification processing unit 502 is further configured to:

[0125] 将所述注册节中所述所有转码任务获取请求和相应的接收时间戳发送给所述转码系统中的控制中心; [0125] The registration section transmits the acquisition request all transcoding tasks and the respective receiving time stamp to the control center the transcoding system;

[0126] 接收所述控制中心发送的关于转码任务获取请求优先级的通知消息;其中,所述通知消息是所述控制中心根据所述转码系统中的各注册节点在所述转码任务获取周期接收到的所有转码任务获取请求的接收时间戳,按照接收时间由先至后的顺序,对所述各注册节点在所述转码任务获取周期接收到的所有转码任务获取请求进行排序后发送的; [0126] The control center receives the transmission request regarding transcoding task priority acquiring notification message; wherein the notification message is a control center according to the respective nodes registered in the transcoding system, the transcoding task acquisition period all the received transcoding tasks receive timestamp acquisition request, acquires a reception time according to the order of the respective registered-rock at the transcoding node all transcoding task duty cycle of the received acquisition request after ordering transmission;

[0127] 在解析出所述通知消息表示对所述各注册节点在所述转码任务获取周期接收到的所有转码任务获取请求进行排序后,排列在第一位的转码任务获取请求为所述注册节点所接收的转码任务获取请求时,确定所述注册节点在所述转码任务获取周期内接收的所有转码任务获取请求中包含所述特定转码任务获取请求; [0127] After parsing the notification message indicates the transcoding task acquisition period received by all the nodes registered for each transcoding tasks request acquisition for sorting the arrangement of the first acquisition request for the transcoding tasks the registration node transcoding jobs received acquisition request, determines all the nodes registered transcoding tasks received within the transcoding task acquisition period obtaining request including the particular transcoding task acquisition request;

[0128] 在解析出所述通知消息表示对所述各注册节点在所述转码任务获取周期接收到的所有转码任务获取请求进行排序后,排列在第一位的转码任务获取请求不是所述注册节点所接收的转码任务获取请求时,确定所述注册节点在所述转码任务获取周期内接收的所有转码任务获取请求中不包含所述特定转码任务获取请求。 [0128] After parsing the notification message indicates the registration node of each received in the transcoding task acquisition period obtaining request all transcoding tasks sorts arranged acquisition request of a task is not transcoding the registration node transcoding jobs received acquisition request, the receiving node determines the registration in the transcoding task acquisition period all transcoding task acquisition request does not include the particular transcoding task acquisition request.

[0129] 其中,所述属性信息包括下述信息的一种或多种:额定负载信息; [0129] wherein the attribute information comprises one or more of the following information: information on the rated load;

[0130] CPU处理能力信息;内存大小的信息;与所述控制中心之间的数据传输链路的带宽信息。 [0130] CPU processing capability information; memory size information; and a data transmission link bandwidth information between the control center.

[0131] 由所述识别处理单元502所分配的读写锁具体为分布式锁,其数量为一个,根据针对所述注册节点的优先级的排序判定为优先级最高的所述注册节点,被分配该分布式锁(只有该节点获得了该分布式锁),在本实施例中,所述分布式锁由所述控制中心分配。 [0131] by the recognition processing unit 502 write lock allocated specifically for distributed lock, which is a number, it is determined that the highest priority according to the priority register node for sorting the registered node is the distributed allocation lock (only that the node of the distributed lock), in this embodiment, the distributed lock allocated by the control center. 所述注册节点获得该分布式锁后,即是将所述分布式锁与发出请求的所述转码服务器或转码进程进行绑定,同时删除其他注册节点收到的所述请求信息。 After obtaining the registration nodes of the distributed lock, that is, the lock and the distributed transcoding server requesting or transcoding process to bind, delete other node receives the registration request information.

[0132] 另外,在本实施例中,所述获取单元503,还用于监测到设置有分布式锁的注册节点所对应的所述转码服务器将转码任务处理完成时,解除该注册节点中的所述分布式锁,该注册节点可以继续接收其他所述转码服务器发送的所述请求信息。 [0132] Further, in the present embodiment, the acquisition unit 503 is further configured to monitor the registration node is provided with a distributed lock corresponding to the transcoding server when the transcoding task processing is completed, releasing the registered nodes distributed in the lock, the registration of the other node can continue receiving the transcoding request information sent by the server.

[0133] 需要说明的是,所述转码服务器或转码线程在接收到所述控制中心的指示后,便可以进行相应的任务处理操作,任务处理的状态实时反映到该注册节点中,为了避免其他转码服务器或转码进程的等待状态造成转码资源的浪费,所以,任务处理完成,无论处理成功还是失败,都将所述分布式锁解除。 [0133] Incidentally, the transcoding server or transcode thread after receiving an indication of the control center, they can make the appropriate task processing operations, the processing status of the task in real time to reflect the registration node, in order to avoid other transcoding server or wait state transcoding transcoding process the waste of resources, so tasking is completed, regardless of treatment success or failure, will be distributed the lock is released. 其中,具体地,所述转码任务处理成功,具体为所述转码任务处理完成后生成视频成品;所述转码任务处理失败,具体为所述转码任务处理完成后未生成视频成品。 Wherein, in particular, the transcoding task processing success, particularly after the completion of the finished video to generate the transcoding task processing; the transcoding task processing fails, in particular the transcoding task processing is not generated after the completion of the finished video.

[0134] 具体来说,可以将设置有所述分布式锁的注册节点上形成相应的标识(在此对标识的种类和标识的形成方法不进行限定,当然也可以采用其他的方式),从而,具有标识的所述注册节点就表明设置了所述分布式锁,在重新设置所述分布式锁时,将带有所述标识的注册节点排除,未设置有所述分布式锁的注册节点接续接收所述转码服务器发送的所述请求信息。 [0134] Specifically, to form the corresponding set of registration marks on the Distributed Lock node has (in this kind of method for forming the identification ID and not defined, of course, other methods may be used), thereby , a node with an identification register set would indicate the distributed lock, when the distributed lock resetting the register with the node identification of said excluded, is not provided with a register node of the distributed lock connecting said transcoding server receiving the transmission request information.

[0135] 在本实施例中,所述转码任务获取周期,具体为周期时长为至少I秒的获取转码任务的周期,即该转码任务获取周期就是各所述转码服务器发送所述请求信息至所述注册节点,获取所述分布式锁的周期。 [0135] In the present embodiment, the transcoding task acquisition period, to obtain particularly long transcoding tasks second period is at least I, i.e., the transcoding task is acquired each cycle period of the transcoding server transmitting said registration request message to the node, the distributed lock acquisition period.

[0136] 由于方法部分已经对本申请实施例进行了详细描述,这里对实施例中涉及的系统与方法对应部分的展开描述省略,不再赘述。 [0136] Since the method of the Example section of the present application has been described in detail, description thereof is omitted herein to expand the corresponding portions of the system and method according to an embodiment, it is omitted. 对于系统中具体内容的描述可参考方法实施例的内容,这里不再具体限定。 For details of the system described with reference content may embodiment of the method, and is not particularly limited.

[0137] 与现有技术相比,本申请所述的一种基于分布式锁的转码任务获取的方法和系统,达到了如下效果: [0137] Compared with the prior art A method of the present application based on the distributed lock transcoding tasks and acquisition system to achieve the following results:

[0138] I)本申请通过预先设置视频的属性规则对需要转码的视频进行优先级、码率高低的判定,同时根据转码机的性能进行分组,有效解决了目前视频网站的转码机不能根据服务器状态和转码任务属性合理进行转码任务调度的问题。 [0138] I) herein by a video attribute rule is set in advance needs to be transcoded video priority is determined high and low bit rate, while the performance transcoding grouping machine, an effective solution to the current site of the video transcoding machine not reasonably transcoding task scheduling problem in accordance with transcoding server status and task properties.

[0139] 2)本申请可以对不同的转码机进行角色配置,划定不同的转码任务处理对象,尤其对于特定视频转码任务,由划定的特定转码机专门进行处理,从而可以有效保证某些特定任务的快速转码,将重要视频及时发布。 [0139] 2) The application may be different transcoding role configuration unit, designated transcoding task processing different objects, in particular video transcoding for a particular task, processed by a specific transcoding unit designated specifically, can be effectively ensure fast transcoding certain tasks, the timely release of important video.

[0140] 还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者系统不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者系统所固有的要素。 [0140] It is further noted that the term "comprising", "containing" or any other variation thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, goods or not include only those elements of the system, but also includes other elements not explicitly listed, or further includes elements of the process, method, article, or inherent in the system. 在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者系统中还存在另外的相同要素。 Without more constraints, by the wording "include a ......" defined does not exclude the existence of additional identical elements in the element comprising a process, method, product or system.

[0141] 本领域技术人员应明白,本申请的实施例可提供为方法、系统或计算机程序产品。 [0141] Those skilled in the art will appreciate, embodiments of the present disclosure may provide a method, system, or computer program product. 因此,本申请可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。 Accordingly, the present disclosure may be entirely hardware embodiment, an entirely software embodiment or an embodiment in conjunction with the form of software and hardware aspects. 而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。 Further, the present application may take the form of a computer program product embodied in one or more of which comprises a computer usable storage medium having computer-usable program code (including but not limited to, disk storage, CD-ROM, optical memory, etc.).

[0142] 以上所述仅为本申请的实施例而已,并不用于限制本申请。 [0142] The foregoing is only embodiments of the present disclosure, but not intended to limit the present application. 对于本领域技术人员来说,本申请可以有各种更改和变化。 For skilled in the art, the present application may have various modifications and changes. 凡在本申请的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本申请的权利要求范围之内。 Any modifications made within the spirit and principle of the present application, equivalent substitutions, improvements, etc., should be included within the scope of the claims of the present application.

Claims (8)

  1. 1.一种基于分布式锁的转码任务获取的方法,其特征在于,包括: 注册节点接收转码服务器在转码任务获取周期内发送的转码任务获取请求; 在确定出所述注册节点在所述转码任务获取周期内接收的所有转码任务获取请求中不包含特定转码任务获取请求时,删除在所述转码任务获取周期内接收到的所有转码任务获取请求;其中,所述特定转码任务获取请求是在所述转码任务获取周期内最早被发送至转码系统中的注册节点的转码任务获取请求;或者,所述特定转码任务获取请求是所述转码系统中级别最高的转码服务器发送的转码任务获取请求;所述转码系统为所述注册节点所属的转码系统,且所述转码系统至少包含一个注册节点;转码服务器的所述级别是根据转码服务器的属性信息预先设置的; 在确定出所述注册节点在所述转码任务获取周期内接收 1. A method of distributed lock task based on the acquired transcoding, wherein, comprising: a node receiving registration transcoding tasks transcoding server transmitted within the transcoding task acquisition request acquisition period; determination that the registration node when received within the transcoding task acquisition period all transcoding task acquisition request does not include a specific transcoding task acquisition request, deletes all transcoding tasks received within the transcoding task acquisition period obtaining request; wherein, the particular transcoding task is the first acquisition request is transmitted to the transcoding task of the transcoding system of registered nodes acquired in the acquisition request within the transcoding task period; or the particular acquisition request transcoding task is to turn the transcoding task code system the highest level of transcoding server sends the obtaining request; the transcoding system of the transcoding system registration node belongs, and the transcoding system comprises at least one node registered; the transcoding server level is said transcoding server based on the attribute information set in advance; received within the transcoding task acquisition period is determined in the registration node 所有转码任务获取请求中包含所述特定转码任务获取请求时,为所述特定转码任务获取请求分配读写锁; 将被分配了所述读写锁的任务获取请求发送给控制中心,以使得向所述注册节点发送所述特定转码任务获取请求的转码服务器从所述控制中心处获得需在所述转码任务获取周期内执行的转码任务并进行处理。 Transcoding all tasks included in the acquisition request specific transcoding task acquisition request for acquiring the particular transcoding tasks assigned write lock request; to be assigned the task of acquiring the write lock request is sent to the control center, so that the transmission of the particular task to a transcoding node acquisition request to the registration server obtains transcoding transcoding task needs to be performed within the transcoding task acquisition period from the control center and processed.
  2. 2.如权利要求1所述的基于分布式锁的转码任务获取的方法,其特征在于,当所述转码系统中包含至少两个注册节点时,所述注册节点接收转码服务器在转码任务获取周期内发送的转码任务获取请求后,所述方法还包括: 所述注册节点将所述所有转码任务获取请求和相应的接收时间戳发送给所述转码系统中的其他注册节点,并接收所述其他注册节点发送的、由所述其他注册节点在所述转码任务获取周期接收到的所有转码任务获取请求和相应的接收时间戳; 所述注册节点根据所述注册节点在所述转码任务获取周期接收到的所有转码任务获取请求的接收时间戳,以及所述其他注册节点在所述转码任务获取周期接收到的所有转码任务获取请求的接收时间戳,按照接收时间由先至后的顺序,对所述注册节点在所述转码任务获取周期接收到的所有转码任务获取 2. Based on the transcoding tasks distributed lock acquired method according to claim 1, wherein, when the transcoding system comprises at least two registration node, the node receiving registration server in turn transcoding after the code acquisition task transcoding task acquisition request transmission cycle, the method further comprising: the registration of all the transcoding node for additional tasks registered in the transcoding system and the request sent to the respective received time stamps node, the sending and receiving nodes in other registration, received at the transcoding task period acquired by the registration node all transcoding other tasks and respective acquisition request receiving time stamp; according to the registration of the registered node Get all transcoding node duty cycle received in the transcoding task acquisition request receiving time stamp, and the other nodes registered in the transcoding task acquisition period all the received transcoding task acquisition request receiving timestamp , acquiring the transcoding task in the registration by the node according to the received order of the time-rock period all the received transcoding tasks Get 求`以及所述其他注册节点在所述转码任务获取周期接收到的所有转码任务获取请求进行排序; 当确定排列在第一位的转码任务获取请求为所述注册节点所接收的转码任务获取请求时,确定所述注册节点在所述转码任务获取周期内接收的所有转码任务获取请求中包含所述特定转码任务获取请求; 当确定排列在第一位的转码任务获取请求不是所述注册节点所接收的转码任务获取请求时,确定所述注册节点在所述转码任务获取周期内接收的所有转码任务获取请求中不包含所述特定转码任务获取请求。 `Seeking registration node and the other accessories transcoding task period received at the transcoding task to sort acquisition request; determining when arranged in a first transcoding task acquisition request to the registration of the received forwarding node task code acquisition request, the registration determination node received within the transcoding task acquisition period all transcoding tasks obtaining request including the particular transcoding task acquisition request; determining when arranged in a first transcoding tasks acquisition request is not registered the transcoding task acquisition request received by the node, to determine all the tasks registered transcoding node received within the transcoding task acquisition period obtaining request does not include the specific transcoding tasks request acquisition .
  3. 3.如权利要求如权利要求1所述的基于分布式锁的转码任务获取的方法,其特征在于,所述注册节点接收转码服务器在转码任务获取周期内发送的转码任务获取请求后,所述方法还包括: 所述注册节点将所述所有转码任务获取请求和相应的接收时间戳发送给所述转码系统中的控制中心; 所述注册节点接收所述控制中心发送的关于转码任务获取请求优先级的通知消息;其中,所述通知消息是所述控制中心根据所述转码系统中的各注册节点在所述转码任务获取周期接收到的所有转码任务获取请求的接收时间戳,按照接收时间由先至后的顺序,对所述各注册节点在所述转码任务获取周期接收到的所有转码任务获取请求进行排序后发送的; 在解析出所述通知消息表示对所述各注册节点在所述转码任务获取周期接收到的所有转码任务获取请求进行排序后,排列 3. The method claimed in claim distributed lock as claimed in claim transcoding task based on the acquired claim 1 wherein, the transcoding task registration node transcoding server receiving transmitted within the transcoding task acquisition period obtaining request after, the method further comprises: the node registration transcoding tasks of all the acquisition request and the corresponding timestamp to the control center receiving the transcoding system; the registration node receiving the transmitted control center About transcoding task priority acquisition request notification message; wherein the notification message is acquired according to each of the control center to register the node in the transcoding system of the transcoding task acquisition period all the received transcoding tasks receive timestamp request, obtaining a reception time in accordance with the order of the respective registered-rock at the transcoding node all transcoding task duty cycle of the received acquisition request transmitted after sorting; in the parsed after the notification message indicates the registration of each node acquired in the transcoding task period all the received transcoding tasks request acquisition sort arrayed 在第一位的转码任务获取请求为所述注册节点所接收的转码任务获取请求时,确定所述注册节点在所述转码任务获取周期内接收的所有转码任务获取请求中包含所述特定转码任务获取请求; 在解析出所述通知消息表示对所述各注册节点在所述转码任务获取周期接收到的所有转码任务获取请求进行排序后,排列在第一位的转码任务获取请求不是所述注册节点所接收的转码任务获取请求时,确定所述注册节点在所述转码任务获取周期内接收的所有转码任务获取请求中不包含所述特定转码任务获取请求。 Transcoding task acquisition request to the registration node acquisition request received by the first transcoding tasks, transcoding tasks is determined that all the registered node received within the acquisition period transcoding task acquisition request containing the transcoding said specific task acquisition request; in the notification message parsed representation of said respective registration node acquiring the transcoding task period all the received acquisition request transcoding tasks after sorting are arranged in a first turn when the request code is not a task acquiring the transcoding task registration node received the acquisition request, the transcoding task is determined that all the registered node is received within the transcoding task acquisition period obtaining request does not include the specific transcoding tasks acquisition request.
  4. 4.如权利要求3所述的基于分布式锁的转码任务获取的方法,其特征在于,所述属性信息包括下述信息的一种或多种: 额定负载信息; CPU处理能力信息; 内存大小的信息; 与所述控制中心之间的数据传输链路的带宽信息。 CPU processing capability information;; rated load information memory: 4. A method as claimed in transcoding tasks based distributed lock acquired according to claim 3, wherein the attribute information includes one or more of the following information size information; bandwidth control information to the transmission link between the data center.
  5. 5.一种基于分布式锁的转码任务获取的系统,与注册节点、转码服务器以及控制中心相耦接,其特征在于,该系统包括:接收单元、识别处理单元以及获取单元,其中, 所述接收单元,用于指示所述注册节点接收所述转码服务器在转码任务获取周期内发送的转码任务获取请求;` 所述识别处理单元,用于确定出所述注册节点在所述转码任务获取周期内接收的所有转码任务获取请求中不包含特定转码任务获取请求时,删除所述注册节点在所述转码任务获取周期内接收到的所有转码任务获取请求; 确定出所述注册节点在所述转码任务获取周期内接收的所有转码任务获取请求中包含所述特定转码任务获取请求时,为所述特定转码任务获取请求分配读写锁; 其中,所述特定转码任务获取请求是在所述转码任务获取周期内最早被发送至转码系统中的注册节点 A system of distributed lock transcoding task based on the acquired and registered nodes, and the transcoding server coupled to the control center, characterized in that the system comprising: a receiving unit, a recognition processing unit and an acquisition unit, wherein, the receiving unit for transcoding task transcoding server transmitted within the transcoding task acquisition cycle node receives the request for obtaining the registration indication; `out the registration node of the recognition processing unit, for determining the when said transcoding task to get all the received transcoding tasks request acquisition cycle does not include particular transcoding task acquisition request to delete all the registration node transcoding tasks received within the transcoding task acquisition period obtaining request; it is determined that all the registered node transcoding tasks received within the transcoding task acquisition period obtaining request including the particular transcoding task acquisition request for acquiring the particular transcoding tasks assigned read-write lock request; wherein the particular transcoding task is the first acquisition request is transmitted to the transcoding system of registered nodes within the transcoding task acquisition period 转码任务获取请求;或者,所述特定转码任务获取请求是所述转码系统中级别最高的转码服务器发送的转码任务获取请求;所述转码系统为所述注册节点所属的转码系统,且所述转码系统至少包含一个注册节点;转码服务器的所述级别是根据转码服务器的属性信息预先设置的; 所述获取单元,用于将所述注册节点中被分配了所述读写锁的任务获取请求发送给所述控制中心,以使得向所述注册节点发送所述特定转码任务获取请求的转码服务器从所述控制中心处获得需在所述转码任务获取周期内执行的转码任务并进行处理。 Transcoding task acquisition request; or the particular transcoding task acquisition request transcoding is the transcoding task of the highest-level system transcoding server sends the obtaining request; the transcoding system to forwarding the registration node belongs the system code, and the transcoding system comprises at least one node registered; the level of transcoding server is transcoding server according to attribute information set in advance; the acquisition unit to be allocated for the node registration the read-write lock task acquisition request to the control center, so that the transcoding server transmits the acquisition request to the particular transcoding tasks registered in the task node needs to obtain the transcoding from the control center transcoding tasks performed within the acquisition period and processed.
  6. 6.如权利要求5所述的基于分布式锁的转码任务获取的系统,其特征在于,当所述转码系统中包含至少两个注册节点时,所述注册节点接收转码服务器在转码任务获取周期内发送的转码任务获取请求后,所述识别处理单元,还用于: 将一所述注册节点中所有转码任务获取请求和相应的接收时间戳发送给所述转码系统中的其他注册节点,并指示该注册节点接收所述其他注册节点发送的、由所述其他注册节点在所述转码任务获取周期接收到的所有转码任务获取请求和相应的接收时间戳;根据所述注册节点在所述转码任务获取周期接收到的所有转码任务获取请求的接收时间戳,以及所述其他注册节点在所述转码任务获取周期接收到的所有转码任务获取请求的接收时间戳,按照接收时间由先至后的顺序,对所述注册节点在所述转码任务获取周期接收到的所有 6. The system of transcoding based on distributed task acquired lock according to claim 5, wherein, when the transcoding system comprises at least two registration node, the node receiving registration server in turn transcoding after the code acquisition task transcoding task acquisition request transmission cycle, the recognition processing unit is further configured to: register a node to all the transcoding task acquiring the transcoding system and the request sent to the respective received time stamps other nodes in the register, and instructs the registration of the receiving node, received at the transcoding task period acquired by the node to all other registered transcoding tasks acquisition request receiving timestamp and the respective other node registration; according to the received registration node acquiring the transcoding task period all transcoding task acquisition request receiving time stamp, and the other nodes registered in the transcoding task acquisition period all the received acquisition request transcoding tasks receiving timestamp, all the acquisition period received by the reception period after the order of the registered node-rock in the transcoding task 码任务获取请求以及所述其他注册节点在所述转码任务获取周期接收到的所有转码任务获取请求进行排序; 当确定排列在第一位的转码任务获取请求为所述注册节点所接收的转码任务获取请求时,确定所述注册节点在所述转码任务获取周期内接收的所有转码任务获取请求中包含所述特定转码任务获取请求; 当确定排列在第一位的转码任务获取请求不是所述注册节点所接收的转码任务获取请求时,确定所述注册节点在所述转码任务获取周期内接收的所有转码任务获取请求中不包含所述特定转码任务获取请求。 Task code acquisition request and obtain all the other nodes registered transcoding task period received at the transcoding task to sort acquisition request; determining when arranged in a first transcoding task acquisition request is received by the node registration transcoding task acquisition request, the receiving node determines the registration in the transcoding task acquisition period all transcoding tasks obtaining request including the particular transcoding task acquisition request; determining when arranged in a first turn when the request code is not a task acquiring the transcoding task registration node received the acquisition request, the transcoding task is determined that all the registered node is received within the transcoding task acquisition period obtaining request does not include the specific transcoding tasks acquisition request.
  7. 7.如权利要求5所述的基于分布式锁的转码任务获取的系统,其特征在于,所述识别处理单元,还用于: 将所述注册节中所述所有转码任务获取请求和相应的接收时间戳发送给所述转码系统中的控制中心; 接收所述控制中心发送的关于转码任务获取请求优先级的通知消息;其中,所述通知消息是所述控制中心根据所述转码系统中的各注册节点在所述转码任务获取周期接收到的所有转码任务获取请求的接收时间戳,按照接收时间由先至后的顺序,对所述各注册节点在所述转码任务获取周期接收到的所有转码任务获取请求进行排序后发送的; 在解析出所述通知消息表示对所述各注册节点在所述转码任务获取周期接收到的所有转码任务获取请求进行排序后,排列在第一位的转码任务获取请求为所述注册节点所接收的转码任务获取请求时,确定所述注册节点 7. Based on the transcoding tasks distributed lock acquisition system according to claim 5, wherein the recognition processing unit is further configured to: register the transcoding section all the tasks request acquisition and receiving timestamp corresponding to a control center in the transcoding system; receiving the control request regarding transcoding task priority acquiring notification message sent by the center; wherein the notification message is the control center according to the each node registered in the transcoding system of the transcoding task acquisition period all the received transcoding task acquisition request receiving time stamp according to the reception time by the post-rock sequence, each of the nodes registered in the turn after the code acquisition period received task to all tasks transcoding acquisition request sent sorting; in the notification message parsed representation of said respective registration node acquiring the transcoding task period all the received acquisition request transcoding tasks after sorting, the arrangement transcoding task acquisition request registration node received the acquisition request of a transcoding tasks, determines the registration node 在所述转码任务获取周期内接收的所有转码任务获取请求中包含所述特定转码任务获取请求; 在解析出所述通知消息表示对所述各`注册节点在所述转码任务获取周期接收到的所有转码任务获取请求进行排序后,排列在第一位的转码任务获取请求不是所述注册节点所接收的转码任务获取请求时,确定所述注册节点在所述转码任务获取周期内接收的所有转码任务获取请求中不包含所述特定转码任务获取请求。 Received within the transcoding task acquisition period all transcoding task acquisition request contains the acquiring request specific transcoding tasks; in the notification message parsed retrieves the respective nodes registered in `the transcoding task after the cycle all the received acquisition request transcoding tasks sorts arranged acquisition request first transcoding task is not the transcoding task registration acquisition request received by the node, the node determines the registration transcoding receiving a task acquisition cycle all transcoding tasks acquiring request does not include the particular transcoding task acquisition request.
  8. 8.如权利要求7所述的基于分布式锁的转码任务获取的系统,其特征在于,所述属性信息包括下述信息的一种或多种: 额定负载信息; CPU处理能力信息; 内存大小的信息; 与所述控制中心之间的数据传输链路的带宽信息。 8. Based on the transcoding task acquired distributed lock system according to claim 7, wherein the attribute information includes one or more of the following information: information on the rated load; the CPU processing capability information; memory size information; bandwidth control information to the transmission link between the data center.
CN 201310738633 2013-12-26 2013-12-26 Method and system for transcoding task obtaining on basis of distributed locks CN103686224A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201310738633 CN103686224A (en) 2013-12-26 2013-12-26 Method and system for transcoding task obtaining on basis of distributed locks

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201310738633 CN103686224A (en) 2013-12-26 2013-12-26 Method and system for transcoding task obtaining on basis of distributed locks

Publications (1)

Publication Number Publication Date
CN103686224A true true CN103686224A (en) 2014-03-26

Family

ID=50322303

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201310738633 CN103686224A (en) 2013-12-26 2013-12-26 Method and system for transcoding task obtaining on basis of distributed locks

Country Status (1)

Country Link
CN (1) CN103686224A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101083756A (en) * 2007-03-14 2007-12-05 中国科学技术大学 internet based TV stream data real time transmission and service apparatus and method
CN102123279A (en) * 2010-12-28 2011-07-13 乐视网信息技术(北京)股份有限公司 Distributed real-time transcoding method and system
US20110274155A1 (en) * 2010-05-07 2011-11-10 The Board Of Trustees Of The Leland Stanford Junior University Apparatus, system, and method for distributed video transcoding
CN102404567A (en) * 2011-11-03 2012-04-04 深圳市融创天下科技股份有限公司 System and method for transcoding network monitoring video in real time according to need
CN103034739A (en) * 2012-12-29 2013-04-10 天津南大通用数据技术有限公司 Distributed memory system and updating and querying method thereof

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101083756A (en) * 2007-03-14 2007-12-05 中国科学技术大学 internet based TV stream data real time transmission and service apparatus and method
US20110274155A1 (en) * 2010-05-07 2011-11-10 The Board Of Trustees Of The Leland Stanford Junior University Apparatus, system, and method for distributed video transcoding
CN102123279A (en) * 2010-12-28 2011-07-13 乐视网信息技术(北京)股份有限公司 Distributed real-time transcoding method and system
CN102404567A (en) * 2011-11-03 2012-04-04 深圳市融创天下科技股份有限公司 System and method for transcoding network monitoring video in real time according to need
CN103034739A (en) * 2012-12-29 2013-04-10 天津南大通用数据技术有限公司 Distributed memory system and updating and querying method thereof

Similar Documents

Publication Publication Date Title
US20120278473A1 (en) Event Queuing and Distribution System
US20100010999A1 (en) Data Access in Distributed Systems
US20130013654A1 (en) Peer-to-peer redundant file server system and methods
US20060212595A1 (en) Method and computer-readable medium for associating sequence numbers with data blocks for distribution of data in a peer-to-peer network
US20100011003A1 (en) Distributed Data Storage and Access Systems
US9053167B1 (en) Storage device selection for database partition replicas
US7676562B2 (en) Computer system for accessing instrumentation information
US20140165119A1 (en) Offline download method, multimedia file download method and system thereof
CN101969391A (en) Cloud platform supporting fusion network service and operating method thereof
CN102123279A (en) Distributed real-time transcoding method and system
US20100235323A1 (en) Cooperative Grid Based Picture Archiving and Communication System
CN102594852A (en) Data access method, node and system
US20120278344A1 (en) Proximity grids for an in-memory data grid
US9407585B1 (en) Scalable, real-time messaging system
CN201682522U (en) Conversation information storage system and application server
US20130073691A1 (en) File Processing Method, System and Server-clustered System for Cloud Storage
US20130232164A1 (en) Methods and Apparatus for Job State Tracking in Cluster Computing
CN103747112A (en) CDN back-to-source method, first server and system thereof
CN101645928A (en) Content resource caching method, device and system
CN102291416A (en) A method for client and server-side and two-way synchronization system
CN101764839A (en) Data access method and uniform resource locator (URL) server
US20120066400A1 (en) System and method for parallel muxing between servers in a cluster
CN102130959A (en) System and method for scheduling cloud storage resource
US20150234845A1 (en) Subpartitioning of a namespace region
CN103023928A (en) P2P (peer-to-peer) node matching system and method

Legal Events

Date Code Title Description
C10 Entry into substantive examination
C41 Transfer of patent application or patent right or utility model
AD01