Method, system, electronic device and medium for compatible multi-application docking restriction capability
By establishing request tags and using a smooth weighted round-robin algorithm, the problem of service processing capacity limits in multiple application scenarios is solved, enabling smooth processing of request tasks and customized requirements.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-02
- Publication Date
- 2026-03-24
AI Technical Summary
In existing technologies, the upper limit of service processing capacity in multiple application scenarios leads to uneven processing of request tasks and cannot effectively accommodate the customized needs of multiple applications.
Request tags are established by obtaining the response speed of the request task, weights are allocated using a smooth weighted round-robin algorithm, the tag queue with the largest current weight value is calculated and the request task is sent to the service capability application, the remaining processing capacity is recorded, the service capability application processes the data and returns the result and updates the remaining capacity.
It enables smooth processing of request tasks across multiple application scenarios, solves the problem of service processing capacity limits, and meets the request task processing needs of each application.
Smart Images

Figure CN114756346B_ABST
Abstract
Description
Technical Field
[0001] This application relates to multiple application areas, specifically to methods, systems, electronic devices, and media that are compatible with multiple application interfacing limitations. Background Technology
[0002] Currently, enterprises offer numerous service processing capabilities, whether self-developed or provided by third-party cloud services. Each service typically has a processing capacity limit. Once this limit is reached, the processing capacity for that task will refuse to handle new requests. When multiple applications integrate with this capability, they all want to process their business logic as quickly as possible and require some backlog processing capacity to prevent requests from being rejected after reaching the maximum processing limit. In scenarios involving multiple applications, the complexity increases significantly. Addressing the service processing capacity limit issue and ensuring smooth processing of requests from each application becomes crucial. Therefore, a standard that is compatible with these service processing capabilities and can address the customized needs of different business scenarios becomes paramount.
[0003] In summary, existing technologies have limitations in terms of request task processing capacity and whether each application's request tasks can be processed smoothly. Summary of the Invention
[0004] The main purpose of this application is to provide methods, systems, electronic devices and media that are compatible with the limitations of multi-application interfacing capabilities, so as to solve the problems of the upper limit of request task processing capability and whether the request tasks of each application can be processed smoothly in the prior art.
[0005] A method for compatibility with multi-application interoperability limitations, the method comprising:
[0006] Step 1: Obtain multiple request tasks and establish corresponding request tags based on the response speed of each request task. The request tasks will be assigned to corresponding tag queues based on the request tags, and weights will be assigned based on the number of request tags in different tag queues.
[0007] Step 2: Calculate the tag queue with the largest current weight value using a smooth weighted round-robin algorithm based on the weights in the different tag queues, obtain the request task, send the request task to the service capability application, and record the remaining capacity in the current tag queue to process the request task.
[0008] The smooth weighted round-robin algorithm is used as follows: Assume there are N queues Q = {Q0, Q1, Q2, ..., Qn}, the default weight is W = {W0, W1, W2, ..., Wn}, and the current weight is CW = {CW0, CW1, CW2, ..., CWn}; where the default weight represents the original weight of the tag queue, the current weight represents the weight recalculated each time the tag queue obtains a task, the initial value of the current weight is the default weight value, the tag queue with the largest current weight value is maxWeightQueue, the sum of all default weights is weightSum, and the queue list is queueList;
[0009] Step 3: The service capability application receives the request task and processes it. After the service capability application finishes processing, it returns the result and increases the number of remaining processing capabilities for the task. Steps 1 and 2 are repeated.
[0010] Based on the above technical solution, the present invention can be further improved as follows:
[0011] Furthermore, the request task in step one includes;
[0012] Process image tags and compress images.
[0013] Furthermore, in step two, the label queue with the largest current weight value is calculated using a smooth weighted round-robin algorithm based on the weights in the different label queues, and the request task is obtained. The request task is then sent to the service capability application, and the remaining capacity to process the request task in the current label queue is recorded.
[0014] Each tag queue is set with a maximum number of request tasks that can be processed. When one of the tag queues reaches the maximum number of request tasks that can be processed, the remaining number of request tasks that can be processed in the tag queue is 0.
[0015] Furthermore, when the number of remaining processing capabilities for the request task in the tag queue is 0, the remaining request tasks wait for the service capability application to finish processing the request task, then the number of remaining processing capabilities for the request task is increased, the remaining request tasks enter the tag queue, and the service capability application continues to obtain the next request task from the tag queue and process it.
[0016] Furthermore, the process ends when all requested tasks in each of the label queues are 0.
[0017] Furthermore, the algorithm for making the label queue list a queueList in step two includes the following steps:
[0018] (1) Calculate the sum of the default weights {W0, W1, W2, ..., Wn}, weightSum;
[0019] (2) Calculate the current weight CW of the N label queues {Q0,Q1,Q2,…,Qn}. The calculation formula is Qn.CW=Qn.CW+Qn.Wn;
[0020] (3) Find the label queue with the largest current weight value, maxWeightQueue;
[0021] (4) Set maxWeightQueue.CW=maxWeightQueue.CW-weightSum;
[0022] (5) Return maxWeightQueue, which is the next label queue;
[0023] (6) Simply retrieve the first request task from maxWeightQueue;
[0024] Each time the next request task is obtained, the steps (2), (3), (4), (5) and (6) of the queueList algorithm described above are repeated. When all the request tasks in the tag queue are 0, the steps (2), (3), (4), (5) and (6) of the queueList algorithm described above are stopped.
[0025] A system compatible with multiple application integration limitations, the system comprising:
[0026] The allocation unit is used to acquire multiple request tasks and establish corresponding request tags according to the response speed of each request task. The request tasks are allocated to corresponding tag queues according to the request tags, and weights are assigned according to the number of request tags in different tag queues.
[0027] The calculation unit is used to calculate the label queue with the largest current weight value according to the weight in the different label queues using a smooth weighted round-robin algorithm, obtain the request task, send the request task to the service capability application, and record the number of remaining processing capabilities for the request task in the current label queue.
[0028] The smooth weighted round-robin algorithm is used as follows: Assume there are N queues Q = {Q0, Q1, Q2, ..., Qn}, the default weight is W = {W0, W1, W2, ..., Wn}, and the current weight is CW = {CW0, CW1, CW2, ..., CWn}; where the default weight represents the original weight of the tag queue, the current weight represents the weight recalculated each time the tag queue obtains a task, the initial value of the current weight is the default weight value, the tag queue with the largest current weight value is maxWeightQueue, the sum of all default weights is weightSum, and the queue list is queueList;
[0029] The processing unit is used to receive the request task and process it. After the service capability application completes the processing, it returns the result and increases the amount of remaining processing capability for the task.
[0030] Furthermore, the requested task includes processing image tags and processing image compression.
[0031] An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the steps of the method described herein.
[0032] A non-transitory computer-readable storage medium having a computer program stored thereon, the computer program implementing the steps of the method when executed by a processor.
[0033] The present invention has the following advantages:
[0034] This application acquires multiple request tasks and establishes corresponding request tags based on the response speed of each task. Request tasks are assigned to corresponding tag queues based on their tags, and weights are assigned according to the number of request tags in each queue. A smooth, weighted round-robin algorithm is used to calculate the tag queue with the highest current weight value and retrieve the request tasks from it. The request tasks are then sent to the service application, which records the remaining processing capacity in the current tag queue. The service application receives and processes the request tasks, and after processing, returns the result and increments the remaining processing capacity. This invention solves the problems of the existing technology regarding the upper limit of request task processing capacity and whether request tasks from each application can be processed smoothly. Attached Figure Description
[0035] 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, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0036] Figure 1 A flowchart illustrating the method for compatibility with multi-application interfacing limitations provided by this invention;
[0037] Figure 2 The system architecture diagram of the system provided by this invention is compatible with the limitations of multiple application interfacing. Detailed Implementation
[0038] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0039] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0040] In this application, the terms "upper," "lower," "left," "right," "front," "rear," "top," "bottom," "inner," "outer," "middle," "vertical," "horizontal," "lateral," and "longitudinal" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. These terms are primarily for the purpose of better describing this application and its embodiments, and are not intended to limit the indicated device, element, or component to having a specific orientation, or to be constructed and operated in a specific orientation.
[0041] Furthermore, in addition to indicating location or positional relationship, some of the aforementioned terms may also have other meanings. For example, the term "above" may also be used in some cases to indicate a certain dependency or connection relationship. Those skilled in the art can understand the specific meaning of these terms in this application based on the specific circumstances.
[0042] In addition, the term "multiple" should mean two or more.
[0043] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0044] Specific implementation method one: Combining Figure 1 This embodiment describes a method for overcoming multi-application interoperability limitations, including:
[0045] Step 1: Obtain multiple request tasks and establish corresponding request tags based on the response speed of each request task. The request tasks will be assigned to corresponding tag queues based on the request tags, and weights will be assigned based on the number of request tags in different tag queues.
[0046] Step 2: Calculate the tag queue with the largest current weight value using a smooth weighted round-robin algorithm based on the weights in the different tag queues, obtain the request task, send the request task to the service capability application, and record the remaining capacity in the current tag queue to process the request task.
[0047] The smooth weighted round-robin algorithm is used as follows: Assume there are N queues Q = {Q0, Q1, Q2, ..., Qn}, the default weight is W = {W0, W1, W2, ..., Wn}, and the current weight is CW = {CW0, CW1, CW2, ..., CWn}; where the default weight represents the original weight of the tag queue, the current weight represents the weight recalculated each time the tag queue obtains a task, the initial value of the current weight is the default weight value, the tag queue with the largest current weight value is maxWeightQueue, the sum of all default weights is weightSum, and the queue list is queueList;
[0048] Step 3: The service capability application receives the request task and processes it. After the service capability application finishes processing, it returns the result and increases the number of remaining processing capabilities for the task. Steps 1 and 2 are repeated.
[0049] This implementation obtains multiple request tasks from different applications and establishes corresponding request tags based on the response speed of each request task. The request tasks are assigned to corresponding tag queues based on the request tags, and weights are assigned based on the number of request tags in different tag queues. A smooth weighted round-robin algorithm is used to calculate the tag queue with the largest current weight value based on the weights in the different tag queues, and the request task is obtained. The request task is sent to the service capability application, and the remaining capacity to process the request task in the current tag queue is recorded. The service capability application receives the request task and processes it. After the service capability application completes the processing, it returns the result and increments the remaining capacity to process the task. This application solves the problem of whether the request tasks of each application can be processed smoothly and maintains the relationship between request tags and tag queues.
[0050] In this embodiment, weights are assigned based on the number of request tasks in each tag queue. Generally, the higher the number of request tasks, the higher the weight is assigned. The weight ratio is not fixed each time and depends on the number of request tasks in each tag queue.
[0051] In this implementation, based on the different response speeds of application A and application B requesting tasks, assuming that application A and application B request tags M and N respectively, the request task for application A requesting tag M will be placed in tag queue M, and the request task for application B requesting tag N will be placed in tag queue N. Application A first submits 100 request tasks into tag queue M, and application B then submits 1 request task into tag queue N. Based on the number of request tasks in tag queues M and N, the weight ratio is set to 7:3. Then, according to the smooth weighted round-robin algorithm, the tag queue with the largest current weight value is calculated as M. After obtaining one request task from tag queue M, the algorithm continues to calculate the tag queue with the largest current weight value to obtain the next request task.
[0052] In a preferred embodiment, the request task in step one of this implementation includes:
[0053] Process image tags and compress images.
[0054] The request tasks in this embodiment are not limited to processing image tags and processing image compression; they are performed according to the application's request.
[0055] In a preferred embodiment, in step two of this implementation, the label queue with the largest current weight value is calculated using a smooth weighted round-robin algorithm based on the weights in the different label queues, and the request task is obtained. The request task is then sent to the service capability application, and the remaining capacity to process the request task in the current label queue is recorded.
[0056] Each tag queue is set with a maximum number of request tasks that can be processed. When one of the tag queues reaches the maximum number of request tasks that can be processed, the remaining number of request tasks that can be processed in the tag queue is 0.
[0057] In a preferred embodiment, when the number of remaining processing capabilities for the request tasks in the tag queue is 0, the remaining request tasks wait for the service capability application to complete processing the request tasks before the number of remaining processing capabilities for the request tasks is increased. The remaining request tasks then enter the tag queue, and the service capability application continues to obtain the next request task from the tag queue and process it.
[0058] In a preferred embodiment, the process ends when all request tasks in each of the tag queues are 0.
[0059] In this embodiment, a maximum number of request task processing capabilities are set for each tag queue. When the request task processing capability reaches the upper limit, the remaining number of request task processing capabilities can be increased after the service capability application has finished processing the request task, thereby increasing the buffer for the request task.
[0060] In a preferred embodiment, the algorithm for making the tag queue list a queueList in step two of this implementation includes the following steps:
[0061] (1) Calculate the sum of the default weights {W0, W1, W2, ..., Wn}, weightSum;
[0062] (2) Calculate the current weight CW of the N label queues {Q0,Q1,Q2,…,Qn}. The calculation formula is Qn.CW=Qn.CW+Qn.Wn;
[0063] (3) Find the label queue with the largest current weight value, maxWeightQueue;
[0064] (4) Set maxWeightQueue.CW=maxWeightQueue.CW-weightSum;
[0065] (5) Return maxWeightQueue, which is the next label queue;
[0066] (6) Simply retrieve the first request task from maxWeightQueue;
[0067] Each time the next request task is obtained, the steps (2), (3), (4), (5) and (6) of the queueList algorithm described above are repeated. When all the request tasks in the tag queue are 0, the steps (2), (3), (4), (5) and (6) of the queueList algorithm described above are stopped.
[0068] In this implementation, the main task is to calculate the label queue with the highest current weight value among all label queues. Label queues with high weights are processed more often, while label queues with low weights are processed less often.
[0069] Specific Implementation Method Two: Combining Figure 2 This embodiment describes a system with compatibility with multiple application interfacing limitations, including:
[0070] The allocation unit 10 is used to acquire multiple request tasks and establish corresponding request tags according to the response speed of each request task. The request tasks are allocated to corresponding tag queues according to the request tags, and weights are assigned according to the number of request tags in different tag queues.
[0071] The calculation unit 20 is used to calculate the label queue with the largest current weight value according to the weight in the different label queues using a smooth weighted round-robin algorithm, obtain the request task, send the request task to the service capability application, and record the number of remaining processing capabilities for the request task in the current label queue.
[0072] The smooth weighted round-robin algorithm is used as follows: Assume there are N queues Q = {Q0, Q1, Q2, ..., Qn}, the default weight is W = {W0, W1, W2, ..., Wn}, and the current weight is CW = {CW0, CW1, CW2, ..., CWn}; where the default weight represents the original weight of the tag queue, the current weight represents the weight recalculated each time the tag queue obtains a task, the initial value of the current weight is the default weight value, the tag queue with the largest current weight value is maxWeightQueue, the sum of all default weights is weightSum, and the queue list is queueList;
[0073] The processing unit 30 is used to receive the request task and process it. After the service capability application completes the processing, it returns the result and increases the amount of remaining processing capability for the task.
[0074] This implementation obtains multiple request tasks from different applications and establishes corresponding request tags based on the response speed of each request task. The request tasks are assigned to corresponding tag queues based on the request tags, and weights are assigned based on the number of request tags in different tag queues. A smooth weighted round-robin algorithm is used to calculate the tag queue with the largest current weight value based on the weights in the different tag queues, and the request task is obtained. The request task is sent to the service capability application, and the remaining capacity to process the request task in the current tag queue is recorded. The service capability application receives the request task and processes it. After the service capability application completes the processing, it returns the result and increments the remaining capacity to process the task. This application solves the problem of whether the request tasks of each application can be processed smoothly and maintains the relationship between request tags and tag queues.
[0075] In this embodiment, weights are assigned based on the number of request tasks in each tag queue. Generally, the higher the number of request tasks, the higher the weight is assigned. The weight ratio is not fixed each time and depends on the number of request tasks in each tag queue.
[0076] In this implementation, based on the different response speeds of application A and application B requesting tasks, assuming that application A and application B request tags M and N respectively, the request task for application A requesting tag M will be placed in tag queue M, and the request task for application B requesting tag N will be placed in tag queue N. Application A first submits 100 request tasks into tag queue M, and application B then submits 1 request task into tag queue N. Based on the number of request tasks in tag queues M and N, the weight ratio is set to 7:3. Then, according to the smooth weighted round-robin algorithm, the tag queue with the largest current weight value is calculated as M. After obtaining one request task from tag queue M, the algorithm continues to calculate the tag queue with the largest current weight value to obtain the next request task.
[0077] In a preferred embodiment, the request task described in this implementation includes processing image tags and processing image compression.
[0078] The request tasks in this embodiment are not limited to processing image tags and processing image compression; they are performed according to the application's request.
[0079] Specific Implementation Method 3: An electronic device according to this embodiment includes a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the computer program to implement the steps of the method described.
[0080] Specific Implementation Method Four: A non-transitory computer-readable storage medium storing a computer program, characterized in that the computer program, when executed by a processor, implements the steps of the method described.
[0081] This invention may have other embodiments. Without departing from the spirit and essence of this invention, those skilled in the art can make various corresponding changes and modifications according to this invention, but these corresponding changes and modifications should all fall within the protection scope of the appended claims.
Claims
1. A method for compatibility with multiple application integration limitations, characterized in that, The method includes: Step 1: Obtain multiple request tasks and establish corresponding request tags based on the response speed of each request task. The request tasks will be assigned to corresponding tag queues based on the request tags, and weights will be assigned based on the number of request tags in different tag queues. Step 2: Calculate the tag queue with the largest current weight value using a smooth weighted round-robin algorithm based on the weights in the different tag queues, obtain the request task, send the request task to the service capability application, and record the remaining capacity in the current tag queue to process the request task. The smooth weighted round-robin algorithm is used as follows: Assume there are N queues Q = {Q0, Q1, Q2, ..., Qn}, the default weight is W = {W0, W1, W2, ..., Wn}, and the current weight is CW = {CW0, CW1, CW2, ..., CWn}; where the default weight represents the original weight of the tag queue, the current weight represents the weight recalculated each time the tag queue obtains a task, the initial value of the current weight is the default weight value, the tag queue with the largest current weight value is maxWeightQueue, the sum of all default weights is weightSum, and the queue list is queueList; In step two, the label queue with the largest current weight value is calculated using a smooth weighted round-robin algorithm based on the weights in the different label queues, and the request task is obtained. The request task is sent to the service capability application, and the remaining capacity to process the request task in the current label queue is recorded. Each tag queue is set with a maximum number of request tasks that can be processed. When one of the tag queues reaches the maximum number of request tasks that can be processed, the remaining number of request tasks that can be processed in the tag queue is 0. Step 3: The service capability application receives the request task and processes it. After the service capability application finishes processing, it returns the result and increases the number of remaining processing capabilities for the task. Steps 1 and 2 are repeated.
2. The method for compatibility with multi-application interfacing limitations as described in claim 1, characterized in that, The request task in step one includes: Process image tags and compress images.
3. The method for compatibility with multi-application interfacing limitations as described in claim 2, characterized in that, When the number of remaining processing capabilities for the request task in the tag queue is 0, the remaining request tasks wait for the service capability application to finish processing the request task. Then, the number of remaining processing capabilities for the request task is increased, and the remaining request tasks enter the tag queue. The service capability application continues to obtain the next request task from the tag queue and process it.
4. The method for compatibility with multi-application interfacing limitations as described in claim 1, characterized in that, The process ends when all requested tasks in each of the label queues are 0.
5. The method for compatibility with multi-application interfacing limitations as described in claim 1, characterized in that, The algorithm for using a queueList as the tag queue list in step two includes the following steps: (1) Calculate the sum of the default weights {W0, W1, W2, ..., Wn}, weightSum; (2) Calculate the current weight CW of the N label queues {Q0,Q1,Q2,…,Qn}. The calculation formula is Qn.CW=Qn.CW+Qn.Wn; (3) Find the label queue with the largest current weight value, maxWeightQueue; (4) Set maxWeightQueue.CW=maxWeightQueue.CW-weightSum; (5) Return maxWeightQueue, which is the next label queue; (6) Simply retrieve the first request task from maxWeightQueue; Each time the next request task is obtained, the steps (2), (3), (4), (5) and (6) of the queueList algorithm described above are repeated. When all the request tasks in the tag queue are 0, the steps (2), (3), (4), (5) and (6) of the queueList algorithm described above are stopped.
6. A system compatible with multiple application interfacing limitations, characterized in that, The system includes: The allocation unit is used to acquire multiple request tasks and establish corresponding request tags according to the response speed of each request task. The request tasks are allocated to corresponding tag queues according to the request tags, and weights are assigned according to the number of request tags in different tag queues. The calculation unit is used to calculate the label queue with the largest current weight value according to the weight in the different label queues using a smooth weighted round-robin algorithm, obtain the request task, send the request task to the service capability application, and record the number of remaining processing capabilities for the request task in the current label queue. The smooth weighted round-robin algorithm is used as follows: Assume there are N queues Q = {Q0, Q1, Q2, ..., Qn}, the default weight is W = {W0, W1, W2, ..., Wn}, and the current weight is CW = {CW0, CW1, CW2, ..., CWn}; where the default weight represents the original weight of the tag queue, the current weight represents the weight recalculated each time the tag queue obtains a task, the initial value of the current weight is the default weight value, the tag queue with the largest current weight value is maxWeightQueue, the sum of all default weights is weightSum, and the queue list is queueList; In step two, the label queue with the largest current weight value is calculated using a smooth weighted round-robin algorithm based on the weights in the different label queues, and the request task is obtained. The request task is sent to the service capability application, and the remaining capacity to process the request task in the current label queue is recorded. The processing unit is used to receive the request task and process it. After the service capability application completes the processing, it returns the result and increases the amount of remaining processing capability for the task.
7. The system as described in claim 6, characterized in that, The requested tasks include processing image tags and processing image compression.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1 to 5.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Method for achieving load balancing
CN111737000A