A controller speed limiting method, device, equipment and product
By obtaining the key value and return signature in the controller's rate limiting method, determining the re-enqueue time, and performing a delayed enqueue operation, the deadlock problem caused by insufficient rate limiting force of the controller is solved, improving the controller's operating efficiency and reducing resource consumption.
Patent Information
- Application Number
- CN202411785763.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2044-12-06
AI Technical Summary
In existing technologies, the rate limiting scheme of the controller is not strong enough to limit the rate of reconcile failure, which leads to deadlock and waste of computing and network resources.
By obtaining the key value and return signature of the resource to be re-enqueued, the re-enqueuing time is determined, and a delayed enqueuing operation is performed to avoid deadlock, improve controller operating efficiency, and reduce resource consumption.
This effectively avoids deadlocks caused by the inability to meet external prerequisites, and reduces the consumption of computing and network resources in the controller and cluster.
Smart Images

Figure CN119583459B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of cloud computing, big data, and edge computing technology, and in particular to a controller rate limiting method, device, equipment, and product. Background Technology
[0002] The controller is a crucial component in Kubernetes. It reconciles the resources in Kubernetes (K8s) with their desired and actual states to ensure the cluster's desired state matches the observed state. For example... Figure 2 As shown, the controller mainly consists of two parts: Informer and Workqueue. Existing controller rate limiting schemes have a comprehensive rate limiting mechanism for Workqueue, including limiting resources for requeuing. However, they do not take into account that Reconcile failure may be due to deadlock caused by the failure to meet the external preconditions required for updating the state. Therefore, the rate limiting is not strong enough and the effect is not obvious, resulting in the waste of computing and network resources in the controller and cluster. Summary of the Invention
[0003] The purpose of this invention is to provide a controller rate limiting method, device, equipment, and product to solve the problem in the prior art where tuning failure may be caused by deadlock due to the inability to meet the external prerequisites required for updating the state. As a result, the rate limiting is not strong enough and the effect is not obvious, leading to the waste of computing and network resources in the controller and cluster.
[0004] To achieve the above objectives, embodiments of the present invention provide a controller speed limiting method, comprising:
[0005] Obtain the key value and return feature code of the resource to be re-enqueued; wherein, the return feature code is sent by the tuning process according to the return point of the resource to be re-enqueued in the tuning process, and each return point of the tuning process corresponds to one return feature code.
[0006] The re-enqueuing time of the resource to be re-enqueued is determined based on the key value and the returned feature code;
[0007] Based on the re-enqueue time, perform a delayed enqueue operation on the resource to be re-enqueueed.
[0008] Optionally, in the method, the returned feature code is associated with one or more of the following information:
[0009] The code order in the code logic of the tuning process;
[0010] The code corresponding to the return point in the code logic;
[0011] The line number of the code corresponding to the return point.
[0012] Optionally, the method, wherein determining the re-enqueuing time of the resource to be re-enqueued based on the key value and the returned feature code includes:
[0013] Based on the key value and the return feature code, determine the return frequency of the delayed enqueuing process for the resource to be re-enqueued, and determine the resource record change status of the resource to be re-enqueued.
[0014] The re-enqueuing time of the resource to be re-enqueued is determined based on the return frequency and the resource record change status.
[0015] Optionally, in the method, the resource record change status includes one or more of the following:
[0016] The key value and the returned feature code of the resource to be re-enqueued have no pre-acquired first record state;
[0017] The key value and the returned feature code of the resource to be re-enqueued both have a second record state that has been pre-acquired;
[0018] The key value of the resource to be re-enqueued has a pre-acquired record, and the returned feature code has no pre-acquired record in the third record state.
[0019] Optionally, the method, wherein determining the return frequency of the delayed enqueuing process for the resource to be re-enqueued, based on the key value and the return feature code, includes:
[0020] When the resource record change status is the first record status, the return frequency is determined to be 1;
[0021] When the resource record change state is the second record state, the return frequency is determined to be the previous return frequency increased by 1; wherein, the previous return frequency is the return frequency determined in the case of the previous acquisition of the return feature code;
[0022] When the resource record change status is the third record status, the return frequency is determined to be 1.
[0023] Optionally, the method, wherein determining the re-enqueuing time of the resource to be re-enqueued based on the return frequency and the resource record change status includes:
[0024] When the resource record change status is the first record status, the first time is determined as the re-enqueue time;
[0025] When the resource record change state is the second record state, the later of the first time and the second time is determined as the re-enqueue time; wherein, the second time is the re-enqueue time determined in the case of the last acquisition of the return feature code;
[0026] If the resource record change status is the third record status, the first time is determined as the re-enqueue time;
[0027] Wherein, the first time is the point in time after the current time and the delay duration is the duration obtained by inputting the return frequency into the binary exponential backoff algorithm.
[0028] Optionally, the method further includes, when the resource record change state is a third record state:
[0029] The resource to be re-enqueued will be immediately re-enqueued according to the previous key value.
[0030] Optionally, the method, wherein performing a delayed enqueue operation on the resource to be requeued based on the requeue time, includes:
[0031] At the re-enqueue time, the key-value pair is sent to the work queue by starting a separate process and / or thread.
[0032] To achieve the above objectives, embodiments of the present invention also provide a controller speed limiting device, comprising:
[0033] The first acquisition module is used to acquire the key value and return feature code of the resource to be re-enqueued; wherein, the return feature code is sent by the tuning process according to the return point of the resource to be re-enqueued in the tuning process, and each return point of the tuning process corresponds to one return feature code.
[0034] The first determining module is used to determine the re-enqueuing time of the resource to be re-enqueued based on the key value and the returned feature code;
[0035] The first processing module is used to perform a delayed enqueue operation on the resource to be requeued based on the requeue time.
[0036] To achieve the above objectives, embodiments of the present invention also provide an electronic device, including: a processor, a memory, and a program or instructions stored in the memory and executable on the processor; wherein, when the processor executes the program or instructions, it implements the controller speed limiting method as described above.
[0037] To achieve the above objectives, embodiments of the present invention also provide a readable storage medium having a program or instructions stored thereon, wherein the program or instructions, when executed by a processor, implement the steps in the controller rate limiting method as described above.
[0038] To achieve the above objectives, embodiments of the present invention also provide a computer program product, which includes computer instructions that, when executed by a processor, implement the steps of the controller speed limiting method as described above.
[0039] The beneficial effects of the above-described technical solution of the present invention are as follows:
[0040] This invention obtains the return point of the resource in the tuning process based on the key value and return feature code of the resource to be re-enqueued, determines the re-enqueuing time, and performs a delayed enqueuing operation at the re-enqueuing time. This allows for rate limiting when the external preconditions required for updating the state cannot be met during the tuning process, thus avoiding deadlock and solving the problem of wasted computing and network resources in the controller and cluster. Attached Figure Description
[0041] Figure 1 This is a schematic diagram of the controller speed limiting method according to an embodiment of the present invention;
[0042] Figure 2 This is a schematic diagram of existing technology;
[0043] Figure 3 This is a schematic diagram of the tuning process of the controller speed limiting method according to an embodiment of the present invention;
[0044] Figure 4 This is a flowchart of the controller speed limiting method described in an embodiment of the present invention;
[0045] Figure 5 This is a schematic diagram of the controller speed limiting device according to an embodiment of the present invention. Detailed Implementation
[0046] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.
[0047] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of the invention. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification do not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments.
[0048] In various embodiments of the present invention, it should be understood that the sequence number of each process described below does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0049] In addition, the terms "system" and "network" are often used interchangeably in this article.
[0050] In the embodiments provided in this application, it should be understood that "B corresponding to A" means that B is associated with A, and B can be determined based on A. However, it should also be understood that determining B based on A does not mean determining B solely based on A; B can also be determined based on A and / or other information.
[0051] For ease of understanding, the following describes some aspects of the embodiments of the present invention:
[0052] like Figure 1 As shown, an embodiment of the present invention provides a controller speed limiting method, which includes:
[0053] S10, obtain the key value and return feature code of the resource to be re-enqueued; wherein, the return feature code is sent by the tuning process according to the return point of the resource to be re-enqueued in the tuning process, and each return point of the tuning process corresponds to one return feature code.
[0054] It should be noted that, as Figure 3 As shown, a Feedback Module is added after multiple processors in the reconcile process. If the required external preconditions remain unchanged, the same code will return from the reconcile process at the same point for the same resource. Therefore, if the same resource returns at the same location in the reconcile, it can be determined that the reconcile is invalid. By setting a corresponding return signature at each return point, the Feedback Module can determine the specific return point based on the return signature, thereby performing targeted rate limiting. This can improve the controller's operating efficiency and reduce the consumption of computing and network resources in the cluster.
[0055] S20, determine the re-enqueuing time of the resource to be re-enqueued based on the key value and the returned feature code;
[0056] It should be noted that the feedback module maintains a map (key-value pair). The key of the map is the key of the resource to be re-enqueued as mentioned in the reconcile output parameter. The value of the map is a struct that includes the return signature, a number indicating the number of times the return signature appears, and the re-enqueuing time.
[0057] S30, based on the re-enqueue time, perform a delayed enqueue operation on the resource to be re-enqueueed.
[0058] In this embodiment, the return point of the resource in the tuning process is obtained according to the key value and the return feature code of the resource to be re-enqueued, the re-enqueuing time is determined, and a delayed enqueuing operation is performed at the re-enqueuing time. This allows for rate limiting in the tuning process when the external preconditions required for updating the state cannot be met, thus avoiding deadlock and solving the problem of wasted computing and network resources in the controller and cluster.
[0059] Optionally, in the method, the returned feature code is associated with one or more of the following information:
[0060] The code order in the code logic of the tuning process;
[0061] The code corresponding to the return point in the code logic;
[0062] The line number of the code corresponding to the return point.
[0063] In this embodiment, the return feature code is set in the tuning process. It can be numbered according to the order of the code, or the line number of the code can be directly used as the return feature code, or the output of the hash function after inputting the code corresponding to the return point can be used as the return feature code.
[0064] Optionally, the method, wherein step S20 includes:
[0065] Based on the key value and the return feature code, determine the return frequency of the delayed enqueuing process for the resource to be re-enqueued, and determine the resource record change status of the resource to be re-enqueued.
[0066] The re-enqueuing time of the resource to be re-enqueued is determined based on the return frequency and the resource record change status.
[0067] In this embodiment, the occurrence of the key value and the occurrence of the return feature code are recorded, and the return frequency is determined to obtain the re-enqueue time.
[0068] Optionally, in the method, the resource record change status includes one or more of the following:
[0069] The key value and the returned feature code of the resource to be re-enqueued have no pre-acquired first record state;
[0070] The key value and the returned feature code of the resource to be re-enqueued both have a second record state that has been pre-acquired;
[0071] The key value of the resource to be re-enqueued has a pre-acquired record, and the returned feature code has no pre-acquired record in the third record state.
[0072] In this embodiment, the first recording state is when the key value appears for the first time, and the return feature code also appears for the first time; the second recording state is when the key value has been pre-acquired and the return feature code has not appeared for the first time, meaning that the same return point in the tuning process has been returned more than once; the third recording state is when the key value is not appearing for the first time, but the return feature code is appearing for the first time, meaning that after returning at a certain return point in the tuning process, the external preconditions changed, and it returned for the first time at another return point. Figure 4 As shown, after the process starts, in step S10, the key value of the resource to be re-enqueued and the return feature code are obtained. The key is used to query whether there is already a record, and the return feature code is used to determine whether they are consistent, thus dividing the process into the three states mentioned above.
[0073] Optionally, the method, wherein determining the return frequency of the delayed enqueuing process for the resource to be re-enqueued, based on the key value and the return feature code, includes:
[0074] When the resource record change status is the first record status, the return frequency is determined to be 1;
[0075] When the resource record change state is the second record state, the return frequency is determined to be the previous return frequency increased by 1; wherein, the previous return frequency is the return frequency determined in the case of the previous acquisition of the return feature code;
[0076] When the resource record change status is the third record status, the return frequency is determined to be 1.
[0077] In this embodiment, when the return feature code appears for the first time, the return frequency is set to 1. If the same return feature code appears again or multiple times, the return frequency is increased by 1. Generally speaking, if the return feature code changes, it indicates that the problem with the previous return point has been resolved. The return feature code is then updated to the newly appeared return feature code, and the corresponding return frequency is set to 1. Figure 4 As shown, the first record state is when the query based on the key returns no result, and the frequency is 1; the second record state is when the query based on the key returns yes result and the return value for the signature is yes result, and the frequency in the record is incremented by 1; the third record state is when the query based on the key returns yes result and the return value for the signature is no result, and the frequency in the record is reset to 1.
[0078] Optionally, the method, wherein determining the re-enqueuing time of the resource to be re-enqueued based on the return frequency and the resource record change status includes:
[0079] When the resource record change status is the first record status, the first time is determined as the re-enqueue time;
[0080] When the resource record change state is the second record state, the later of the first time and the second time is determined as the re-enqueue time; wherein, the second time is the re-enqueue time determined in the case of the last acquisition of the return feature code;
[0081] If the resource record change status is the third record status, the first time is determined as the re-enqueue time;
[0082] Wherein, the first time is the point in time after the current time and the delay duration is the duration obtained by inputting the return frequency into the binary exponential backoff algorithm.
[0083] In this embodiment, in the first recording state, the return frequency 1 is input into the binary exponential backoff algorithm to obtain the re-enqueue time; in the second recording state, the same return feature code appears again or multiple times, meaning the return point remains unchanged in the tuning process, and the required external preconditions remain unchanged. Therefore, the later of the first and second times is used as the re-enqueue time, thereby maintaining a longer rate-limiting action and reducing the consumption of computing and network resources in the cluster; in the third recording state, the return feature code changes, meaning the problem of the return point corresponding to the previous return feature code has been resolved. Therefore, the first time is used as the re-enqueue time. Figure 4 As shown, in step S20, in the first recording state, the time to re-enqueue is calculated, and two items (return frequency and re-enqueue time) are added to the record; in the second recording state, the enqueue time is calculated based on the latest frequency, and if the enqueue time is later than the existing enqueue time, the record is updated (updating the re-enqueue time) and the enqueue time in the re-enqueue operation is updated; in the third recording state, the record is updated based on the latest frequency.
[0084] Optionally, the method further includes, when the resource record change state is a third record state:
[0085] The resource to be re-enqueued will be immediately re-enqueued according to the previous key value.
[0086] In this embodiment, under the third recording state, the returned feature code has changed, meaning the problem with the return point corresponding to the previously mentioned returned feature code has been resolved. Therefore, the resource to be re-enqueued corresponding to the previous key value acquisition is immediately re-enqueued without delay, improving the controller's operating efficiency. Figure 4 As shown, in step S30, under the third record state, the original delayed enqueue operation is immediately executed and the delayed enqueue operation is re-executed according to the latest re-enqueue time.
[0087] Optionally, the method, wherein step S30 includes:
[0088] At the re-enqueue time, the key-value pair is sent to the work queue by starting a separate process and / or thread.
[0089] In this embodiment, performing the delayed enqueue operation for the resource to be requeued involves sending the key-value pair to the work queue by starting a separate process and / or thread, and deleting the cached information corresponding to the resource to be requeued after the delayed enqueue operation is completed. Figure 4 In step S30, under the first recording state, a delayed enqueue operation is performed on the key according to the enqueue time; under the second recording state, a delayed enqueue operation is performed on the key according to the enqueue time.
[0090] It should be noted that this embodiment of the invention also provides an example in which the controller, when processing obj (target file)1, includes the following logic: it is desired to create a Pod (Pod is the basic scheduling unit in Kubernetes), and after successful creation, obj1 is processed.
[0091] After the controller sends a CREATE request to the Kubernetes cluster, the Kubernetes control logic completes the Pod creation. The controller then executes reconcile to check if the corresponding Pod is in a running state. If it is running, it will execute subsequent processing logic. If the Pod's state is not running, an error will be reported, and it will be re-enqueued for processing.
[0092] If a Pod cannot complete initialization during creation, such as when there are no schedulable nodes, the Pod will remain in a Pending state.
[0093] The controller executes the request to the Pod status during each reconcile, finds the Pod Pending error, the object key, and the return signature (in this example, the line number of the return point is used as the return signature), and then enters the feedback module. The feedback module calculates the first time of the object based on the key and the return signature, using the return frequency (how many times this object has returned in reconcile due to this error), and delays the re-enqueueing time of this object to that moment.
[0094] If the controller reconciles obj1 again before the re-enqueue time arrives, and the Pod is still in a Pending state, it will continue to return an error at the same location during the reconcile. The feedback module updates and maintains the data structure (return frequency) and calculates the first time. If this time is later than the existing re-enqueue time of obj1 (there is a possibility of early or late due to the exponential backoff algorithm), it updates the re-enqueue time of obj1 in memory and selects a later time for enqueueing.
[0095] If a Pod becomes running, the controller will immediately reconcile obj1 due to the update of the Pod's running state. It does not need to wait for the re-enqueue time to execute the reconcile, which will continue the control logic.
[0096] This embodiment of the invention also provides an example where the controller contains logic to update obj2. When a large number of controllers in the cluster simultaneously want to update obj2, only one controller can successfully update it at any given time. In this case, the update request for obj2 in this controller has a high probability of returning an error. Therefore, the controller will execute the code to update obj2 and return during each reconcile.
[0097] The controller executes the update pod during each reconcile, detects the update request, and therefore returns an error during reconcile. It then sends the object key, the return signature (the line number of the code at which the error occurred), and enters the feedback module. The feedback module calculates the return frequency (how many times this object has returned during reconcile due to this error) based on the key and return signature, obtains the first instance of the object, and delays the re-enqueueing time of this object until that moment.
[0098] If the controller reconciles obj2 again before the re-enqueue time arrives, but reports an error for another request, the error will be reported at another return point in the reconcile. The feedback module updates and maintains the data structure (return signature and return frequency) and calculates the first time, immediately executes the previous re-enqueue operation, and updates the re-enqueue time of obj2 in memory.
[0099] like Figure 5 As shown, in order to achieve the above objectives, embodiments of the present invention also provide a controller speed limiting device, comprising:
[0100] The first acquisition module 501 is used to acquire the key value and return feature code of the resource to be re-enqueued; wherein, the return feature code is sent by the tuning process according to the return point of the resource to be re-enqueued in the tuning process, and each return point of the tuning process corresponds to one return feature code.
[0101] The first determining module 502 is used to determine the re-enqueuing time of the resource to be re-enqueued based on the key value and the returned feature code.
[0102] The first processing module 503 is used to perform a delayed enqueuing operation on the resource to be requeued according to the requeuing time.
[0103] Optionally, in the aforementioned apparatus, the returned feature code is associated with one or more of the following information:
[0104] The code order in the code logic of the tuning process;
[0105] The code corresponding to the return point in the code logic;
[0106] The line number of the code corresponding to the return point.
[0107] Optionally, in the aforementioned apparatus, the first determining module 502 includes:
[0108] The first determining unit is used to determine the return frequency of the delayed enqueuing process of the resource to be re-enqueued based on the key value and the return feature code, and to determine the resource record change status of the resource to be re-enqueued.
[0109] The second determining unit is used to determine the re-enqueuing time of the resource to be re-enqueued based on the return frequency and the resource record change status.
[0110] Optionally, in the aforementioned apparatus, the resource record change status includes one or more of the following:
[0111] The key value and the returned feature code of the resource to be re-enqueued have no pre-acquired first record state;
[0112] The key value and the returned feature code of the resource to be re-enqueued both have a second record state that has been pre-acquired;
[0113] The key value of the resource to be re-enqueued has a pre-acquired record, and the returned feature code has no pre-acquired record in the third record state.
[0114] Optionally, in the apparatus, the first determining unit includes:
[0115] A first determining component is configured to determine that the return frequency is 1 when the resource record change state is a first record state;
[0116] The second determining component is configured to determine, when the resource record change state is the second record state, that the return frequency is the previous return frequency increased by 1; wherein, the previous return frequency is the return frequency determined in the case of the previous acquisition of the return feature code;
[0117] The third determining component is used to determine the return frequency as 1 when the resource record change state is the third record state.
[0118] Optionally, in the aforementioned apparatus, the second determining unit comprises:
[0119] The fourth determining component is used to determine the first time as the re-enqueue time when the resource record change state is the first record state;
[0120] The fifth determining component is used to determine the later of the first time and the second time as the re-enqueue time when the resource record change state is the second record state; wherein the second time is the re-enqueue time determined when the return feature code was obtained last time;
[0121] The sixth determining component is used to determine the first time as the re-enqueue time when the resource record change status is the third record status;
[0122] Wherein, the first time is the point in time after the current time and the delay duration is the duration obtained by inputting the return frequency into the binary exponential backoff algorithm.
[0123] Optionally, the device further includes:
[0124] The second processing module is used to immediately perform a re-enqueue operation on the resource to be re-enqueued corresponding to the previous key value acquisition.
[0125] Optionally, in the aforementioned apparatus, the first processing module 503 includes:
[0126] The first sending unit is configured to send the key value to the work queue by initiating an independent process and / or thread during the re-enqueue time.
[0127] To achieve the above objectives, embodiments of the present invention also provide an electronic device, including: a processor, a memory, and a program or instructions stored in the memory and executable on the processor; wherein, when the processor executes the program or instructions, it implements the controller speed limiting method as described above.
[0128] To achieve the above objectives, embodiments of the present invention also provide a readable storage medium having a program or instructions stored thereon, wherein the program or instructions, when executed by a processor, implement the steps in the controller rate limiting method as described above.
[0129] It should be further noted that the terminals described in this specification include, but are not limited to, smartphones, tablets, etc., and many of the functional components described are referred to as modules in order to emphasize the independence of their implementation.
[0130] In this embodiment of the invention, the module can be implemented in software so that it can be executed by various types of processors. For example, an identified executable code module may include one or more physical or logical blocks of computer instructions, which may be constructed as objects, procedures, or functions. Nevertheless, the executable code of the identified module does not need to be physically located together, but may include different instructions stored in different bits, which, when logically combined, constitute the module and achieve the module's intended purpose.
[0131] In practice, an executable code module can be a single instruction or many instructions, and can even be distributed across multiple different code segments, different programs, and across multiple memory devices. Similarly, operational data can be identified within the module and can be implemented in any suitable form and organized within any suitable type of data structure. This operational data can be collected as a single dataset or distributed across different locations (including different storage devices), and can exist, at least in part, solely as electronic signals within the system or network.
[0132] When a module can be implemented using software, considering the current level of hardware technology, modules that can be implemented in software can be implemented using hardware circuits by those skilled in the art to achieve the corresponding functions, without considering cost. These hardware circuits include conventional very-large-scale integrated circuits (VLSI) or gate arrays, as well as existing semiconductors such as logic chips and transistors, or other discrete components. Modules can also be implemented using programmable hardware devices, such as field-programmable gate arrays, programmable array logic, and programmable logic devices.
[0133] To achieve the above objectives, embodiments of the present invention also provide a computer program product, which includes computer instructions that, when executed by a processor, implement the steps of the controller speed limiting method as described above.
[0134] The exemplary embodiments described above are with reference to the accompanying drawings. Many different forms and embodiments are feasible without departing from the spirit and teachings of the invention. Therefore, the invention should not be construed as limiting the exemplary embodiments set forth herein. Rather, these exemplary embodiments are provided to make the invention complete and convey the scope of the invention to those skilled in the art. In these drawings, component dimensions and relative dimensions may be exaggerated for clarity. The terminology used herein is for the purpose of describing particular exemplary embodiments only and is not intended to be limiting. As used herein, unless clearly indicated otherwise, the singular forms “a,” “an,” and “the” are intended to include all such forms. It will be further understood that the terms “comprising” and / or “including”, when used in this specification, indicate the presence of the stated features, integers, steps, operations, components, and / or elements, but do not exclude the presence or addition of one or more other features, integers, steps, operations, components, and / or groups thereof. Unless otherwise indicated, when stated, a range of values includes the upper and lower limits of the range and any subranges in between.
[0135] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A controller speed limiting method, characterized in that, include: Obtain the key value and return feature code of the resource to be re-enqueued; wherein, the return feature code is sent by the tuning process according to the return point of the resource to be re-enqueued in the tuning process, and each return point of the tuning process corresponds to one return feature code. The re-enqueuing time of the resource to be re-enqueued is determined based on the key value and the returned feature code; wherein, the re-enqueuing time of the resource to be re-enqueued is determined based on the resource record change status of the resource to be re-enqueued, and the resource record change status is determined based on the key value and the returned feature code; Based on the re-enqueue time, perform a delayed enqueue operation on the resource to be re-enqueueed; The resource record change status includes one or more of the following: The key value and the returned feature code of the resource to be re-enqueued have no pre-acquired first record state; The key value and the returned feature code of the resource to be re-enqueued both have a second record state that has been pre-acquired; The key value of the resource to be re-enqueued has a pre-acquired record, and the returned feature code has no pre-acquired record in the third record state. Based on the key value and the return signature, the return frequency of the delayed enqueuing process for the resource to be re-enqueued is determined, including: When the resource record change status is the first record status, the return frequency is determined to be 1; When the resource record change state is the second record state, the return frequency is determined to be the previous return frequency increased by 1; wherein, the previous return frequency is the return frequency determined in the case of the previous acquisition of the return feature code; When the resource record change status is the third record status, the return frequency is determined to be 1.
2. The method according to claim 1, characterized in that, The returned feature code is associated with one or more of the following information: The code order in the code logic of the tuning process; The code corresponding to the return point in the code logic; The line number of the code corresponding to the return point.
3. The method according to claim 1, characterized in that, Determining the re-enqueuing time of the resource to be re-enqueued based on the key value and the returned feature code includes: Based on the key value and the return feature code, determine the return frequency of the delayed enqueuing process for the resource to be re-enqueued, and determine the resource record change status of the resource to be re-enqueued. The re-enqueuing time of the resource to be re-enqueued is determined based on the return frequency and the resource record change status.
4. The method according to claim 1, characterized in that, Based on the return frequency and the resource record change status, the re-enqueuing time of the resource to be re-enqueued is determined, including: When the resource record change status is the first record status, the first time is determined as the re-enqueue time; When the resource record change state is the second record state, the later of the first time and the second time is determined as the re-enqueue time; wherein, the second time is the re-enqueue time determined in the case of the last acquisition of the return feature code; If the resource record change status is the third record status, the first time is determined as the re-enqueue time; Wherein, the first time is the point in time after the current time and the delay duration is the duration obtained by inputting the return frequency into the binary exponential backoff algorithm.
5. The method according to claim 4, characterized in that, When the resource record change status is the third record status, the method further includes: The resource to be re-enqueued will be immediately re-enqueued according to the previous key value.
6. The method according to claim 1, characterized in that, The step of performing a delayed enqueuing operation on the resource to be requeued based on the requeuing time includes: At the re-enqueue time, the key-value pair is sent to the work queue by starting a separate process and / or thread.
7. A controller speed limiting device, characterized in that, include: The first acquisition module is used to acquire the key value and return feature code of the resource to be re-enqueued; wherein, the return feature code is sent by the tuning process according to the return point of the resource to be re-enqueued in the tuning process, and each return point of the tuning process corresponds to one return feature code. The first determining module is used to determine the re-enqueuing time of the resource to be re-enqueued based on the key value and the returned feature code; wherein, the re-enqueuing time of the resource to be re-enqueued is determined based on the resource record change status of the resource to be re-enqueued, and the resource record change status is determined based on the key value and the returned feature code; The first processing module is configured to perform a delayed enqueuing operation on the resource to be requeued based on the requeuing time; wherein the resource record change status includes one or more of the following: The key value and the returned feature code of the resource to be re-enqueued have no pre-acquired first record state; The key value and the returned feature code of the resource to be re-enqueued both have a second record state that has been pre-acquired; The key value of the resource to be re-enqueued has a pre-acquired record, and the returned feature code has no pre-acquired record in the third record state. Based on the key value and the return signature, the return frequency of the delayed enqueuing process for the resource to be re-enqueued is determined, including: When the resource record change status is the first record status, the return frequency is determined to be 1; When the resource record change state is the second record state, the return frequency is determined to be the previous return frequency increased by 1; wherein, the previous return frequency is the return frequency determined in the case of the previous acquisition of the return feature code; When the resource record change status is the third record status, the return frequency is determined to be 1.
8. An electronic device, comprising: A processor, a memory, and a program or instructions stored in the memory and executable on the processor; characterized in that, when the processor executes the program or instructions, it implements the controller speed limiting method as described in any one of claims 1-6.
9. A readable storage medium having a program or instructions stored thereon, characterized in that, When the program or instructions are executed by the processor, they implement the steps in the controller speed limiting method as described in any one of claims 1-6.
10. A computer program product, characterized in that, Includes computer instructions, which, when executed by a processor, implement the steps of the controller speed limiting method as described in any one of claims 1-6.
Citation Information
Patent Citations
Job scheduling method and device based on priority queue
CN115237577A
Operation control method and device, electronic equipment and storage medium
CN118113303A
Cited By
Speed limiting method and apparatus for controller, and device and product
WO2026118786A1