Binding processing method, device, equipment and storage medium

CN120455274BActive Publication Date: 2026-09-04BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510804917.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-16
Publication Date
2026-09-04
Estimated Expiration
2045-06-16

AI Technical Summary

Technical Problem

[0004]然而,由于所有解绑操作完成后才执行后续处理逻辑,会导致数据处理任务在短时间内高度集中,形成数据处理峰值

Benefits of technology

[0022]Compared with the prior art, the technical solution provided in this application has the following advantages: In this application embodiment, a debinding request is received indicating that a target device and an elastic public IP address should be unbound. The target device includes a load balancer and a monitoring device, and the debinding request carries the device identifier of the target device. Based on the device identifier and the elastic public IP address, a first debinding operation is performed between the load balancer and the elastic public IP address. After the first debinding operation is completed, the load balancer is controlled to perform a first target operation. Based on the device identifier and the elastic public IP address, a second debinding operation is performed between the monitoring device and the elastic public IP address. After the second debinding operation is completed, the monitoring device is controlled to perform a second target operation. Therefore, this application can first debind the association between the load balancer and the elastic public IP address, and then debind the association between the monitoring device and the elastic public IP address. After debinding the association between the load balancer and the elastic public IP address, the relevant operations after debinding the load balancer and the elastic public IP address are performed. After debinding the association between the monitoring device and the elastic public IP address, the relevant operations after debinding the monitoring device and the elastic public IP address are performed. As can be seen, this solution splits the originally centralized unbinding operation into two independent stages, avoiding the generation of a large number of concurrent tasks in an instant and improving the stability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120455274B_ABST
    Figure CN120455274B_ABST
Patent Text Reader

Abstract

The application relates to a binding release processing method, device and equipment and a storage medium, and the method comprises the following steps: receiving a binding release request indicating that a target equipment is bound to an elastic public network IP, the target equipment comprises a load balancer and a monitoring equipment, and the binding release request carries the equipment identifier of the target equipment; according to the equipment identifier and the elastic public network IP, performing a first binding release operation of the load balancer and the elastic public network IP; after the first binding release operation is completed, controlling the load balancer to perform a first target operation; according to the equipment identifier and the elastic public network IP, performing a second binding release operation of the monitoring equipment and the elastic public network IP; and after the second binding release operation is completed, controlling the monitoring equipment to perform a second target operation. The method splits the original concentrated binding release operation into two independent stages, avoids a large number of concurrent tasks at the same time, and improves the stability of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, device, and storage medium for unbinding. Background Technology

[0002] In the fields of cloud computing and network services, the binding and unbinding of Elastic IPs (EIPs) with load balancers and monitoring devices is a crucial mechanism for ensuring flexible scheduling of network resources. EIPs, as dynamically allocated public IP address resources, can be quickly associated with load balancers to provide external services, while load balancers distribute traffic through monitoring devices. The binding relationship between these three directly affects the access path and resource utilization of services.

[0003] In related technologies, network management systems adopt a synchronous unbinding strategy, which simultaneously unbinds the association between the load balancer, the monitoring device, and the EIP, and centrally executes subsequent processing tasks after the entire unbinding process is completed.

[0004] However, because subsequent processing logic is executed only after all unbinding operations are completed, data processing tasks become highly concentrated in a short period, creating a data processing peak. This sudden surge in data processing volume can put unexpected pressure on system resources, severely impacting system operation. Summary of the Invention

[0005] This application provides a method, apparatus, device, and storage medium for unbinding processing. The method first unbinds the association between a load balancer and an Elastic Public IP address, and then unbinds the association between a monitoring device and the Elastic Public IP address. After unbinding the load balancer and the Elastic Public IP address, the method performs the relevant operations after unbinding the load balancer and the Elastic Public IP address. Similarly, after unbinding the monitoring device and the Elastic Public IP address, the method performs the relevant operations after unbinding the monitoring device and the Elastic Public IP address. Therefore, this solution splits the originally centralized unbinding operation into two independent stages, avoiding the instantaneous generation of a large number of concurrent tasks and improving system stability.

[0006] Firstly, this application provides an unbinding method, the method comprising: Receive an unbinding request instructing the target device to unbind from the elastic public IP address. The target device includes a load balancer and a listening device. The unbinding request carries the device identifier of the target device. Based on the device identifier and the elastic public IP, perform the first unbinding operation between the load balancer and the elastic public IP; After the first unbinding operation is completed, control the load balancer to perform the first target operation; Based on the device identifier and the elastic public IP, perform a second unbinding operation between the monitoring device and the elastic public IP; After the second unbinding operation is completed, the monitoring device is controlled to perform the second target operation.

[0007] Optionally, if the device identifier includes a first device identifier corresponding to the monitoring device, the step of performing a second unbinding operation between the monitoring device and the elastic public IP address based on the device identifier and the elastic public IP address includes: Based on the first device identifier corresponding to the monitoring device and the elastic public IP, determine the asynchronous unbinding task corresponding to the monitoring device; According to preset rules, the asynchronous unbinding task corresponding to the monitoring device is added to the task cache queue; The asynchronous unbinding task is retrieved from the task cache queue, and the second unbinding operation between the listening device and the elastic public IP is executed.

[0008] Optionally, after determining the asynchronous unbinding task corresponding to the monitoring device, the method further includes: Obtain the first task identifier corresponding to the asynchronous unbinding task; Check if a task record corresponding to the first task identifier exists in the database; If no task record corresponding to the first task identifier exists in the database, a task record is generated based on the first task identifier, a preset first state, and other relevant information. The task records are stored in the database.

[0009] Optionally, retrieving the asynchronous unbinding task from the task cache queue and performing the second unbinding operation between the listening device and the elastic public IP includes: Extract the asynchronous unbinding task from the task cache queue to obtain the asynchronous unbinding task to be processed; Based on the second task identifier corresponding to the asynchronous unbinding task to be processed, the task status corresponding to the second task identifier is searched in the database; When the task status is in the first state, according to the pending asynchronous unbinding task, the second unbinding operation between the monitoring device and the elastic public IP is executed.

[0010] Optionally, the method further includes: In the database, retrieve the update time corresponding to each task record; Based on the update time corresponding to each task record, determine the preset target task record with the earliest update time; When the target task record meets the preset conditions, a cleanup notification is generated so that relevant personnel can clean up the target task record.

[0011] Optionally, if the device identifier includes a second device identifier corresponding to the load balancer, the step of performing a first unbinding operation between the load balancer and the elastic public IP based on the device identifier and the elastic public IP includes: Based on the second device identifier and the elastic public IP, find the association between the load balancer and the elastic public IP; The association is deleted to perform the first unbinding operation between the load balancer and the elastic public IP.

[0012] Optionally, the method further includes: When the asynchronous unbinding task fails, the task record corresponding to the third task identifier is searched in the database according to the third task identifier corresponding to the asynchronous unbinding task. Update the task status in the task record to the second status.

[0013] Secondly, this application provides an unbinding processing device, the device comprising: A receiving unit is configured to receive an unbinding request instructing a target device to unbind from an elastic public IP address. The target device includes a load balancer and a listening device. The unbinding request carries the device identifier of the target device. The first execution unit is configured to perform a first unbinding operation between the load balancer and the elastic public IP based on the device identifier and the elastic public IP. The second execution unit is used to control the load balancer to perform the first target operation after the first unbinding operation is completed; The third execution unit is used to perform a second unbinding operation between the monitoring device and the elastic public IP based on the device identifier and the elastic public IP. The fourth execution unit is used to control the listening device to perform the second target operation after the second unbinding operation is completed.

[0014] Optionally, if the device identifier includes a first device identifier corresponding to the monitoring device, the third execution unit is configured to: Based on the first device identifier corresponding to the monitoring device and the elastic public IP, determine the asynchronous unbinding task corresponding to the monitoring device; According to preset rules, the asynchronous unbinding task corresponding to the monitoring device is added to the task cache queue; The asynchronous unbinding task is retrieved from the task cache queue, and the second unbinding operation between the listening device and the elastic public IP is executed.

[0015] Optionally, after determining the asynchronous unbinding task corresponding to the monitoring device, the device further includes a generation unit, the generation unit being used for: Obtain the first task identifier corresponding to the asynchronous unbinding task; Check if a task record corresponding to the first task identifier exists in the database; If no task record corresponding to the first task identifier exists in the database, a task record is generated based on the first task identifier, a preset first state, and other relevant information. The task records are stored in the database.

[0016] Optionally, the third execution unit is used for: Extract the asynchronous unbinding task from the task cache queue to obtain the asynchronous unbinding task to be processed; Based on the second task identifier corresponding to the asynchronous unbinding task to be processed, the task status corresponding to the second task identifier is searched in the database; When the task status is in the first state, according to the pending asynchronous unbinding task, the second unbinding operation between the monitoring device and the elastic public IP is executed.

[0017] Optionally, the device further includes a detection unit, the detection unit being used for: In the database, retrieve the update time corresponding to each task record; Based on the update time corresponding to each task record, determine the preset target task record with the earliest update time; When the target task record meets the preset conditions, a cleanup notification is generated so that relevant personnel can clean up the target task record.

[0018] Optionally, if the device identifier includes a second device identifier corresponding to the load balancer, the first execution unit is configured to: Based on the second device identifier and the elastic public IP, find the association between the load balancer and the elastic public IP; The association is deleted to perform the first unbinding operation between the load balancer and the elastic public IP.

[0019] Optionally, the apparatus further includes an updating unit, the updating unit being used for: When the asynchronous unbinding task fails, the task record corresponding to the third task identifier is searched in the database according to the third task identifier corresponding to the asynchronous unbinding task. Update the task status in the task record to the second status.

[0020] Thirdly, this application provides an unbinding processing device, comprising: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; and at least one memory connected to the at least one bus, wherein the processor is configured to: Receive an unbinding request instructing the target device to unbind from the elastic public IP address. The target device includes a load balancer and a listening device. The unbinding request carries the device identifier of the target device. Based on the device identifier and the elastic public IP, perform the first unbinding operation between the load balancer and the elastic public IP; After the first unbinding operation is completed, control the load balancer to perform the first target operation; Based on the device identifier and the elastic public IP, perform a second unbinding operation between the monitoring device and the elastic public IP; After the second unbinding operation is completed, the monitoring device is controlled to perform the second target operation.

[0021] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described unbinding method.

[0022] Compared with the prior art, the technical solution provided in this application has the following advantages: In this application embodiment, a debinding request is received indicating that a target device and an elastic public IP address should be unbound. The target device includes a load balancer and a monitoring device, and the debinding request carries the device identifier of the target device. Based on the device identifier and the elastic public IP address, a first debinding operation is performed between the load balancer and the elastic public IP address. After the first debinding operation is completed, the load balancer is controlled to perform a first target operation. Based on the device identifier and the elastic public IP address, a second debinding operation is performed between the monitoring device and the elastic public IP address. After the second debinding operation is completed, the monitoring device is controlled to perform a second target operation. Therefore, this application can first debind the association between the load balancer and the elastic public IP address, and then debind the association between the monitoring device and the elastic public IP address. After debinding the association between the load balancer and the elastic public IP address, the relevant operations after debinding the load balancer and the elastic public IP address are performed. After debinding the association between the monitoring device and the elastic public IP address, the relevant operations after debinding the monitoring device and the elastic public IP address are performed. As can be seen, this solution splits the originally centralized unbinding operation into two independent stages, avoiding the generation of a large number of concurrent tasks in an instant and improving the stability of the system. Attached Figure Description

[0023] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0024] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0025] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.

[0026] Figure 1 A flowchart illustrating an unbinding method provided in an embodiment of this application; Figure 2 A flowchart illustrating a second unbinding operation execution method provided in an embodiment of this application; Figure 3 A flowchart illustrating a task record generation method provided in an embodiment of this application; Figure 4A flowchart illustrating a task processing method provided in an embodiment of this application; Figure 5 A flowchart illustrating a task record detection method provided in an embodiment of this application; Figure 6 A flowchart illustrating a first unbinding operation execution method provided in an embodiment of this application; Figure 7 A flowchart illustrating a task status modification method provided in an embodiment of this application; Figure 8 This is a schematic flowchart of an unbinding processing device provided in an embodiment of this application; Figure 9 This is a schematic diagram of an unbinding processing device provided in an embodiment of this application. Detailed Implementation

[0027] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0028] The following disclosure provides numerous different embodiments or examples for implementing various structures of the invention. To simplify the disclosure, specific examples of components and arrangements are described below. These are merely examples and are not intended to limit the scope of the invention. Furthermore, reference numerals and / or letters may be repeated in different examples. Such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.

[0029] In the fields of cloud computing and network services, the binding and unbinding of Elastic IPs (EIPs) with load balancers and monitoring devices is a crucial mechanism for ensuring flexible scheduling of network resources. EIPs, as dynamically allocated public IP address resources, can quickly associate with load balancers to provide external services, while load balancers distribute traffic through monitoring devices. The binding relationship among these three directly affects the access path and resource utilization of services. In related technologies, network management systems employ a synchronous unbinding strategy, simultaneously unbinding the associations between load balancers, monitoring devices, and EIPs, and then centrally executing subsequent processing tasks after all unbinding operations are completed. However, because subsequent processing logic is executed only after all unbinding operations are completed, data processing tasks become highly concentrated in a short period, forming data processing peaks. This sudden surge in data processing volume puts unexpected pressure on system resources, leading to poor system stability.

[0030] To address the aforementioned issues, this application provides an unbinding method. This method first unbinds the association between the load balancer and the elastic public IP address, and then unbinds the association between the monitoring device and the elastic public IP address. After unbinding the load balancer and the elastic public IP address, the related operations after unbinding the load balancer and the elastic public IP address are executed. Similarly, after unbinding the monitoring device and the elastic public IP address, the related operations after unbinding the monitoring device and the elastic public IP address are executed. As can be seen, this solution splits the originally centralized unbinding operation into two independent stages, avoiding the instantaneous generation of a large number of concurrent tasks and improving system stability. The method is as follows... Figure 1 As shown, the specific steps include: Step 101: Receive an unbinding request instructing the target device to unbind from the Elastic Public IP address.

[0031] The target device includes a load balancer and at least one listening device, and the unbinding request includes the device identifier of the target device. Since the target device includes a load balancer and a listening device, the device identifier of the target device includes a first device identifier corresponding to the listening device and a second device identifier corresponding to the load balancer.

[0032] In this step, the unbinding request can be executed in several ways. It can be done manually, such as by operations personnel through the console; or it can be executed automatically by the system, for example, when a network attack is received, to prevent the threat from spreading, an automatic unbinding request is executed to unbind the load balancer from the elastic public IP. When the system receives an unbinding request instructing the target device to unbind from the elastic public IP, it executes the subsequent steps.

[0033] It should be noted that the executing entity of this application can be the resource management module of a cloud computing platform, through which relevant configuration data can be modified; it can also be a task scheduling system, which can also modify relevant configuration data; or it can be other systems, which are not limited here.

[0034] Step 102: Based on the device identifier and the elastic public IP, perform the first unbinding operation between the load balancer and the elastic public IP.

[0035] In this step, the association between the load balancer and the Elastic Public IP address may be in a configuration file or a database. Therefore, it is necessary to search both the configuration file and the database. The specific steps are as follows: For the database, fill in the second device identifier and the Elastic Public IP address corresponding to the load balancer into the query statement template to generate a query statement. Use the query statement to obtain the association between the load balancer and the Elastic Public IP address. For the configuration file, use a file reading function to parse and read the relevant fields, and extract the association between the load balancer and the Elastic Public IP address from the relevant fields based on the second device identifier and the Elastic Public IP address. After obtaining the association, it can be deleted. In this way, the association between the load balancer and the Elastic Public IP address is severed.

[0036] Step 103: After the first unbinding operation is completed, control the load balancer to execute the first target operation.

[0037] The first objective operation is the processing flow following the unbinding of the load balancer and the Elastic Public IP (EIP). This includes operations such as port resource release, routing table update, and session state clearing. Specifically, port resource release removes the binding between the load balancer's listening port and the EIP, preventing invalid port usage; routing table update removes the forwarding rules associated with the EIP from the load balancer's routing configuration and synchronizes them to the routing links of the backend server group; and session state clearing terminates all client connection sessions established through the EIP and releases cached connection metadata in memory.

[0038] In this step, it is checked whether the first unbinding operation has been completed. After the first unbinding operation is completed, the first target operation corresponding to the monitoring device is executed.

[0039] It should be noted that after the first unbinding operation is completed, the first target operation corresponding to the load balancer can be executed first, or step 104 can be executed first, or the first target operation corresponding to the load balancer and step 104 can be executed simultaneously. There is no limitation here.

[0040] Step 104: Based on the device identifier and the elastic public IP, perform the second unbinding operation between the monitoring device and the elastic public IP.

[0041] In this step, the association between the monitoring device and the Elastic Public IP address may be in a configuration file or a database. Therefore, it is necessary to search both the configuration file and the database. The specific steps are as follows: For the database, fill the first device identifier and the Elastic Public IP address corresponding to the monitoring device into the query statement template to generate a query statement. Use the query statement to obtain the association between the monitoring device and the Elastic Public IP address. For the configuration file, use a file reading function to parse and read the relevant fields, and extract the association between the monitoring device and the Elastic Public IP address from the relevant fields based on the first device identifier and the Elastic Public IP address. After obtaining the association, the association can be deleted, thereby severing the association between the monitoring device and the Elastic Public IP address.

[0042] Step 105: After the second unbinding operation is completed, control the listening device to perform the second target operation.

[0043] The second objective operation refers to the post-unbinding process of the monitoring device and the Elastic Public IP (EIP). Specifically, the second objective operation is the subsequent processing performed on the monitor after the unbinding action is completed. For example, the second objective operation includes a series of operations such as resetting the monitor's state, releasing port resources, and cleaning up configuration parameters. Specifically, resetting the monitor's state updates it from "running" to "stopped," terminating traffic reception and forwarding; releasing port resources reclaims the transport layer ports occupied by the monitor, releasing the binding relationship between the ports and the EIP; and cleaning up configuration parameters deletes metadata such as routing rules and health check rules associated with the original EIP from the monitor's configuration.

[0044] In this step, it is checked whether the second unbinding operation has been completed. After the second unbinding operation is completed, the second target operation corresponding to the monitoring device is executed.

[0045] In this embodiment, a debinding request is received instructing a target device to unbind from an Elastic Public IP address. The target device includes a load balancer and a monitoring device, and the debinding request carries the device identifier of the target device. Based on the device identifier and the Elastic Public IP address, a first debinding operation is performed between the load balancer and the Elastic Public IP address. After the first debinding operation is completed, the load balancer is controlled to perform the first target operation. Based on the device identifier and the Elastic Public IP address, a second debinding operation is performed between the monitoring device and the Elastic Public IP address. After the second debinding operation is completed, the monitoring device is controlled to perform the second target operation. Therefore, this application can first debind the association between the load balancer and the Elastic Public IP address, and then debind the association between the monitoring device and the Elastic Public IP address. After debinding the association between the load balancer and the Elastic Public IP address, the related operations after debinding the load balancer and the Elastic Public IP address are performed. After debinding the association between the monitoring device and the Elastic Public IP address, the related operations after debinding the monitoring device and the Elastic Public IP address are performed. Thus, this solution splits the originally centralized debinding operation into two independent stages, avoiding the instantaneous generation of a large number of concurrent tasks and improving system stability.

[0046] In this embodiment, when the device identifier includes a first device identifier corresponding to the monitoring device, an asynchronous unbinding task can be generated based on the first device identifier and the elastic public IP address, and added to a task cache queue. Based on this task cache queue, a second unbinding operation between the monitoring device and the elastic public IP address is executed, thereby ensuring orderly task execution. Therefore, this embodiment provides a method for executing a second unbinding operation, as follows: Figure 2 As shown, the specific steps include: Step 201: Determine the asynchronous unbinding task corresponding to the monitoring device based on the first device identifier and elastic public IP address of the monitoring device.

[0047] In this step, the first device identifier of the listening device is extracted from the unbinding request. The elastic public IP, the first device identifier, and other key information are combined to obtain structured data, which is then used to generate the asynchronous unbinding task corresponding to the listening device.

[0048] Other key information includes task type, number of retries, and other critical data.

[0049] Step 202: According to the preset rules, add the asynchronous unbinding task corresponding to the listening device to the task cache queue.

[0050] In this step, there can be one or more task cache queues, such as high-priority queues and long-duration queues. When there is only one task cache queue, the generated asynchronous unbinding task can be directly added to the task cache queue. When there are multiple task cache queues, the attribute information of the asynchronous unbinding task can be obtained, and then the corresponding task cache queue can be found based on the attribute information, and the asynchronous unbinding task can be added to that task cache queue.

[0051] The attribute information can include key parameters such as task priority and duration. For example, priority can be divided into urgent, high, medium and low levels, and duration can be estimated from historical data into short duration (<100ms), medium duration (100ms-1s), and long duration (>1s) ranges.

[0052] Step 203: Extract the asynchronous unbinding task from the task cache queue and execute the second unbinding operation between the listening device and the elastic public IP.

[0053] In this step, the system reads asynchronous unbinding tasks from the task cache queue according to a preset strategy. For example, it reads asynchronous unbinding tasks from the task cache queue according to the first-in, first-out principle. For each read task, the system parses the device identifier and elastic public IP within the task to find the association between the corresponding listening device and the EIP, and actively deletes the association record, ultimately completing the unbinding operation between the listening device and the EIP.

[0054] In this embodiment, when adding an asynchronous unbinding task to the task cache queue, it is also necessary to obtain the first task identifier corresponding to the asynchronous unbinding task, and then check whether the database contains a task record corresponding to the first task identifier. If it exists, no processing is performed; if it does not exist, a task record needs to be generated based on the first task identifier, task-related information, and a first state, so that the corresponding task record can be queried later based on the first task identifier. Therefore, this embodiment provides a task record generation method, which is as follows: Figure 3 As shown, the specific steps include: Step 301: Obtain the first task identifier corresponding to the asynchronous unbinding task.

[0055] In this step, the unbinding request also includes a task identifier, which can be a UUID submitted by the user or a temporary ID generated by the system. Therefore, the unbinding request can be parsed to obtain the first task identifier corresponding to the asynchronous unbinding task.

[0056] UUID (Universally Unique Identifier) ​​is a 128-bit numerical identifier generated by an algorithm, used to identify information in a computer system and ensure uniqueness in time and space.

[0057] Step 302: Check if there is a task record in the database corresponding to the first task identifier.

[0058] The task record includes at least a task identifier, status information, and other relevant information. Status information can be pending, executing, successful, or error. When a task's status is pending, it is waiting in the queue for execution. When a task's status is executing, it is in the execution phase. When a task's status is successful, it has been executed successfully. When a task's status is error, it has failed to execute. Other relevant information includes key data besides the task identifier and status information, such as the elastic public IP address, the monitoring device identifier, the operation type, and the execution source.

[0059] In this step, the first task identifier is compared with the task identifiers in the existing task records. If a matching task identifier exists, it is determined that a task record corresponding to the first task identifier already exists in the database. If no matching task identifier exists, it is determined that a task record corresponding to the first task identifier does not exist in the database.

[0060] Step 303: When there is no task record corresponding to the first task identifier in the database, generate a task record based on the first task identifier, the preset first state, and other relevant information.

[0061] The first status information is pending, which means that the task is in the queue waiting to be executed.

[0062] In this step, when the database does not contain a task record corresponding to the first task identifier, other relevant information is parsed from the asynchronous unbinding task. Since the task has not yet entered the execution phase, the status information is set to the first state, explicitly indicating that the task is currently in a queue waiting state. Afterwards, the first task identifier, the first state, and other extracted relevant information are structurally integrated to generate a complete task record.

[0063] Step 304: Store the task records in the database.

[0064] In this step, the task records are persistently stored in the database.

[0065] In this embodiment, before executing the asynchronous unbinding task in the task cache queue, the system needs to obtain the real-time status of the task and determine whether to execute the execution logic through a status judgment mechanism. For example, if the task status is "pending", the second unbinding operation is executed immediately. Therefore, this embodiment provides a task processing method, which is as follows: Figure 4 As shown, the specific steps include: Step 401: Extract the asynchronous unbinding task from the task cache queue to obtain the asynchronous unbinding task to be processed.

[0066] In this step, asynchronous unbinding tasks can be retrieved from the head of the task cache queue in a first-in, first-out (FIFO) order and identified as pending asynchronous unbinding tasks. Alternatively, other strategies can be used to retrieve pending asynchronous unbinding tasks from the task cache queue.

[0067] Step 402: Based on the second task identifier corresponding to the asynchronous unbinding task to be processed, search for the task status corresponding to the second task identifier in the database.

[0068] In this step, a pre-assigned unique identifier is parsed from the pending asynchronous unbinding tasks and used as the second task identifier. Then, the task record corresponding to the second task identifier is searched in the database, and the task status is retrieved from that record. This task status is the task status corresponding to the second task identifier.

[0069] Step 403: When the task status is in the first state, perform the second unbinding operation between the listening device and the elastic public IP according to the pending asynchronous unbinding task.

[0070] In this step, it is checked whether the task status determined in step 402 is the first state. When the task status is the first state, it indicates that the asynchronous unbinding task to be processed has not yet entered the execution stage and is in the ready state. At this time, the execution logic can continue to be executed. Therefore, in the asynchronous unbinding task, the first device identifier and elastic public IP can be obtained. Based on the device identifier and elastic public IP, the corresponding association relationship can be found and the association relationship can be deleted to unbind the listening device and elastic public IP.

[0071] In this application embodiment, to ensure the validity and data quality of task records in the database, it is necessary to periodically clean up expired records without corresponding running tasks. However, these expired records have existed for too long and have no corresponding tasks. Therefore, the database can be checked for the existence of such task records, and when such records exist, they can be cleaned up. Therefore, this application embodiment provides a task record detection method, as follows: Figure 5 As shown, the specific steps include: Step 501: In the database, retrieve the update time corresponding to each task record.

[0072] The update time can be flexibly defined according to actual business needs. It can be the time when the status of the task record is updated, or it can be the creation time of the task record.

[0073] In this step, each task record also includes an update time. Therefore, the update time corresponding to each task record can be obtained from each task record.

[0074] Step 502: Based on the update time corresponding to each task record, determine the preset target task record with the earliest update time.

[0075] In this step, task records are sorted in ascending order of their update time to generate an ordered sequence. Then, a predetermined number of task records at the top of the sequence are extracted and designated as target task records for priority processing of earlier tasks or batch data cleaning.

[0076] Step 503: When the target task record meets the preset conditions, a cleanup notification is generated so that relevant personnel can clean up the target task record.

[0077] The preset conditions can be flexibly defined according to actual business needs. They can be either tasks for which there is no corresponding task record, or tasks for which there is no corresponding task record and the duration of the task record is longer than the preset duration.

[0078] In this step, if the preset condition is that no task exists corresponding to the target task record, the task identifier corresponding to the target task record can be determined first, and the corresponding task can be found based on the task identifier. If no corresponding task exists, the target task record is determined to meet the preset condition; if a corresponding task exists, the target task record is determined to not meet the preset condition. When the target task record meets the preset condition, a cleanup notification is generated based on the task identifier of the target task record, so that relevant personnel can clean up the target task record.

[0079] In this embodiment, when the device identifier includes a second device identifier corresponding to the load balancer, the association can be deleted from the database and configuration file based on the second device identifier and the elastic public IP address, thereby unbinding the association between the load balancer and the elastic public IP address. Therefore, this embodiment provides a first unbinding operation execution method, as follows: Figure 6 As shown, the specific steps include: Step 601: Based on the second device identifier and the elastic public IP, find the association between the load balancer and the elastic public IP.

[0080] In this step, the load balancer's configuration file is typically stored within the load balancer itself. Therefore, by calling a preset interface, the load balancer's configuration file is retrieved. Then, based on the second device identifier and the elastic public IP address, the association between the load balancer and the elastic public IP address is found. Simultaneously, based on the second device identifier and the elastic public IP address, a corresponding query statement is generated. Then, based on this query statement, the association between the load balancer and the elastic public IP address is searched in the database.

[0081] Step 602: Delete the association to unbind the load balancer from the elastic public IP.

[0082] In this step, the association is deleted, thus unbinding the load balancer from the elastic public IP.

[0083] It should be noted that if the relationship obtained from the database is consistent with the relationship obtained from the configuration file, the relationship obtained from the database and the relationship obtained from the configuration file can be compared. If they are consistent, the relationship is deleted. If they are inconsistent, an alarm notification is generated so that relevant personnel can take appropriate action.

[0084] In this embodiment, the state of the asynchronous unbinding task can be modified based on the execution result. Therefore, this embodiment provides a method for modifying the task state, as follows: Figure 7 As shown, the specific steps include: Step 701: When the asynchronous unbinding task fails to execute, search for the task record corresponding to the third task identifier in the database based on the third task identifier corresponding to the asynchronous unbinding task.

[0085] The third task identifier, the second task identifier, and the first task identifier may or may not be the same task identifier. This depends on the asynchronous unbinding task they correspond to. For example, if the asynchronous unbinding task corresponding to the third task identifier is the same as the asynchronous unbinding task corresponding to the second task identifier, then the third task identifier and the second task identifier are the same identifier.

[0086] In this step, when the asynchronous unbinding task fails, the third task identifier corresponding to the asynchronous unbinding task is obtained, and the task record corresponding to the third task identifier is searched in the database.

[0087] Step 702: Update the task status in the task record to the second status.

[0088] The second status is error (execution failed), which indicates that the corresponding task is in the task failure stage.

[0089] In this step, the task status in the task record is changed to the second status.

[0090] Additionally, when an asynchronous unbinding task executes successfully, the database is searched for the task record corresponding to that task identifier, and the task status in that record is changed to "success" (execution successful). The database options are pending (waiting), executing (execution in progress), success (execution successful), and error (execution failed). If the asynchronous task is in a pending state and is not in the task cache queue, it needs to be added back to the cache queue and executed again. If the task is in an executing state and takes too long to execute, it indicates that the task is not performing as expected, and an exception should be thrown for developers to investigate. If the task is in an error state, the asynchronous task status needs to be changed back to pending, and it should be added to the cache queue and executed again.

[0091] like Figure 8 As shown, this application embodiment provides an unbinding processing device, which corresponds to the method embodiment, and specifically includes: The receiving unit 801 is used to receive an unbinding request that instructs a target device to unbind from an elastic public IP address. The target device includes a load balancer and a listening device. The unbinding request carries the device identifier of the target device. The first execution unit 802 is configured to perform a first unbinding operation between the load balancer and the elastic public IP based on the device identifier and the elastic public IP. The second execution unit 803 is used to control the load balancer to perform the first target operation after the first unbinding operation is completed; The third execution unit 804 is used to perform a second unbinding operation between the monitoring device and the elastic public IP based on the device identifier and the elastic public IP. The fourth execution unit 805 is used to control the listening device to perform the second target operation after the second unbinding operation is completed.

[0092] Optionally, if the device identifier includes a first device identifier corresponding to the monitoring device, the third execution unit 804 is configured to: Based on the first device identifier corresponding to the monitoring device and the elastic public IP, determine the asynchronous unbinding task corresponding to the monitoring device; According to preset rules, the asynchronous unbinding task corresponding to the monitoring device is added to the task cache queue; The asynchronous unbinding task is retrieved from the task cache queue, and the second unbinding operation between the listening device and the elastic public IP is executed.

[0093] Optionally, after determining the asynchronous unbinding task corresponding to the monitoring device, the device further includes a generation unit 806, which is used for: Obtain the first task identifier corresponding to the asynchronous unbinding task; Check if a task record corresponding to the first task identifier exists in the database; If no task record corresponding to the first task identifier exists in the database, a task record is generated based on the first task identifier, a preset first state, and other relevant information. The task records are stored in the database.

[0094] Optionally, the third execution unit 804 is used for: Extract the asynchronous unbinding task from the task cache queue to obtain the asynchronous unbinding task to be processed; Based on the second task identifier corresponding to the asynchronous unbinding task to be processed, the task status corresponding to the second task identifier is searched in the database; When the task status is in the first state, according to the pending asynchronous unbinding task, the second unbinding operation between the monitoring device and the elastic public IP is executed.

[0095] Optionally, the device further includes a detection unit 807, the detection unit 807 being used for: In the database, retrieve the update time corresponding to each task record; Based on the update time corresponding to each task record, determine the preset target task record with the earliest update time; When the target task record meets the preset conditions, a cleanup notification is generated so that relevant personnel can clean up the target task record.

[0096] Optionally, if the device identifier includes a second device identifier corresponding to the load balancer, the first execution unit 802 is configured to: Based on the second device identifier and the elastic public IP, find the association between the load balancer and the elastic public IP; The association is deleted to perform the first unbinding operation between the load balancer and the elastic public IP.

[0097] Optionally, the device further includes an update unit 808, the update unit 808 being used for: When the asynchronous unbinding task fails, the task record corresponding to the third task identifier is searched in the database according to the third task identifier corresponding to the asynchronous unbinding task. Update the task status in the task record to the second status.

[0098] like Figure 9 As shown in the figure, this application embodiment provides an unbinding processing device, including a processor 901, a communication interface 902, a memory 903, and a communication bus 904, wherein the processor 901, the communication interface 902, and the memory 903 communicate with each other through the communication bus 904. Memory 903 is used to store computer programs; In one embodiment of this application, when the processor 901 executes a program stored in the memory 903, it implements the unbinding processing method provided in any of the foregoing method embodiments, including: Receive an unbinding request instructing the target device to unbind from the elastic public IP address. The target device includes a load balancer and a listening device. The unbinding request carries the device identifier of the target device. Based on the device identifier and the elastic public IP, perform the first unbinding operation between the load balancer and the elastic public IP; After the first unbinding operation is completed, control the load balancer to perform the first target operation; Based on the device identifier and the elastic public IP, perform a second unbinding operation between the monitoring device and the elastic public IP; After the second unbinding operation is completed, the monitoring device is controlled to perform the second target operation.

[0099] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps performed by the unbinding processing method provided in any of the foregoing method embodiments.

[0100] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0101] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented using software plus a general-purpose hardware platform, or of course, using hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the related technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0102] It should be understood that the terminology used herein is for the purpose of describing particular exemplary embodiments only and is not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms “a,” “an,” and “described” as used herein may also include the plural forms. The terms “comprising,” “including,” “containing,” and “having” are inclusive and therefore indicate the presence of the stated features, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, elements, components, and / or combinations thereof. The method steps, processes, and operations described herein are not construed as requiring them to be performed in a particular order described or illustrated unless the order of performance is explicitly indicated. It should also be understood that additional or alternative steps may be used.

[0103] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A method for unbinding, characterized in that, The method includes: Receive an unbinding request instructing the target device to unbind from the elastic public IP address. The target device includes a load balancer and a monitoring device. The unbinding request carries the device identifier of the target device. The device identifier includes a first device identifier corresponding to the monitoring device and a second device identifier corresponding to the load balancer. Based on the device identifier and the elastic public IP, perform the first unbinding operation between the load balancer and the elastic public IP; After the first unbinding operation is completed, control the load balancer to perform the first target operation; Based on the device identifier and the elastic public IP, a second unbinding operation is performed between the monitoring device and the elastic public IP. The second unbinding operation is performed after the first unbinding operation is performed. After the second unbinding operation is completed, control the listening device to perform the second target operation; The step of performing a second unbinding operation between the monitoring device and the elastic public IP based on the device identifier and the elastic public IP includes: Based on the first device identifier corresponding to the monitoring device and the elastic public IP, determine the asynchronous unbinding task corresponding to the monitoring device; According to preset rules, the asynchronous unbinding task corresponding to the monitoring device is added to the task cache queue; The asynchronous unbinding task is retrieved from the task cache queue, and the second unbinding operation between the listening device and the elastic public IP is executed.

2. The method according to claim 1, characterized in that, After determining the asynchronous unbinding task corresponding to the monitoring device, the method further includes: Obtain the first task identifier corresponding to the asynchronous unbinding task; Check if a task record corresponding to the first task identifier exists in the database; If no task record corresponding to the first task identifier exists in the database, a task record is generated based on the first task identifier, a preset first state, and other relevant information. The task records are stored in the database.

3. The method according to claim 2, characterized in that, The step of retrieving the asynchronous unbinding task from the task cache queue and executing the second unbinding operation between the listening device and the elastic public IP includes: Extract the asynchronous unbinding task from the task cache queue to obtain the asynchronous unbinding task to be processed; Based on the second task identifier corresponding to the asynchronous unbinding task to be processed, the task status corresponding to the second task identifier is searched in the database; When the task status is in the first state, according to the pending asynchronous unbinding task, the second unbinding operation between the monitoring device and the elastic public IP is executed.

4. The method according to claim 2, characterized in that, The method further includes: In the database, retrieve the update time corresponding to each task record; Based on the update time corresponding to each task record, determine the preset target task record with the earliest update time; When the target task record meets the preset conditions, a cleanup notification is generated so that relevant personnel can clean up the target task record.

5. The method according to claim 1, characterized in that, The step of performing a first unbinding operation between the load balancer and the elastic public IP based on the device identifier and the elastic public IP includes: Based on the second device identifier and the elastic public IP, find the association between the load balancer and the elastic public IP; The association is deleted to perform the first unbinding operation between the load balancer and the elastic public IP.

6. The method according to claim 1, characterized in that, The method further includes: When the asynchronous unbinding task fails, the task record corresponding to the third task identifier is searched in the database according to the third task identifier corresponding to the asynchronous unbinding task. Update the task status in the task record to the second status.

7. A device for untying and binding, characterized in that, The device includes: A receiving unit is configured to receive an unbinding request that instructs a target device to unbind from an elastic public IP address. The target device includes a load balancer and a listening device. The unbinding request carries a device identifier of the target device. The device identifier includes a first device identifier corresponding to the listening device and a second device identifier corresponding to the load balancer. The first execution unit is configured to perform a first unbinding operation between the load balancer and the elastic public IP based on the device identifier and the elastic public IP. The second execution unit is used to control the load balancer to perform the first target operation after the first unbinding operation is completed; The third execution unit is configured to perform a second unbinding operation between the monitoring device and the elastic public IP address based on the device identifier and the elastic public IP address. The second unbinding operation is performed after the first unbinding operation is executed. The second unbinding operation includes: determining the asynchronous unbinding task corresponding to the monitoring device based on the first device identifier corresponding to the monitoring device and the elastic public IP address; adding the asynchronous unbinding task corresponding to the monitoring device to a task cache queue according to a preset rule; retrieving the asynchronous unbinding task from the task cache queue and executing the second unbinding operation between the monitoring device and the elastic public IP address. The fourth execution unit is used to control the listening device to perform the second target operation after the second unbinding operation is completed.

8. A device for unbinding and processing, characterized in that, include: At least one communication interface; At least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; At least one memory connected to the at least one bus, wherein the processor is configured to: Receive an unbinding request instructing the target device to unbind from the elastic public IP address. The target device includes a load balancer and a monitoring device. The unbinding request carries the device identifier of the target device. The device identifier includes a first device identifier corresponding to the monitoring device and a second device identifier corresponding to the load balancer. Based on the device identifier and the elastic public IP, perform the first unbinding operation between the load balancer and the elastic public IP; After the first unbinding operation is completed, control the load balancer to perform the first target operation; Based on the device identifier and the elastic public IP address, a second unbinding operation is performed between the monitoring device and the elastic public IP address. This second unbinding operation is performed after the first unbinding operation and includes: determining the asynchronous unbinding task corresponding to the monitoring device based on the first device identifier and the elastic public IP address; adding the asynchronous unbinding task to a task cache queue according to preset rules; retrieving the asynchronous unbinding task from the task cache queue and performing the second unbinding operation between the monitoring device and the elastic public IP address. After the second unbinding operation is completed, the monitoring device is controlled to perform the second target operation.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the unbinding processing method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method and system for conveniently and quickly modifying IP of elastic network card in public cloud

    CN112118327A