[go: up one dir, main page]

CN111752695B - Offline method, device, equipment and storage medium - Google Patents

Offline method, device, equipment and storage medium Download PDF

Info

Publication number
CN111752695B
CN111752695B CN202010599221.0A CN202010599221A CN111752695B CN 111752695 B CN111752695 B CN 111752695B CN 202010599221 A CN202010599221 A CN 202010599221A CN 111752695 B CN111752695 B CN 111752695B
Authority
CN
China
Prior art keywords
deleted
offline
instance
machine
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010599221.0A
Other languages
Chinese (zh)
Other versions
CN111752695A (en
Inventor
唐月明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202010599221.0A priority Critical patent/CN111752695B/en
Publication of CN111752695A publication Critical patent/CN111752695A/en
Application granted granted Critical
Publication of CN111752695B publication Critical patent/CN111752695B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

本申请实施例公开了一种下线方法、装置、设备以及存储介质,涉及计算机、云计算以及音视频处理技术领域。具体实现方案为:确定待下线机器中的多个实例为多个待删除实例;将多个待删除实例记录在预设列表中,其中,预设列表中记录的待删除实例停止获取任务;如果待删除实例不是正在执行任务,则将待删除实例从系统中删除;在待下线机器中的多个待删除实例全部被删除后,将待下线机器从系统中下线。本申请实施例可以降低机器下线对系统服务所造成的影响。

The embodiments of the present application disclose a method, device, equipment and storage medium for going offline, which relate to the fields of computers, cloud computing and audio and video processing technology. The specific implementation scheme is: determine that multiple instances in a machine to be taken offline are multiple instances to be deleted; record the multiple instances to be deleted in a preset list, wherein the instances to be deleted recorded in the preset list stop acquiring tasks; if the instance to be deleted is not executing a task, delete the instance to be deleted from the system; after all the multiple instances to be deleted in the machine to be taken offline are deleted, take the machine to be taken offline offline from the system. The embodiments of the present application can reduce the impact of the machine going offline on the system service.

Description

下线方法、装置、设备以及存储介质Offline method, device, equipment and storage medium

技术领域Technical Field

本申请涉及计算机技术领域,尤其涉及云计算以及音视频处理技术领域。The present application relates to the field of computer technology, and in particular to the field of cloud computing and audio and video processing technology.

背景技术Background Art

在音视频转码系统中,如果机器需要用作它途、故障需维修、老化需下架,当前操作机器下线(也可以称为机器退场)的方式为:暴力删除机器上的多个实例,然后将机器从音视频转码系统中下线。如果此时实例正在处理实时的转码任务,暴力删除的方式会导致该转码任务失败。In the audio and video transcoding system, if a machine needs to be used for other purposes, needs to be repaired due to a fault, or needs to be removed from the shelf due to aging, the current way to operate the machine offline (also known as machine retirement) is to violently delete multiple instances on the machine and then remove the machine from the audio and video transcoding system. If the instance is processing a real-time transcoding task at this time, the violent deletion method will cause the transcoding task to fail.

发明内容Summary of the invention

本申请提供了一种下线方法、装置、设备以及存储介质。The present application provides an offline method, apparatus, device and storage medium.

根据本申请的一方面,提供了一种下线方法,包括:According to one aspect of the present application, a method for going offline is provided, comprising:

确定待下线机器中的多个实例为多个待删除实例;Determine that multiple instances in the machine to be taken offline are multiple instances to be deleted;

将多个待删除实例记录在预设列表中,其中,预设列表中记录的待删除实例停止获取任务;Recording multiple instances to be deleted in a preset list, wherein the instances to be deleted recorded in the preset list stop acquiring tasks;

如果预设列表中记录的待删除实例不是正在执行任务,则将待删除实例从系统中删除;If the instance to be deleted recorded in the preset list is not executing a task, the instance to be deleted will be deleted from the system;

在待下线机器中的多个待删除实例全部被删除后,将待下线机器从系统中下线。After all the instances to be deleted in the machine to be taken offline are deleted, the machine to be taken offline is taken offline from the system.

根据本申请的另一方面,提供了一种下线装置,包括:According to another aspect of the present application, there is provided a offline device, comprising:

实例确定模块,用于确定待下线机器中的多个实例为多个待删除实例;An instance determination module, used for determining that multiple instances in the machine to be taken offline are multiple instances to be deleted;

记录模块,用于将多个待删除实例记录在预设列表中,预设列表中记录的待删除实例停止获取任务;A recording module, used for recording multiple instances to be deleted in a preset list, and stopping the acquisition task for the instances to be deleted recorded in the preset list;

删除模块,用于如果预设列表中记录的待删除实例不是正在执行任务,则将待删除实例从系统中删除;A deletion module, used for deleting the instance to be deleted from the system if the instance to be deleted recorded in the preset list is not executing a task;

下线模块,用于在待下线机器中的多个待删除实例全部被删除后,将待下线机器从系统中下线。The offline module is used to offline the machine to be offline from the system after all the multiple instances to be deleted in the machine to be offline are deleted.

根据本申请的另一方面,提供了一种计算机程序产品,包括计算机程序,所述计算机程序在被处理器执行时实现如上所述的方法。According to another aspect of the present application, a computer program product is provided, comprising a computer program, wherein the computer program implements the method described above when executed by a processor.

根据本申请的技术可以降低机器下线对系统服务造成的影响。The technology of the present application can reduce the impact of machine offline on system services.

应当理解,本部分所描述的内容并非旨在标识本申请的实施例的关键或重要特征,也不用于限制本申请的范围。本申请的其它特征将通过以下的说明书而变得容易理解。It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

附图用于更好地理解本方案,不构成对本申请的限定。其中:The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present application.

图1是根据本申请实施例提供的下线方法的流程图一;FIG1 is a flowchart of a method for going offline provided according to an embodiment of the present application;

图2是根据本申请实施例提供的下线方法的流程图二;FIG2 is a second flowchart of the offline method provided according to an embodiment of the present application;

图3是根据本申请实施例提供的下线方法的流程图三;FIG3 is a flowchart of a method for going offline provided according to an embodiment of the present application;

图4是根据本申请实施例提供的下线方法的示例图一;FIG4 is an exemplary diagram of a method for going offline provided according to an embodiment of the present application;

图5是根据本申请实施例提供的下线方法的示例图二;FIG5 is a second example diagram of a method for going offline provided according to an embodiment of the present application;

图6是根据本申请实施例提供的下线装置结构图一;FIG6 is a structural diagram of a offline device according to an embodiment of the present application;

图7是根据本申请实施例提供的下线装置结构图二;FIG7 is a second structural diagram of a offline device according to an embodiment of the present application;

图8是用来实现本申请实施例的下线方法的电子设备的框图。FIG8 is a block diagram of an electronic device for implementing the offline method according to an embodiment of the present application.

具体实施方式DETAILED DESCRIPTION

以下结合附图对本申请的示范性实施例做出说明,其中包括本申请实施例的各种细节以助于理解,应当将它们认为仅仅是示范性的。因此,本领域普通技术人员应当认识到,可以对这里描述的实施例做出各种改变和修改,而不会背离本申请的范围和精神。同样,为了清楚和简明,以下的描述中省略了对公知功能和结构的描述。The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

参见图1,本申请实施例提供一种下线方法,涉及计算机技术领域,尤其涉及云计算以及音视频处理技术领域,该方法包括:Referring to FIG. 1 , an embodiment of the present application provides an offline method, which relates to the field of computer technology, and in particular to the field of cloud computing and audio and video processing technology. The method includes:

S101、确定待下线机器中的多个实例为多个待删除实例;S101, determining that multiple instances in the machine to be taken offline are multiple instances to be deleted;

S102、将多个待删除实例记录在预设列表中,其中,预设列表中记录的待删除实例停止获取任务;S102, recording multiple instances to be deleted in a preset list, wherein the instances to be deleted recorded in the preset list stop acquiring tasks;

S103、如果待删除实例不是正在执行任务,则将待删除实例从系统中删除;S103. If the instance to be deleted is not executing a task, the instance to be deleted is deleted from the system;

S104、在待下线机器中的多个待删除实例全部被删除后,将待下线机器从系统中下线。S104: After all the instances to be deleted in the machine to be taken offline are deleted, the machine to be taken offline is taken offline from the system.

系统以音频转码系统为例,在音频转码系统中有多个集群,每个集群中有多个机器,每一机器上运行有多个实例,每一实例用于执行对应的音频转码任务,从而实现音频转码系统的音频转码功能。除此之外,本申请可以通用各种目标对象处理系统,例如视频转码系统、图像识别系统和语音识别系统等等。Taking the audio transcoding system as an example, there are multiple clusters in the audio transcoding system, multiple machines in each cluster, multiple instances running on each machine, and each instance is used to perform a corresponding audio transcoding task, thereby realizing the audio transcoding function of the audio transcoding system. In addition, the present application can be used in various target object processing systems, such as video transcoding systems, image recognition systems, and speech recognition systems, etc.

实例,也可以称为容器实例。容器实例可以理解为有效地将单个机器上的操作系统管理的资源划分到孤立的组中,以更好地在孤立的组之间平衡有冲突的资源使用需求。容器实例中运行的就是一个或者多个应用程序,以及应用运行所需要的环境。An instance can also be called a container instance. A container instance can be understood as effectively dividing the resources managed by the operating system on a single machine into isolated groups to better balance conflicting resource usage requirements between isolated groups. A container instance runs one or more applications and the environment required for the application to run.

本申请中的机器可以为物理机、虚拟机或云主机等等。机器下线也可以称为机器退场。The machine in this application can be a physical machine, a virtual machine, or a cloud host, etc. The offline of a machine can also be referred to as the machine exiting the field.

本申请中的预设列表称为黑名单(Blacklist),对将实例记录在预设列表的操作称为加黑处理。The preset list in this application is called a blacklist, and the operation of recording an instance in the preset list is called blacklist processing.

本申请可以应用于服务器、计算集群或物理机中等等。本申请在将机器从系统中下线的时候,可以大大降低机器下线对系统服务所造成的影响。因音频转码系统为例,若机器中的实例当前正在处理实时的转码任务,直接删除实例会导致该任务转码失败,只能等待上游主动发起重试,重新发起转码任务等待其他实例去执行,从而导致在线转码任务延迟高。本申请通过将待下线的机器的实例记录在预设列表中,使得实例不再拉取在线转码任务至自身的任务队列中,那么等待实例执行完任务队列里的在线转码任务后,才将该实例删除,降低机器下线对系统的在线服务所造成的影响。The present application can be applied to servers, computing clusters or physical machines, etc. When the present application takes the machine offline from the system, the impact of the machine being offline on the system service can be greatly reduced. Taking the audio transcoding system as an example, if the instance in the machine is currently processing a real-time transcoding task, directly deleting the instance will cause the transcoding task to fail, and the task can only wait for the upstream to actively initiate a retry, re-initiate the transcoding task and wait for other instances to execute, resulting in high delays in online transcoding tasks. The present application records the instance of the machine to be taken offline in a preset list so that the instance no longer pulls the online transcoding task into its own task queue. Then, the instance is deleted only after the instance has completed executing the online transcoding task in the task queue, thereby reducing the impact of the machine being offline on the system's online services.

在一种实施方式中,待下线机器中的多个实例用于执行音频转码任务和视频转码任务中的至少一项。In one implementation, multiple instances in the machine to be taken offline are used to execute at least one of an audio transcoding task and a video transcoding task.

在一种实施方式中,在步骤S101前,方法还包括:In one embodiment, before step S101, the method further includes:

接收机器下线请求,根据机器下线请求确定待下线机器。机器下线请求包括待下线机器的标识符信息和请求者身份信息。A machine offline request is received, and a machine to be offline is determined according to the machine offline request. The machine offline request includes identifier information of the machine to be offline and identity information of the requester.

可选地,提供通用的机器退场操作界面或应用程序接口(ApplicationProgramming Interface,API)。用户通过调用API或者通过界面操作,发起机器下线请求。API的主要参数为:操作对象(需要下线的机器)和操作发起身份。Optionally, a general machine exit operation interface or application programming interface (API) is provided. The user initiates a machine offline request by calling the API or operating through the interface. The main parameters of the API are: the operation object (the machine to be offline) and the operation initiator identity.

在一种实施方式中,参见图2,在步骤S102预设列表中记录多个待删除实例的信息之前,方法还包括:In one embodiment, referring to FIG. 2 , before recording information of multiple instances to be deleted in a preset list in step S102 , the method further includes:

S201、在假设删除待删除实例的情况下,判断系统是否满足预设的兜底策略;S201. Under the assumption that the instance to be deleted is deleted, determine whether the system satisfies a preset fallback strategy;

S202、如果满足预设的兜底策略,则执行步骤S102的将待删除实例记录在预设列表中。S202: If the preset fallback strategy is met, execute step S102 to record the instance to be deleted in a preset list.

可选地,在对各个实例进行兜底策略判断时,需要依次对各个待删除实例进行兜底策略的判断,以保证兜底策略判断的准确性。例如,先假设删除实例A进行兜底策略的判断,如果满足,在预设列表中记录实例A。再假设删除实例B进行兜底策略的判断时,兜底策略的判断会考虑系统中的实例A处于记录在预设列表的情况,此时兜底策略的判断结论显然会比多个实例并行判断的结论更加准确。采用串行判断的方式,保证了兜底策略判断的准确性。Optionally, when performing a fallback strategy judgment on each instance, it is necessary to perform a fallback strategy judgment on each instance to be deleted in turn to ensure the accuracy of the fallback strategy judgment. For example, first assume that instance A is deleted for a fallback strategy judgment. If it is satisfied, instance A is recorded in the preset list. Then, assume that instance B is deleted for a fallback strategy judgment. The fallback strategy judgment will take into account the situation where instance A in the system is recorded in the preset list. At this time, the fallback strategy judgment conclusion will obviously be more accurate than the conclusion of parallel judgment of multiple instances. The serial judgment method is adopted to ensure the accuracy of the fallback strategy judgment.

可选地,如果步骤S201判断的结果为不满足系统兜底策略,则不执行步骤S102,即不将该待删除实例记录在预设列表中。Optionally, if the result of the judgment in step S201 is that the system fallback strategy is not satisfied, step S102 is not executed, that is, the instance to be deleted is not recorded in the preset list.

在对下线机器前,在将各个实例放入预设列表前均分别对系统进行兜底策略的判断,以保证删除实例后不会影响系统的正常服务,才将实例记录于预设列表中以作删除处理,可以规避机器下线过多导致系统的集群资源不足的问题。以音频转码系统为例,如果某天操作过多机器下线,可能会导致用于处理转码任务的实例变少、转码队列拥塞、系统转码能力下降,最终表现为系统整体的转码延迟增高。通过兜底策略判断,可以规避机器退场过多导致集群资源不足的风险。Before taking offline machines, the system will be judged for a backup strategy before each instance is put into the preset list to ensure that the normal service of the system will not be affected after the instance is deleted. The instance is recorded in the preset list for deletion, which can avoid the problem of insufficient cluster resources of the system due to too many machines going offline. Taking the audio transcoding system as an example, if too many machines are taken offline on a certain day, there may be fewer instances used to process transcoding tasks, congestion in the transcoding queue, and a decrease in the system's transcoding capacity, which will eventually manifest as an increase in the overall transcoding delay of the system. By judging the backup strategy, the risk of insufficient cluster resources due to too many machines leaving the market can be avoided.

在一种实施方式中,预设的兜底策略包括下述至少一项:In one embodiment, the preset fallback strategy includes at least one of the following:

(1)系统的系统配置达到正常运行要求;其中,系统配置包括总中央处理器(central processing unit,CPU)能力、总内存和总负载中的一项或多项;(1) The system configuration of the system meets the normal operation requirements; the system configuration includes one or more of the total central processing unit (CPU) capacity, total memory and total load;

(2)系统中记录在预设列表中的实例的占比小于预设比例;(2) The proportion of instances recorded in the preset list in the system is less than the preset ratio;

(3)系统在预设时间内的机器下线次数不超过预设次数。(3) The number of machine offline times within the preset time does not exceed the preset number.

在删除实例前,判断删除该实例后,通过对系统配置、目前在预设列表中待删除实例的占比以及系统操作机器下线次数等方面进行评估,可以有效规避机器退场导致集群资源不足的风险。Before deleting an instance, after deleting it, you can effectively avoid the risk of insufficient cluster resources due to machine decommissioning by evaluating the system configuration, the proportion of instances to be deleted in the preset list, and the number of times the system operating machine has been offline.

在一种实施方式中,步骤S102将多个待删除实例记录在预设列表中,包括:调用转码系统的实例记录应用程序接口(Application Programming Interface,API),将多个待删除实例记录在预设列表中。In one implementation, step S102 records the multiple instances to be deleted in a preset list, including: calling an instance recording application programming interface (Application Programming Interface, API) of the transcoding system to record the multiple instances to be deleted in the preset list.

在一种实施方式中,对于在步骤S102中将待删除实例记录在预设列表,系统中的实例会定时轮询预设列表并定时更新自身的实例状态,若检测到自身在预设列表中,则不再拉取任务,从而实现预设列表中记录的待删除实例停止获取任务。In one embodiment, for recording the instance to be deleted in a preset list in step S102, the instance in the system will periodically poll the preset list and update its own instance status. If it detects that it is in the preset list, it will no longer pull tasks, thereby achieving the goal of stopping the instance to be deleted recorded in the preset list from obtaining tasks.

在一种实施方式中,在步骤S102之后,方法还包括:记录在预设列表的实例执行完任务后,将该实例状态设置为不能运转(disable)状态。若检测到实例状态为不能运转(disable)状态,则返回允许删除指示,根据允许删除指示,从系统中删除实例。In one embodiment, after step S102, the method further includes: after the instance recorded in the preset list completes the task, setting the instance status to a disabled state. If it is detected that the instance status is a disabled state, returning a deletion permission indication, and deleting the instance from the system according to the deletion permission indication.

对应的,步骤S103通过查询实例状态为disable状态,判定待删除实例不是正在执行任务,则将待删除实例从系统中删除。Correspondingly, in step S103, if the instance state is disabled by querying, it is determined that the instance to be deleted is not executing a task, and the instance to be deleted is deleted from the system.

在一种实施方式中,在步骤S103将待删除实例从系统中删除后,方法还包括:将实例的状态设置为删除(delete)状态。In one implementation, after deleting the instance to be deleted from the system in step S103, the method further includes: setting the state of the instance to a delete state.

对应的,在步骤S104中通过查询到待下线机器中的实例均为删除(delete)状态,来判定多个待删除实例全部被删除,进而将待下线机器从系统中下线。Correspondingly, in step S104, by querying that the instances in the machine to be taken offline are all in the delete state, it is determined that all the multiple instances to be deleted are deleted, and then the machine to be taken offline is taken offline from the system.

可选地,采用调用转码系统的实例状态查询接口的方式,来查询实例的状态。Optionally, the instance status is queried by calling an instance status query interface of the transcoding system.

在一种实施方式中,参见图3,该方法还包括:In one embodiment, referring to FIG3 , the method further includes:

S301、定时轮询各个待删除实例是否被删除;S301, regularly polling whether each instance to be deleted has been deleted;

S302、对于没有被删除的待删除实例,重新执行将待删除实例记录在预设列表中。S302: For the to-be-deleted instances that have not been deleted, re-execute the process of recording the to-be-deleted instances in a preset list.

这样处理的好处是,定时轮询各个待删除实例是否被删除,从而可以对没有被删除的实例再回调一轮步骤S201的兜底策略判断,以重新启动对于该实例的删除处理。The advantage of this processing is that each instance to be deleted is polled regularly to see whether it has been deleted, so that the fallback strategy judgment of step S201 can be called back for the instance that has not been deleted to restart the deletion process for the instance.

在一种实施方式中,该方法还包括:In one embodiment, the method further comprises:

当接收到清理预设列表指令时,清理将预设列表中不在系统的实例。可选地,可以设置每天定时发起清理预设列表指令,以对预设列表进行定时清理。When receiving the clearing preset list instruction, clear the instances that are not in the system in the preset list. Optionally, it is possible to set a daily scheduled clearing preset list instruction to perform scheduled clearing of the preset list.

在机器下线的场景下,被删除的实例将一直被记录于预设列表里面,释放出已经下线的实例,防止系统中加黑的实例数量累计过多,影响后续的实例不能正常下线。In the scenario where a machine goes offline, the deleted instances will always be recorded in the preset list, releasing the offline instances to prevent the accumulation of too many blacklisted instances in the system, which would affect the normal offline of subsequent instances.

此外考虑到部分待删除实例可能被记录在预设列表中记录的实例有部分为待删除实例,因此设置预设列表中不在系统的实例的记录删除的清理策略,可以避免误删待删除实例的记录。In addition, considering that some instances to be deleted may be recorded in the preset list, some of the instances recorded are instances to be deleted. Therefore, setting a cleanup strategy for deleting records of instances in the preset list that are not in the system can avoid accidental deletion of records of instances to be deleted.

以实现音频转码系统为例,给出本申请实施例的一种示例。Taking the implementation of an audio transcoding system as an example, an example of an embodiment of the present application is given.

步骤1:接收机器退场操作请求,即机器下线请求。根据机器退场操作请求可以生成机器退场任务。提供通用的机器退场操作界面或应用程序接口(ApplicationProgramming Interface,API),在操作前调用API接口/通过界面操作。应用程序接口的主要参数为:操作对象(需要退场的机器)、操作发起身份。Step 1: Receive a machine exit operation request, i.e., a machine offline request. A machine exit task can be generated based on the machine exit operation request. Provide a general machine exit operation interface or application programming interface (API), and call the API interface/operate through the interface before the operation. The main parameters of the application programming interface are: operation object (machine to be exited) and operation initiator identity.

步骤2:将机器退场任务进行分解:根据操作对象得到操作对象上的各个实例,生成与各个实例对应的下线子任务。Step 2: Decompose the machine exit task: obtain each instance on the operation object according to the operation object, and generate offline subtasks corresponding to each instance.

参见图4,图4为机器退场流程的示例图,发起机器退场任务后,触发与各个实例对应的机器上实例退场任务1、机器上实例退场任务2……机器实例退场任务n。此外,图中实例下线回调任务指的是回调相应的机器上实例退场任务,回调指的是重新执行机器实例退场任务。例如,实例下线回调任务1对应回调机器上实例退场任务1,实例下线回调任务2对应回调机器上实例退场任务2,……,实例下线回调任务n对应回调机器上实例退场任务n。Refer to Figure 4, which is an example diagram of the machine exit process. After the machine exit task is initiated, the instance exit task 1 on the machine, the instance exit task 2 on the machine, and the machine instance exit task n corresponding to each instance are triggered. In addition, the instance offline callback task in the figure refers to the callback of the corresponding instance exit task on the machine, and the callback refers to the re-execution of the machine instance exit task. For example, instance offline callback task 1 corresponds to the callback of instance exit task 1 on the machine, instance offline callback task 2 corresponds to the callback of instance exit task 2 on the machine, and ..., instance offline callback task n corresponds to the callback of instance exit task n on the machine.

结合图5,下述步骤2-0至步骤2-4以一实例执行一轮实例下线回调任务为例进行说明。In conjunction with FIG. 5 , the following steps 2-0 to 2-4 are described by taking an instance executing a round of instance offline callback tasks as an example.

回调开始;Callback starts;

步骤2-0:定时轮询是否允许(ALLOWED)将实例从音频转码系统中删除;如果不允许删除,则执行步骤2-1的兜底策略判断,如果允许删除,则删除实例后执行步骤2-4的检查是否删除成功操作;Step 2-0: Periodically poll whether it is allowed (ALLOWED) to delete the instance from the audio transcoding system; if deletion is not allowed, execute the fallback policy judgment of step 2-1; if deletion is allowed, after deleting the instance, execute step 2-4 to check whether the deletion is successful;

步骤2-1:对当前音频转码系统进行兜底策略判断,兜底策略判断包括假设实例下线后的当前音频转码系统的当前总中央处理器(CPU,central processing unit)和总内存等系统配置是否满足当前音频转码系统的运行要求、当前音频转码系统中加黑的实例和总实例的比率是否满足预设要求、当前音频转码系统操作下线的次数是否满足预设阈值等;Step 2-1: Perform a bottom-line strategy judgment on the current audio transcoding system. The bottom-line strategy judgment includes whether the current total central processing unit (CPU) and total memory of the current audio transcoding system after the instance goes offline meet the operation requirements of the current audio transcoding system, whether the ratio of blacklisted instances to total instances in the current audio transcoding system meets the preset requirements, whether the number of offline operations of the current audio transcoding system meets the preset threshold, etc.;

步骤2-2:若满足兜底策略,则调用音频转码系统的实例加黑接口,对该实例进行加黑,即将实例记录在黑名单中。此时,在转码系统中,位于各个转码集群(如转码集群1、……、转码集群n)中的各实例会定时轮询黑名单,并定时更新自身的实例状态。若实例检测到自身在黑名单中,则不再拉取转码任务至任务队列中,将当前执行的任务完成后将实例状态置为不能运转(disable)状态。Step 2-2: If the bottom-line strategy is met, call the instance blacklisting interface of the audio transcoding system to blacklist the instance, that is, record the instance in the blacklist. At this time, in the transcoding system, each instance in each transcoding cluster (such as transcoding cluster 1, ..., transcoding cluster n) will periodically poll the blacklist and update its own instance status. If the instance detects that it is on the blacklist, it will no longer pull the transcoding task into the task queue, and after completing the currently executed task, the instance status will be set to a disabled state.

若不满足兜底策略,则返回拒绝(REJECT)指示结束本轮实例下线回调任务。If the fallback strategy is not met, a REJECT message is returned to indicate the end of the current round of instance offline callback task.

步骤2-3:若实例加黑失败,则返回拒绝(REJECT)指示结束本轮实例下线回调任务;若实例加黑成功,调用音频转码系统的实例状态查询接口api检测实例的状态。若检测到实例的状态为不能运转(disable)状态,则返回允许(ALLOWED)指示,当步骤2-0在定时轮询到允许(ALLOWED)指示时则可以删除实例;否则,返回拒绝(REJECT)指示结束本轮实例下线回调任务。Step 2-3: If the instance fails to be blacklisted, a REJECT indication is returned to end the current round of instance offline callback task; if the instance is blacklisted successfully, the instance status query API of the audio transcoding system is called to detect the instance status. If the instance status is detected to be disabled, an ALLOWED indication is returned. When the ALLOWED indication is received in the regular polling of step 2-0, the instance can be deleted; otherwise, a REJECT indication is returned to end the current round of instance offline callback task.

步骤2-4:检查实例是否删除成功,如果删除成功,则更新机器中该实例状态为删除(DELETE)状态,结束本轮实例下线回调任务。如果没有删除成功,则更新机器中该实例状态为不明原因(UNKNOW)状态。Step 2-4: Check whether the instance is deleted successfully. If it is deleted successfully, update the instance status in the machine to the DELETE status, and end the current round of instance offline callback task. If it is not deleted successfully, update the instance status in the machine to the UNKNOW status.

步骤3:回到图4,定时轮询所有回调任务是否成功完成,即定时轮询子任务的各个实例状态,若所有的实例状态都变为删除状态,则操作机器下线,即机器退场;否则,针对状态不是删除状态的各实例重新回调实例退场任务(即上述步骤2-0至步骤2-4),直到实例状态都变为删除状态。Step 3: Return to Figure 4, and periodically poll whether all callback tasks are successfully completed, that is, periodically poll the status of each instance of the subtask. If the status of all instances changes to the deleted state, the machine is operated offline, that is, the machine exits; otherwise, for each instance whose status is not the deleted state, the instance exit task is re-called (that is, the above steps 2-0 to 2-4) until the instance status changes to the deleted state.

此外,本示例还提供实例黑名单(BlackList)清理策略:获取音频转码系统里面当前所有的实例,将在黑名单(BlackList)中但不在音频转码系统中的实例进行解黑。在机器下线的场景下,对实例加黑,删除的实例将一直在黑名单里面,考虑每天定时黑名单(BlackList),释放出已经下线的实例,防止系统中加黑的实例数量累计过多,影响后续的实例不能正常下线。In addition, this example also provides an instance blacklist cleanup strategy: obtain all current instances in the audio transcoding system, and unblacklist instances that are in the blacklist but not in the audio transcoding system. In the scenario where the machine is offline, blacklist instances, and deleted instances will remain in the blacklist. Consider blacklisting at a fixed time every day to release offline instances to prevent the number of blacklisted instances in the system from accumulating too many instances, which will affect the subsequent instances from being able to go offline normally.

本申请实施例所提供的机器下线方法,既可以保证不影响系统在线的服务效率,如转码系统的转码效率,又可以规避机器退场过多导致集群资源不足的风险。The machine offline method provided in the embodiment of the present application can not only ensure that the service efficiency of the online system is not affected, such as the transcoding efficiency of the transcoding system, but also avoid the risk of insufficient cluster resources due to too many machine withdrawals.

根据本申请的实施例,本申请还提供了一种下线装置,如图6所示,包括:According to an embodiment of the present application, the present application further provides a offline device, as shown in FIG6 , comprising:

实例确定模块61,用于确定待下线机器中的多个实例为多个待删除实例;An instance determination module 61 is used to determine that multiple instances in the machine to be taken offline are multiple instances to be deleted;

记录模块62,用于将多个待删除实例记录在预设列表中,预设列表中记录的待删除实例停止获取任务;A recording module 62, used for recording multiple instances to be deleted in a preset list, and stopping the acquisition task for the instances to be deleted recorded in the preset list;

删除模块63,用于如果预设列表中记录的待删除实例不是正在执行任务,则将待删除实例从系统中删除;A deleting module 63, configured to delete the instance to be deleted from the system if the instance to be deleted recorded in the preset list is not executing a task;

下线模块64,用于在待下线机器中的多个待删除实例全部被删除后,将待下线机器从系统中下线。The offline module 64 is used to offline the machine to be offline from the system after all the multiple instances to be deleted in the machine to be offline are deleted.

如图7所示,在一种实施方式中,该下线装置还包括:As shown in FIG7 , in one embodiment, the offline device further includes:

兜底策略判断模块75,用于在假设删除待删除实例的情况下,判断系统是否满足预设的兜底策略;如果满足预设的兜底策略,则执行记录模块。The fallback strategy judgment module 75 is used to judge whether the system satisfies the preset fallback strategy when assuming that the instance to be deleted is deleted; if the preset fallback strategy is satisfied, the recording module is executed.

在一种实施方式中,其中,In one embodiment, wherein

预设的兜底策略包括下述至少一项:The default fallback strategy includes at least one of the following:

系统的系统配置达到正常运行要求;The system configuration of the system meets the normal operation requirements;

系统中记录在预设列表中的实例的占比小于预设比例;The proportion of instances recorded in the preset list in the system is less than the preset ratio;

系统在预设时间内的机器下线次数不超过预设次数。The number of machine offline times within the preset time does not exceed the preset number.

在一种实施方式中,该下线装置还包括:In one embodiment, the offline device further comprises:

定时轮询模块76,用于定时轮询各个待删除实例是否被删除;对于没有被删除的待删除实例,重新执行记录模块62。The timing polling module 76 is used for timing polling whether each to-be-deleted instance has been deleted; for the to-be-deleted instance that has not been deleted, the recording module 62 is re-executed.

在一种实施方式中,该下线装置还包括:In one embodiment, the offline device further comprises:

清理模块77,用于当接收到清理预设列表指令时,清理预设列表中不在系统的实例。The cleaning module 77 is used to clean up the instances in the preset list that are not in the system when receiving an instruction to clean up the preset list.

在一种实施方式中,待下线机器中的多个实例用于执行音频转码任务和视频转码任务中的至少一项。In one implementation, multiple instances in the machine to be taken offline are used to execute at least one of an audio transcoding task and a video transcoding task.

根据本申请的实施例,本申请还提供了一种电子设备、一种可读存储介质和一种计算机程序产品。According to an embodiment of the present application, the present application also provides an electronic device, a readable storage medium and a computer program product.

如图8所示,是根据本申请实施例的下线的方法的电子设备的框图。电子设备旨在表示各种形式的数字计算机,诸如,膝上型计算机、台式计算机、工作台、个人数字助理、服务器、刀片式服务器、大型计算机、和其它适合的计算机。电子设备还可以表示各种形式的移动装置,诸如,个人数字处理、蜂窝电话、智能电话、可穿戴设备和其它类似的计算装置。本文所示的部件、它们的连接和关系、以及它们的功能仅仅作为实例,并且不意在限制本文中描述的和/或者要求的本申请的实现。As shown in Figure 8, it is a block diagram of an electronic device according to the method of going offline of an embodiment of the present application. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices and other similar computing devices. The components shown herein, their connections and relationships, and their functions are only examples, and are not intended to limit the implementation of the present application described herein and/or required.

如图8所示,该电子设备包括:一个或多个处理器801、存储器802,以及用于连接各部件的接口,包括高速接口和低速接口。各个部件利用不同的总线互相连接,并且可以被安装在公共主板上或者根据需要以其它方式安装。处理器可以对在电子设备内执行的指令进行处理,包括存储在存储器中或者存储器上以在外部输入/输出装置(诸如,耦合至接口的显示设备)上显示GUI的图形信息的指令。在其它实施方式中,若需要,可以将多个处理器和/或多条总线与多个存储器和多个存储器一起使用。同样,可以连接多个电子设备,各个设备提供部分必要的操作(例如,作为服务器阵列、一组刀片式服务器、或者多处理器集群)。图8中以一个处理器801为例。As shown in Figure 8, the electronic device includes: one or more processors 801, memory 802, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input/output device (such as a display device coupled to the interface). In other embodiments, if necessary, multiple processors and/or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor cluster). In Figure 8, a processor 801 is taken as an example.

存储器802即为本申请所提供的非瞬时计算机可读存储介质。其中,所述存储器存储有可由至少一个处理器执行的指令,以使所述至少一个处理器执行本申请所提供的下线的方法。本申请的非瞬时计算机可读存储介质存储计算机指令,该计算机指令用于使计算机执行本申请所提供的下线的方法。The memory 802 is a non-transient computer-readable storage medium provided in the present application. The memory stores instructions executable by at least one processor to enable the at least one processor to perform the offline method provided in the present application. The non-transient computer-readable storage medium of the present application stores computer instructions, which are used to enable a computer to perform the offline method provided in the present application.

存储器802作为一种非瞬时计算机可读存储介质,可用于存储非瞬时软件程序、非瞬时计算机可执行程序以及模块,如本申请实施例中的下线的方法对应的程序指令/模块(例如,附图6所示的实例确定模块61、记录模块62、删除模块63和下线模块64)。处理器801通过运行存储在存储器802中的非瞬时软件程序、指令以及模块,从而执行服务器的各种功能应用以及数据处理,即实现上述方法实施例中的下线的方法。The memory 802, as a non-transient computer-readable storage medium, can be used to store non-transient software programs, non-transient computer executable programs and modules, such as program instructions/modules corresponding to the offline method in the embodiment of the present application (for example, the instance determination module 61, the recording module 62, the deletion module 63 and the offline module 64 shown in FIG. 6). The processor 801 executes various functional applications and data processing of the server by running the non-transient software programs, instructions and modules stored in the memory 802, that is, implements the offline method in the above method embodiment.

存储器802可以包括存储程序区和存储数据区,其中,存储程序区可存储操作集群、至少一个功能所需要的应用程序;存储数据区可存储根据下线的电子设备的使用所创建的数据等。此外,存储器802可以包括高速随机存取存储器,还可以包括非瞬时存储器,例如至少一个磁盘存储器件、闪存器件、或其他非瞬时固态存储器件。在一些实施例中,存储器802可选包括相对于处理器801远程设置的存储器,这些远程存储器可以通过网络连接至下线的电子设备。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 802 may include a program storage area and a data storage area, wherein the program storage area may store the application programs required for the operation cluster and at least one function; the data storage area may store data created according to the use of the offline electronic device, etc. In addition, the memory 802 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory 802 may optionally include a memory remotely arranged relative to the processor 801, and these remote memories may be connected to the offline electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

下线的方法的电子设备还可以包括:输入装置803和输出装置804。处理器801、存储器802、输入装置803和输出装置804可以通过总线或者其他方式连接,图8中以通过总线连接为例。The electronic device of the offline method may further include: an input device 803 and an output device 804. The processor 801, the memory 802, the input device 803 and the output device 804 may be connected via a bus or other means, and FIG8 takes the bus connection as an example.

输入装置803可接收输入的数字或字符信息,以及产生与下线的电子设备的用户设置以及功能控制有关的键信号输入,例如触摸屏、小键盘、鼠标、轨迹板、触摸板、指示杆、一个或者多个鼠标按钮、轨迹球、操纵杆等输入装置。输出装置804可以包括显示设备、辅助照明装置(例如,LED)和触觉反馈装置(例如,振动电机)等。该显示设备可以包括但不限于,液晶显示器(LCD)、发光二极管(LED)显示器和等离子体显示器。在一些实施方式中,显示设备可以是触摸屏。The input device 803 can receive input digital or character information, and generate key signal input related to user settings and function control of offline electronic devices, such as touch screen, keypad, mouse, track pad, touch pad, indicator bar, one or more mouse buttons, trackball, joystick and other input devices. The output device 804 may include a display device, an auxiliary lighting device (e.g., LED) and a tactile feedback device (e.g., a vibration motor), etc. The display device may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display and a plasma display. In some embodiments, the display device may be a touch screen.

此处描述的集群和技术的各种实施方式可以在数字电子电路集群、集成电路集群、专用ASIC(专用集成电路)、计算机硬件、固件、软件、和/或它们的组合中实现。这些各种实施方式可以包括:实施在一个或者多个计算机程序中,该一个或者多个计算机程序可在包括至少一个可编程处理器的可编程集群上执行和/或解释,该可编程处理器可以是专用或者通用可编程处理器,可以从存储集群、至少一个输入装置、和至少一个输出装置接收数据和指令,并且将数据和指令传输至该存储集群、该至少一个输入装置、和该至少一个输出装置。Various implementations of the clusters and techniques described herein can be implemented in digital electronic circuit clusters, integrated circuit clusters, dedicated ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and/or interpreted on a programmable cluster including at least one programmable processor, which can be a dedicated or general purpose programmable processor that can receive data and instructions from a storage cluster, at least one input device, and at least one output device, and transmit data and instructions to the storage cluster, the at least one input device, and the at least one output device.

这些计算程序(也称作程序、软件、软件应用、或者代码)包括可编程处理器的机器指令,并且可以利用高级过程和/或面向对象的编程语言、和/或汇编/机器语言来实施这些计算程序。如本文使用的,术语“机器可读介质”和“计算机可读介质”指的是用于将机器指令和/或数据提供给可编程处理器的任何计算机程序产品、设备、和/或装置(例如,磁盘、光盘、存储器、可编程逻辑装置(PLD)),包括,接收作为机器可读信号的机器指令的机器可读介质。术语“机器可读信号”指的是用于将机器指令和/或数据提供给可编程处理器的任何信号。These computer programs (also referred to as programs, software, software applications, or code) include machine instructions for programmable processors and can be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, device, and/or means (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and/or data to a programmable processor.

为了提供与用户的交互,可以在计算机上实施此处描述的集群和技术,该计算机具有:用于向用户显示信息的显示装置(例如,CRT(阴极射线管)或者LCD(液晶显示器)监视器);以及键盘和指向装置(例如,鼠标或者轨迹球),用户可以通过该键盘和该指向装置来将输入提供给计算机。其它种类的装置还可以用于提供与用户的交互;例如,提供给用户的反馈可以是任何形式的传感反馈(例如,视觉反馈、听觉反馈、或者触觉反馈);并且可以用任何形式(包括声输入、语音输入或者、触觉输入)来接收来自用户的输入。To provide interaction with a user, the cluster and techniques described herein may be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

可以将此处描述的集群和技术实施在包括后台部件的计算集群(例如,作为数据服务器)、或者包括中间件部件的计算集群(例如,应用服务器)、或者包括前端部件的计算集群(例如,具有图形用户界面或者网络浏览器的用户计算机,用户可以通过该图形用户界面或者该网络浏览器来与此处描述的集群和技术的实施方式交互)、或者包括这种后台部件、中间件部件、或者前端部件的任何组合的计算集群中。可以通过任何形式或者介质的数字数据通信(例如,通信网络)来将集群的部件相互连接。通信网络的实例包括:局域网(LAN)、广域网(WAN)和互联网。The clusters and techniques described herein may be implemented in a computing cluster that includes backend components (e.g., as data servers), or a computing cluster that includes middleware components (e.g., application servers), or a computing cluster that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the clusters and techniques described herein), or a computing cluster that includes any combination of such backend components, middleware components, or frontend components. The components of the cluster may be interconnected by any form or medium of digital data communication (e.g., a communications network). Examples of communications networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

计算机集群可以包括客户端和服务器。客户端和服务器一般远离彼此并且通常通过通信网络进行交互。通过在相应的计算机上运行并且彼此具有客户端-服务器关系的计算机程序来产生客户端和服务器的关系。服务器可以是云服务器,又称为云计算服务器或云主机,是云计算服务体系中的一项主机产品,以解决了传统物理主机与虚拟专用服务器(VPS)服务中,存在的管理难度大,业务扩展性弱的缺陷。A computer cluster may include clients and servers. The clients and servers are generally remote from each other and usually interact through a communication network. The client-server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and virtual private servers (VPS) services.

应该理解,可以使用上面所示的各种形式的流程,重新排序、增加或删除步骤。例如,本申请中记载的各步骤可以并行地执行也可以顺序地执行也可以不同的次序执行,只要能够实现本申请公开的技术方案所期望的结果,本文在此不进行限制。It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application can be executed in parallel, sequentially or in different orders, as long as the expected results of the technical solution disclosed in this application can be achieved, and this document is not limited here.

本申请实施例所提供的机器下线方法,既可以保证不影响系统的在线服务效率,又可以规避机器下线过多导致集群资源不足的风险。The machine offline method provided in the embodiment of the present application can not only ensure that the online service efficiency of the system is not affected, but also avoid the risk of insufficient cluster resources caused by too many machines being offline.

上述具体实施方式,并不构成对本申请保护范围的限制。本领域技术人员应该明白的是,根据设计要求和其他因素,可以进行各种修改、组合、子组合和替代。任何在本申请的精神和原则之内所作的修改、等同替换和改进等,均应包含在本申请保护范围之内。The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.

Claims (11)

1. A method of offline comprising:
determining a plurality of instances in a machine to be offline as a plurality of instances to be deleted, wherein the machine to be offline is determined by receiving a machine offline request and according to the machine offline request;
Recording the plurality of to-be-deleted examples in a preset list, so that the examples in the system poll the preset list at regular time, and if the to-be-deleted examples recorded in the preset list are detected to be in the preset list, the to-be-deleted examples are not pulled to acquire tasks any more, wherein the to-be-deleted examples recorded in the preset list stop acquiring tasks;
if the to-be-deleted instance recorded in the preset list is not executing the task, deleting the to-be-deleted instance from the system;
After all the plurality of instances to be deleted in the machine to be offline are deleted, the machine to be offline is offline from the system;
Before the to-be-deleted instance is recorded in the preset list, the method further comprises:
under the condition that the to-be-deleted instance is supposed to be deleted, judging whether the system meets a preset spam strategy or not;
If the preset spam strategy is met, executing the record to-be-deleted instance in the preset list;
Further comprises:
and when a preset list clearing instruction is received, clearing the examples which are not in the system in the preset list.
2. The method of claim 1, wherein,
The preset bottom-covering strategy comprises at least one of the following steps:
the system configuration of the system meets the normal operation requirement;
the ratio of the examples recorded in the preset list in the system is smaller than a preset proportion;
The machine offline times of the system in the preset time do not exceed the preset times.
3. The method of claim 1, further comprising:
polling whether each instance to be deleted is deleted or not at regular time;
and for the instance to be deleted which is not deleted, re-executing the record of the instance to be deleted in a preset list.
4. A method according to any of claims 1-3, wherein multiple instances in the machine to be offline are used to perform at least one of an audio transcoding task and a video transcoding task.
5. An offline device, comprising:
the system comprises an instance determining module, a processing module and a processing module, wherein the instance determining module is used for determining a plurality of instances in a machine to be offline as a plurality of instances to be deleted, and the machine to be offline is used for receiving a machine offline request and determining according to the machine offline request;
The recording module is used for recording the plurality of to-be-deleted examples in a preset list so as to enable the examples in the system to poll the preset list at regular time, and if the to-be-deleted examples recorded in the preset list stop acquiring tasks if the to-be-deleted examples are detected to be in the preset list;
the deleting module is used for deleting the to-be-deleted instance recorded in the preset list from the system if the to-be-deleted instance is not executing the task;
the offline module is used for offline the offline machine from the system after all the plurality of instances to be deleted in the offline machine are deleted;
Further comprises:
The spam policy judging module is used for judging whether the system meets a preset spam policy under the condition that the to-be-deleted instance is supposed to be deleted; if the preset spam strategy is met, executing the recording module;
and the cleaning module is used for cleaning the examples which are not in the system in the preset list when receiving the instruction for cleaning the preset list.
6. The apparatus of claim 5, wherein,
The preset bottom-covering strategy comprises at least one of the following steps:
the system configuration of the system meets the normal operation requirement;
the ratio of the examples recorded in the preset list in the system is smaller than a preset proportion;
The machine offline times of the system in the preset time do not exceed the preset times.
7. The apparatus of claim 5, further comprising:
the timing polling module is used for periodically polling whether each instance to be deleted is deleted or not; and re-executing the recording module for the instance to be deleted which is not deleted.
8. The apparatus of any of claims 5-7, wherein multiple instances in the machine to be offline are to perform at least one of an audio transcoding task and a video transcoding task.
9. An electronic device, comprising:
At least one processor; and
A memory communicatively coupled to the at least one processor; wherein,
The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-4.
10. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-4.
11. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any of claims 1-4.
CN202010599221.0A 2020-06-28 2020-06-28 Offline method, device, equipment and storage medium Active CN111752695B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010599221.0A CN111752695B (en) 2020-06-28 2020-06-28 Offline method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010599221.0A CN111752695B (en) 2020-06-28 2020-06-28 Offline method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111752695A CN111752695A (en) 2020-10-09
CN111752695B true CN111752695B (en) 2024-11-05

Family

ID=72677697

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010599221.0A Active CN111752695B (en) 2020-06-28 2020-06-28 Offline method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111752695B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112948098B (en) * 2021-05-12 2021-07-23 北京世纪好未来教育科技有限公司 Service unit offline method and related device based on micro-service unit architecture

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105306225A (en) * 2015-11-03 2016-02-03 国云科技股份有限公司 Openstack-based physical machine remote shutdown method
WO2018072708A1 (en) * 2016-10-21 2018-04-26 中兴通讯股份有限公司 Cloud platform service capacity reduction method, apparatus, and cloud platform
CN110489248A (en) * 2019-08-22 2019-11-22 中国工商银行股份有限公司 System-down method, service calling method, device and storage medium

Family Cites Families (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7318132B2 (en) * 2003-06-13 2008-01-08 Microsoft Corporation Method and apparatus for dynamically unloading file system filters
JP2009187309A (en) * 2008-02-06 2009-08-20 Canon Inc Authentication server, authentication system and account maintenance method
JP5235483B2 (en) * 2008-04-30 2013-07-10 インターナショナル・ビジネス・マシーンズ・コーポレーション A method and apparatus for maintaining consistency between a database and a virtual table.
JP2011013870A (en) * 2009-07-01 2011-01-20 Hitachi Ltd Load distribution system
JP2011065273A (en) * 2009-09-15 2011-03-31 Ricoh Co Ltd Apparatus, system, method and program for managing equipment, and storage medium
US9515869B2 (en) * 2012-01-18 2016-12-06 Dh2I Company Systems and methods for server cluster application virtualization
US9239868B2 (en) * 2012-06-19 2016-01-19 Microsoft Technology Licensing, Llc Virtual session management and reestablishment
CN103839558B (en) * 2012-11-23 2016-08-31 三星电子(中国)研发中心 Synchronous broadcast method and server, player
CN104252485B (en) * 2013-06-29 2017-08-04 北京新媒传信科技有限公司 A kind of database management platform
US9569224B2 (en) * 2014-05-06 2017-02-14 Oracle International Corporation System and method for adaptively integrating a database state notification service with a distributed transactional middleware machine
CN105183130A (en) * 2015-08-03 2015-12-23 广东睿江科技有限公司 Electric energy saving method and apparatus for physical machine under cloud platform
CN105245603B (en) * 2015-10-15 2019-02-26 北京乐动卓越科技有限公司 Cluster server control method and system
CN105574195B (en) * 2015-12-25 2019-07-23 北京奇虎科技有限公司 Judge whether database answers the method and device of offline recycling
CN105426544B (en) * 2015-12-25 2020-06-30 北京奇虎科技有限公司 Method and device for monitoring database status
CN106980537B (en) * 2016-03-15 2019-02-01 平安科技(深圳)有限公司 The method and system of cloud host is deleted in cloud computing environment
CN108460160B (en) * 2018-03-29 2021-03-12 武汉斗鱼网络科技有限公司 Off-line method, device, terminal and storage medium of database instance

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105306225A (en) * 2015-11-03 2016-02-03 国云科技股份有限公司 Openstack-based physical machine remote shutdown method
WO2018072708A1 (en) * 2016-10-21 2018-04-26 中兴通讯股份有限公司 Cloud platform service capacity reduction method, apparatus, and cloud platform
CN110489248A (en) * 2019-08-22 2019-11-22 中国工商银行股份有限公司 System-down method, service calling method, device and storage medium

Also Published As

Publication number Publication date
CN111752695A (en) 2020-10-09

Similar Documents

Publication Publication Date Title
US10382380B1 (en) Workload management service for first-in first-out queues for network-accessible queuing and messaging services
CN111950988B (en) Distributed workflow scheduling method and device, storage medium and electronic equipment
EP3671462B1 (en) System and method for consumption based tagging of resources
CN111831420A (en) Method, apparatus, electronic device, and computer-readable storage medium for task scheduling
CN110049113A (en) Service message processing method and device
CN107341062B (en) Data pushing method, device, equipment and storage medium
CN103309731A (en) Processing system
CN111782365A (en) Timed task processing method, device, equipment and storage medium
CN114138838B (en) Data processing method, device, equipment and medium
WO2017037924A1 (en) Data processing system and data processing method
US10733554B2 (en) Information processing apparatus and method for managing connections
CN112346834A (en) Database request processing method and device, electronic device and medium
CN111752695B (en) Offline method, device, equipment and storage medium
US9317354B2 (en) Dynamically determining an external systems management application to report system errors
CN114595069B (en) Service offline method and device, electronic equipment and storage medium
CN116319758A (en) Data migration method, device, electronic equipment and readable storage medium
CN114443325A (en) Asynchronous retry method and system for abnormal interface call
US11061602B2 (en) System and method for event based storage management
CN111767113B (en) A method and device for implementing container expulsion
CN106484536B (en) IO scheduling method, device and equipment
CN116010126B (en) Service aggregation method, device and system
CN111625324A (en) Method and device for processing request
CN113138881B (en) Distributed file system backup method, device and system
CN115629918B (en) Data processing method, device, electronic equipment and storage medium
CN114817166B (en) Method, device and medium for canceling file operation

Legal Events

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