Offline method, device, equipment and storage medium

By recording instances to be taken offline in the audio/video transcoding system and deleting them after the task is completed, the problem of task failure caused by machine offline is solved, and efficient system service and resource management are achieved.

CN111752695BActive Publication Date: 2024-11-05BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010599221.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-28
Publication Date
2024-11-05
Estimated Expiration
2040-06-28

AI Technical Summary

Technical Problem

In audio and video transcoding systems, directly deleting an instance when a machine goes offline will cause ongoing real-time transcoding tasks to fail, affecting system service efficiency.

Method used

By recording instances of machines to be taken offline in a preset list, the instances are stopped from acquiring tasks, and then deleted after the tasks are completed, thus taking the machines offline and avoiding task failures caused by direct deletion.

Benefits of technology

This reduces the impact of machine shutdowns on system services, ensures the efficiency of online system services, and avoids the risk of insufficient cluster resources caused by too many machine shutdowns.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111752695B_ABST
    Figure CN111752695B_ABST
Patent Text Reader

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.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] 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

[0002] 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

[0003] The present application provides an offline method, apparatus, device and storage medium.

[0004] According to one aspect of the present application, a method for going offline is provided, comprising:

[0005] Determine that multiple instances in the machine to be taken offline are multiple instances to be deleted;

[0006] Recording multiple instances to be deleted in a preset list, wherein the instances to be deleted recorded in the preset list stop acquiring tasks;

[0007] 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;

[0008] 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.

[0009] According to another aspect of the present application, there is provided a offline device, comprising:

[0010] An instance determination module, used for determining that multiple instances in the machine to be taken offline are multiple instances to be deleted;

[0011] 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;

[0012] 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;

[0013] 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.

[0014] 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.

[0015] The technology of the present application can reduce the impact of machine offline on system services.

[0016] 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

[0017] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present application.

[0018] Figure 1 This is the process of the offline method provided in the embodiment of the present application Figure 1 ;

[0019] Figure 2 This is the process of the offline method provided in the embodiment of the present application Figure 2 ;

[0020] Figure 3 This is the process of the offline method provided in the embodiment of the present application Figure 3 ;

[0021] Figure 4 This is an example of the offline method provided according to the embodiment of the present application. Figure 1 ;

[0022] Figure 5 This is an example of the offline method provided according to the embodiment of the present application. Figure 2 ;

[0023] Figure 6 The structure of the offline device provided in the embodiment of the present application is Figure 1 ;

[0024] Figure 7 The structure of the offline device provided in the embodiment of the present application is Figure 2 ;

[0025] Figure 8 It is a block diagram of an electronic device used to implement the offline method of the embodiment of the present application. DETAILED DESCRIPTION

[0026] 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.

[0027] See also Figure 1 The present application embodiment 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:

[0028] S101, determining that multiple instances in a machine to be taken offline are multiple instances to be deleted;

[0029] 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;

[0030] S103. If the instance to be deleted is not executing a task, the instance to be deleted is deleted from the system;

[0031] 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.

[0032] 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.

[0033] 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.

[0034] 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.

[0035] 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.

[0036] 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.

[0037] 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.

[0038] In one embodiment, before step S101, the method further includes:

[0039] 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.

[0040] 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.

[0041] In one embodiment, see Figure 2 Before recording information of multiple instances to be deleted in the preset list in step S102, the method further includes:

[0042] S201. Under the assumption that the instance to be deleted is deleted, determine whether the system satisfies a preset fallback strategy;

[0043] S202: If the preset fallback strategy is met, execute step S102 to record the instance to be deleted in a preset list.

[0044] 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.

[0045] Optionally, if the result of step S201 is that the system fallback strategy is not satisfied, step S102 is not performed, that is, the instance to be deleted is not recorded in the preset list.

[0046] 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.

[0047] In one embodiment, the preset fallback strategy includes at least one of the following:

[0048] (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;

[0049] (2) The proportion of instances recorded in the preset list in the system is less than the preset ratio;

[0050] (3) The number of machine offline times within the preset time does not exceed the preset number.

[0051] 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.

[0052] 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.

[0053] 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.

[0054] 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.

[0055] 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.

[0056] 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.

[0057] 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.

[0058] Optionally, the instance status is queried by calling an instance status query interface of the transcoding system.

[0059] In one embodiment, see Figure 3 , the method further comprises:

[0060] S301, regularly polling whether each instance to be deleted has been deleted;

[0061] 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.

[0062] 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.

[0063] In one embodiment, the method further comprises:

[0064] 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.

[0065] 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.

[0066] 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.

[0067] Taking the implementation of an audio transcoding system as an example, an example of an embodiment of the present application is given.

[0068] 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.

[0069] 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.

[0070] See also Figure 4 , Figure 4 This 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.

[0071] Combination Figure 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.

[0072] Callback starts;

[0073] 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;

[0074] 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.;

[0075] 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.

[0076] 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.

[0077] 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.

[0078] 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.

[0079] Step 3: Go back Figure 4, regularly poll whether all callback tasks are completed successfully, that is, regularly 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.

[0080] 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.

[0081] 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.

[0082] According to an embodiment of the present application, the present application also provides a offline device, such as Figure 6 As shown, including:

[0083] 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;

[0084] 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;

[0085] 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;

[0086] 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.

[0087] like Figure 7 As shown, in one embodiment, the offline device further includes:

[0088] 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.

[0089] In one embodiment, wherein

[0090] The default fallback strategy includes at least one of the following:

[0091] The system configuration of the system meets the normal operation requirements;

[0092] The proportion of instances recorded in the preset list in the system is less than the preset ratio;

[0093] The number of machine offline times within the preset time does not exceed the preset number.

[0094] In one embodiment, the offline device further comprises:

[0095] 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.

[0096] In one embodiment, the offline device further comprises:

[0097] 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.

[0098] 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.

[0099] 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.

[0100] like Figure 8 , is a block diagram of an electronic device according to a method of going offline according to 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 merely examples, and are not intended to limit the implementation of the present application described herein and / or required.

[0101] like Figure 8As shown, the electronic device includes: one or more processors 801, a memory 802, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are interconnected 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). Figure 8 A processor 801 is taken as an example.

[0102] 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.

[0103] The memory 802 is a non-transient computer-readable storage medium that can be used to store non-transient software programs, non-transient computer executable programs and modules, such as the program instructions / modules corresponding to the offline method in the embodiment of the present application (for example, the attached Figure 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, the offline method in the above method embodiment is implemented.

[0104] 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.

[0105] 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. Figure 8 The example of connecting through bus is taken in the following.

[0106] 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.

[0107] 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.

[0108] 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.

[0109] 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).

[0110] 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.

[0111] 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.

[0112] 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.

[0113] 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.

[0114] 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

1. A method for going offline, comprising: Determining that multiple instances in the machine to be taken offline are multiple instances to be deleted, wherein the machine to be taken offline is determined according to receiving a machine offline request; The multiple instances to be deleted are recorded in a preset list, so that the instances in the system periodically poll the preset list, and if the instance is detected to be in the preset list, no task is pulled, wherein the instances to be deleted recorded in the preset list stop obtaining tasks; If the instance to be deleted recorded in the preset list is not executing a task, deleting 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, taking the machine to be taken offline offline from the system; Before recording the to-be-deleted instance in a preset list, the method further includes: Under the assumption that the instance to be deleted is deleted, determining whether the system satisfies a preset fallback strategy; If the preset fallback strategy is satisfied, the instance to be deleted is recorded in the preset list; Also includes: When an instruction to clear the preset list is received, the instances in the preset list that are not in the system are cleared.

2. The method according to claim 1, wherein: The preset safety net 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 a preset proportion; The number of machine offline times in the system within a preset time does not exceed a preset number.

3. The method according to claim 1, further comprising: Periodically poll each instance to be deleted to see if it has been deleted; For the to-be-deleted instances that have not been deleted, the to-be-deleted instances are recorded in the preset list again.

4. The method according to any one of claims 1 to 3, wherein: The 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.

5. A offline device, comprising: An instance determination module, used to determine that multiple instances in the machine to be taken offline are multiple instances to be deleted, wherein the machine to be taken offline is determined by receiving a machine offline request and according to the machine offline request; A recording module, used for recording the multiple instances to be deleted in a preset list, so that the instances in the system periodically poll the preset list, and if it is detected that the instance is in the preset list, it will no longer pull tasks, and the instances to be deleted recorded in the preset list will stop obtaining tasks; A deleting module, configured to delete the to-be-deleted instance from the system if the to-be-deleted instance recorded in the preset list is not currently executing a task; An offline module, configured 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; Also includes: A fallback strategy judgment module, used to judge whether the system satisfies a 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; The cleaning module 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.

6. The device according to claim 5, wherein: The preset safety net 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 a preset proportion; The number of machine offline times in the system within a preset time does not exceed a preset number.

7. The apparatus according to claim 5, further comprising: The timing polling module is used to regularly poll whether each instance to be deleted has been deleted; For the to-be-deleted instances that have not been deleted, the recording module is re-executed.

8. The device according to any one of claims 5 to 7, wherein: The 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.

9. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 4.

10. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 4.

11. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 4.