A method of line distribution, a computing device, and a storage medium
By using a multi-threaded model and queue management, the problem of low efficiency in allocating robot phone line resources was solved, enabling on-demand allocation and efficient utilization, and ensuring efficient lead processing capabilities during irregular traffic peaks.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING CHESHANGHUI SOFTWARE
- Filing Date
- 2022-09-23
- Publication Date
- 2026-06-26
AI Technical Summary
In existing technologies, robot phone line resource allocation is inefficient, and it cannot be allocated on demand according to the number and type of lines purchased by merchants, resulting in idle resources, inability to cope with irregular traffic peaks, and affecting efficient outbound calls.
A multi-threaded model is adopted, which stores different types of service platform instances through dedicated line queues, single line queues and secondary allocation queues, and allocates lines in sequence. Combined with multi-threaded processing of pending threads, it ensures on-demand allocation and efficient utilization of line resources.
It enables on-demand allocation based on the number and type of lines purchased by merchants, improving the utilization rate of line resources and ensuring efficient lead processing capabilities during irregular traffic peaks.
Smart Images

Figure CN115794327B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of Internet technology, and in particular to a line allocation method, computing device, and storage medium. Background Technology
[0002] With the rapid development of the automotive internet industry in recent years, a large number of inquiry leads are generated every day. Merchants need to quickly process these leads through telephone follow-ups to prevent them from being lost. Since manual processing cannot guarantee timeliness and is very costly, merchants generally use robots to process leads.
[0003] Robotic call line resources are shared public resources managed by a third party and used by multiple business lines. These resources are divided into dedicated lines and single lines. Merchants can purchase dedicated or single-line resources as needed and can set lead processing priorities. When multiple merchants are processing leads simultaneously, robot lines must be allocated according to the number of lines purchased by each merchant. If lines remain after allocation, they can be further allocated to process the remaining leads. Lines are released after completing their service for reuse.
[0004] In existing technologies, a timed task is started and scheduled at fixed intervals to find a set of merchants with leads to be processed. The merchant set is iterated through, and the number of lines required for each merchant is calculated, denoted as N. Then, one lead is taken out and processed sequentially according to lead priority, and one line is allocated to the merchant associated with that lead, until the number of lines occupied reaches N. After allocating lines to all merchants, any remaining lines are allocated to all merchants in a round-robin fashion. This approach uses a single-threaded model, resulting in low processing efficiency. When some merchants need to process a large number of leads at a certain time, there may be insufficient lines to allocate, making it impossible to guarantee that every merchant will be allocated line resources, and further failing to achieve on-demand allocation based on the number of lines purchased by merchants. For irregular traffic peaks, high utilization of the robot's lines cannot be guaranteed.
[0005] It is evident that a solution is urgently needed to address how to allocate resources on demand based on the number and type of lines purchased by merchants, avoid resource idleness, cope with irregular traffic peaks, and ensure efficient outbound calls by robots.
[0006] Therefore, a line allocation method is needed to solve the problems existing in the above technical solutions. Summary of the Invention
[0007] Therefore, the present invention provides a line allocation method to solve or at least alleviate the problems mentioned above.
[0008] According to one aspect of the present invention, a line allocation method is provided, executed in a computing device, the computing device including a dedicated line queue, a single-line queue, and a result queue, wherein the dedicated line queue is adapted to store service platform instances with dedicated line type, and the single-line queue is adapted to store service platform instances with single-line type, the method comprising: traversing the dedicated line queue, sequentially retrieving each service platform instance from the dedicated line queue, allocating a line to the service platform instance, adding the service platform instance to the tail of the dedicated line queue, and adding it to the result queue; traversing the single-line queue, sequentially retrieving each service platform instance from the single-line queue, determining whether the number of allocated lines for the service platform instance is greater than 1, if not, allocating a line to the service platform instance, and adding the service platform instance to the result queue; traversing the result queue through multiple threads, sequentially retrieving each service platform instance from the result queue, and processing the clues in the pending clue set of the service platform instance.
[0009] Optionally, in the line allocation method according to the present invention, the service platform set of currently pending clues is queried periodically. The service platform set includes multiple service platform instances. Each service platform instance includes the number of subscribed lines, line type, number of allocated lines, and set of pending clues. The line type includes dedicated lines and single lines. Service platform instances with the line type of dedicated lines are stored in a dedicated line queue, and service platform instances with the line type of single lines are stored in a single line queue.
[0010] Optionally, in the line allocation method according to the present invention, adding the service platform instance to the tail of the leased line queue and to the result queue includes: determining whether the number of allocated lines of the service platform instance is less than the number of subscribed lines; if yes, adding the service platform instance to the tail of the leased line queue and to the result queue; if no, adding the service platform instance to the secondary allocation queue and to the result queue.
[0011] Optionally, in the line allocation method according to the present invention, determining whether the number of allocated lines of the service platform instance is greater than 1 further includes: if it is greater than 1, then adding the service platform instance to the secondary allocation queue.
[0012] Optionally, in the line allocation method according to the present invention, before traversing the leased line queue, the method includes: determining the current number of available lines of the computing device so as to update the current number of available lines after allocating lines to the service platform instance.
[0013] Optionally, in the line allocation method according to the present invention, determining the number of currently available lines of the computing device includes: determining the number of currently available lines based on the total number of lines, the total number of currently occupied lines, and the average connection rate of the lines.
[0014] Optionally, the line allocation method according to the present invention further includes: determining whether the number of currently available lines is greater than 0; if so, sequentially taking each service platform instance from the secondary allocation queue, allocating a line to the service platform instance, adding the service platform instance to the tail of the secondary allocation queue, and adding it to the result queue; until the number of currently available lines is 0.
[0015] According to one aspect of the present invention, a computing device is provided, comprising: at least one processor; and a memory storing program instructions, wherein the program instructions are configured to be executed by the at least one processor, the program instructions including instructions for performing the line allocation method as described above.
[0016] According to one aspect of the present invention, a readable storage medium storing program instructions is provided, which, when read and executed by a computing device, causes the computing device to perform the line allocation method as described above.
[0017] According to the technical solution of the present invention, a line allocation method is provided. A dedicated line queue stores service platform instances of type dedicated line, and a single-line queue stores service platform instances of type single line. By traversing the dedicated line queue, each service platform instance is sequentially retrieved from the queue, a line is allocated to that service platform instance, and the service platform instance is added to the tail of the dedicated line queue and to the result queue. By traversing the single-line queue, each service platform instance is sequentially retrieved from the queue, and it is determined whether the number of allocated lines for the service platform instance is greater than 1. If not, a line is allocated to that service platform instance, and the service platform instance is added to the result queue. By using multi-threaded traversal of the result queue, each service platform instance is sequentially retrieved from the result queue, and the clues in the pending clue set of that service platform instance are processed. This not only achieves on-demand allocation based on the required number and type of lines for the service platform, but also enables reasonable, accurate, and efficient allocation of lines to multiple service platforms, fully utilizing line resources and ensuring efficient clue processing.
[0018] Furthermore, by adding service platform instances with allocated lines to the secondary allocation queue, after allocating lines to both the dedicated line queue and the single line queue, if there are idle lines, lines can continue to be allocated to service platform instances in the secondary allocation queue in a loop. This maximizes line resource utilization, improves line resource efficiency, and helps cope with irregular traffic peaks, ensuring efficient processing of leads.
[0019] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description
[0020] To achieve the foregoing and related objectives, certain illustrative aspects are described herein in conjunction with the following description and accompanying drawings. These aspects indicate various ways in which the principles disclosed herein may be practiced, and all aspects and their equivalents are intended to fall within the scope of the claimed subject matter. The foregoing and other objectives, features, and advantages of this disclosure will become more apparent from the following detailed description, taken in conjunction with the accompanying drawings. Throughout this disclosure, the same reference numerals generally refer to the same parts or elements.
[0021] Figure 1 A schematic diagram of a computing device 100 according to an embodiment of the present invention is shown;
[0022] Figure 2 , Figure 3 The following are schematic flowcharts of a line allocation method 200 according to an embodiment of the present invention. Detailed Implementation
[0023] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
[0024] Figure 1 A schematic diagram of a computing device 100 according to an embodiment of the present invention is shown. Figure 1As shown, in a basic configuration, computing device 100 includes at least one processing unit 102 and system memory 104. According to one aspect, depending on the configuration and type of the computing device, the processing unit 102 may be implemented as a processor. System memory 104 includes, but is not limited to, volatile memory (e.g., random access memory), non-volatile memory (e.g., read-only memory), flash memory, or any combination of such memories. According to one aspect, system memory 104 includes an operating system 105.
[0025] According to one aspect, operating system 105 is, for example, suitable for controlling the operation of computing device 100. Furthermore, examples are practiced in conjunction with graphics libraries, other operating systems, or any other applications, and are not limited to any particular application or system. Figure 1 The basic configuration is illustrated by the components within the dashed lines. According to one aspect, the computing device 100 has additional features or functions. For example, according to one aspect, the computing device 100 includes additional data storage devices (removable and / or non-removable), such as disks, optical discs, or magnetic tapes. This additional storage... Figure 1 The middle part is shown by removable storage device 109 and non-removable storage device 110.
[0026] As stated above, according to one aspect, program module 103 is stored in system memory 104. According to one aspect, program module 103 may include one or more applications. The present invention does not limit the type of application; for example, applications may include: email and contact applications, word processing applications, spreadsheet applications, database applications, slideshow applications, drawing or computer-aided applications, web browser applications, etc.
[0027] In an embodiment of the present invention, program module 103 includes one or more program instructions applicable to performing the line allocation method 200 of the present invention, the program instructions being configured to perform the line allocation method 200 of the present invention.
[0028] According to one aspect, examples can be practiced on circuits including discrete electronic components, packaged or integrated electronic chips containing logic gates, circuits utilizing microprocessors, or on a single chip containing electronic components or a microprocessor. For example, it can be practiced via wherein... Figure 1Each or many of the components shown can be implemented as an example by integrating a System-on-a-Chip (SOC) on a single integrated circuit. According to one aspect, such an SOC device may include one or more processing units, graphics units, communication units, system virtualization units, and various application functions, all integrated (or “burned in”) as a single integrated circuit onto a chip substrate. When operating via the SOC, the functions described herein can be operated via dedicated logic integrated on a single integrated circuit (chip) with other components of the computing device 100. Embodiments of the invention can also be implemented using other techniques capable of performing logical operations (e.g., AND, OR, and NOT), including but not limited to mechanical, optical, fluid, and quantum technologies. Additionally, embodiments of the invention can be implemented within a general-purpose computer or in any other circuit or system.
[0029] According to one aspect, computing device 100 may also have one or more input devices 112, such as a keyboard, mouse, pen, voice input device, touch input device, etc. It may also include output devices 114, such as a display, speaker, printer, etc. The foregoing devices are examples and other devices may also be used. Computing device 100 may include one or more communication connections 116 that allow communication with other computing devices 118. Examples of suitable communication connections 116 include, but are not limited to: RF transmitter, receiver and / or transceiver circuitry; Universal Serial Bus (USB), parallel and / or serial ports.
[0030] As used herein, the term computer-readable medium includes computer storage medium. Computer storage medium can include volatile and non-volatile, removable and non-removable media implemented using any method or technology for storing information (e.g., computer-readable instructions, data structures, or program module 103). System memory 104, removable storage device 109, and non-removable storage device 110 are examples of computer storage media (i.e., memory storage). Computer storage media can include random access memory (RAM), read-only memory (ROM), electrically erasable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical storage, magnetic tape, magnetic tape, disk storage or other magnetic storage devices, or any other article of manufacture that can be used to store information and is accessible by computer device 100. According to one aspect, any such computer storage medium can be part of computing device 100. Computer storage media does not include carrier waves or other transmitted data signals.
[0031] According to one aspect, the communication medium is implemented by computer-readable instructions, data structures, program modules 103, or other data in a modulated data signal (e.g., a carrier wave or other transmission mechanism), and includes any information transmission medium. According to one aspect, the term "modulated data signal" describes a signal having one or more sets of characteristics or altered in a manner that encodes information in the signal. By way of example and not limitation, the communication medium includes wired media such as wired networks or direct wired connections, and wireless media such as acoustic, radio frequency (RF), infrared, and other wireless media.
[0032] In an embodiment of the invention, a computing device 100 is configured to perform a line allocation method 200 according to the invention. The computing device 100 includes one or more processors and one or more readable storage media storing program instructions that, when configured to be executed by the one or more processors, cause the computing device to perform the line allocation method 200 according to the embodiment of the invention.
[0033] Figure 2 , Figure 3 Flowcharts of a line allocation method 200 according to an embodiment of the present invention are shown. Method 200 is adapted to be executed in a computing device (the aforementioned computing device 100). By executing the line allocation method 200 of the present invention, the computing device 100 can efficiently and rationally allocate lines to multiple service platforms in order to efficiently process the threads of each service platform.
[0034] Here, the service platform can be a platform used by the merchant. The computing device 100 can communicate and connect with multiple service platforms, and the computing device 100 can act as a third-party server for multiple service platforms.
[0035] According to an embodiment of the present invention, the computing device 100 includes a dedicated line queue (A), a single line queue (B), a secondary allocation queue (C), and a result queue (D).
[0036] like Figure 2 As shown, method 200 includes steps 210 to 230.
[0037] According to one embodiment of the present invention, before executing step 210, a scheduled task can be executed to periodically query the service platform set of currently pending leads. The service platform set stores multiple service platform instances. Each service platform instance may include the following key fields: the number of lines subscribed to by the service platform, line type, number of allocated lines, and the set of pending leads. The line type includes dedicated lines and single lines. It should be noted that allocated lines are lines currently processing leads (in dialing status); therefore, the number of allocated lines for a service platform instance is also the number of leads currently being processed by that service platform. The set of pending leads includes all pending leads from that service platform.
[0038] Subsequently, all service platform instances of the leased line type can be selected from the service platform set and stored in leased line queue A. All service platform instances of the single-line type can be selected from the service platform set and stored in single-line queue B. In other words, all service platform instances of the leased line type are stored in leased line queue A, and all service platform instances of the single-line type are stored in single-line queue B. This achieves the classification and storage of service platform instances based on the line type subscribed to by the service platform (leased line or single-line), so that the service platform instances in leased line queue A and single-line queue B can be processed separately in subsequent steps.
[0039] Thus, the dedicated line queue A of this invention stores service platform instances with the line type of dedicated line, and the single line queue B stores service platform instances with the line type of single line.
[0040] Additionally, before performing step 210, the current number of available lines on the computing device can be determined so that the current number of available lines can be updated immediately after lines are allocated to the service platform instance.
[0041] In one embodiment, the number of currently available lines can be determined based on the total number of lines that the computing device can provide, the total number of currently occupied lines (i.e., the total number of lines allocated to all service platforms), and the average connection rate. Specifically, the number of currently available lines = (total number of lines - total number of currently occupied lines) / average connection rate.
[0042] Next, proceed with step 210.
[0043] In step 210, the dedicated line queue A is traversed in a loop, and each service platform instance is taken out from the dedicated line queue A in turn, and a line is assigned to the taken service platform instance. Then, the service platform instance can be added to the tail of the dedicated line queue to wait for the service platform to be taken out again. At the same time, the service platform is added to the result queue D.
[0044] Specifically, after allocating a line to the retrieved service platform instance, before adding the service platform instance to the tail of the dedicated line queue, it is necessary to determine whether the number of allocated lines of the service platform instance is less than the number of subscribed lines. If the number of allocated lines of the service platform instance is less than the number of subscribed lines, that is, the number of allocated lines of the service platform has not yet reached the number of subscribed lines, lines can continue to be allocated to it. At this time, the service platform instance can be added to the tail of the dedicated line queue A, and at the same time, the service platform can be added to the result queue D.
[0045] Otherwise, if the number of allocated lines of a service platform instance is greater than or equal to the number of lines it has subscribed to, that is, the number of allocated lines of the service platform has reached the number of subscribed lines, and there is no need to allocate lines for it based on the dedicated line queue, then the service platform instance can be added to the secondary allocation queue C, and at the same time, the service platform can be added to the result queue D.
[0046] In one embodiment, the dedicated line queue A, the single-line queue B, the secondary allocation queue C, and the result queue D can all adopt a first-in-first-out (FIFO) strategy.
[0047] Therefore, after allocating an instance to the service platform, if it is determined that the number of allocated lines for the service platform instance is less than the number of subscribed lines, the service platform instance can be added to the tail of the leased line queue so that the service platform instance can wait to be retrieved and allocated lines again.
[0048] It should be noted that after a service platform instance is allocated a line, the following information needs to be updated: for the service platform instance, the number of allocated lines is incremented by 1; for the computing device, the total number of currently occupied lines is incremented by 1, and correspondingly, the number of currently available lines is decremented by 1.
[0049] It should be noted that the result queue D stores all service platform instances that were allocated lines in this instance.
[0050] For all service platform instances in leased line queue A, after retrieval, a line is first allocated to each instance. Then, it is determined whether the number of allocated lines (the number of service platform instances) has reached the number of lines it has subscribed to. This determination aims to identify whether further line allocation is needed. Therefore, for each service platform instance retrieved from leased line queue A, a line has been allocated, requiring updates to the number of allocated lines, the total number of currently occupied lines on the computing device, and the number of currently available lines. Furthermore, each retrieved service platform instance is added to result queue D.
[0051] It is understandable that, given a sufficient number of lines available from the computing devices, performing step 210 above can ensure that each service platform instance in the leased line queue is ultimately allocated the number of lines it has subscribed to.
[0052] In step 220, the single-line queue B is traversed, and each service platform instance is taken out from the single-line queue B in turn. It is determined whether the number of allocated lines of the taken service platform instance is greater than 1. If not, a line is allocated to the service platform instance, and the service platform instance is added to the result queue D.
[0053] In addition, if it is determined that the number of allocated lines of the retrieved service platform instance is greater than 1, then no line will be allocated to the service platform instance, and the service platform instance will be directly added to the secondary allocation queue C.
[0054] Here, for all service platform instances in single-line queue B, after retrieval, it is first determined whether the number of allocated lines for the retrieved service platform instance is greater than 1. Only if it is determined that the number is not greater than 1 will a line be allocated to that service platform. In other words, for single-line queue B, a line is not directly allocated to every retrieved service platform instance; there may be service platform instances that have not been allocated a line in this instance. Only when a line is allocated to a service platform instance will that service platform instance be added to result queue D.
[0055] In addition, after allocating a line to a service platform instance, the following information needs to be updated: for the service platform instance, the number of allocated lines is incremented by 1; for the computing device, the total number of currently occupied lines is incremented by 1, and correspondingly, the number of currently available lines is decremented by 1.
[0056] Finally, in step 230, the result queue D can be traversed using multiple threads, each service platform instance can be retrieved sequentially from the result queue D, and the leads in the pending lead set of each retrieved service platform instance can be processed. For example, outbound calls can be made to the leads.
[0057] It should be noted that the set of pending threads for each service platform instance can be stored in a ConcurrentLinkedQueue (an unbounded thread-safe queue). Since each thread in the set of pending threads is stored in the ConcurrentLinkedQueue, duplicate processing of threads can be avoided, and thread safety can be guaranteed.
[0058] In one embodiment, for each service platform instance's set of pending leads, the pending leads can be processed according to the priority of each pending lead.
[0059] According to one embodiment of the present invention, for the secondary allocation queue C, the secondary allocation queue C can be traversed cyclically to determine whether the number of currently available lines is greater than 0.
[0060] If it is determined that the number of currently available lines is greater than 0 (there are currently unused idle lines), then each service platform instance is sequentially retrieved from the secondary allocation queue C, a line is allocated to each service platform instance, and the service platform instance is added to the tail of the secondary allocation queue C and then to the result queue D. Here, it can be understood that by adding the service platform instance with an allocated line back to the tail of the secondary allocation queue C, it can wait for the service platform instance to be retrieved again and a line to be allocated again.
[0061] Repeat the above steps until the number of available lines is 0, that is, until all lines are occupied.
[0062] This invention adds service platform instances that have been allocated lines (in the dedicated line queue and single line queue) to a secondary allocation queue. This allows for continued allocation of lines to service platform instances in the secondary allocation queue if available lines are available after allocating lines to both the dedicated line queue and single line queue. This maximizes line resource utilization, improves line resource efficiency, and helps cope with irregular traffic peaks, ensuring efficient processing of leads.
[0063] It should be noted that after allocating a line to a service platform instance in the secondary allocation queue C each time, the following information will be updated: for the service platform instance, the number of allocated lines will be incremented by 1; for the computing device, the total number of currently occupied lines will be incremented by 1, and correspondingly, the number of currently available lines will be decremented by 1.
[0064] According to the line allocation method of the present invention, a dedicated line queue stores service platform instances of the dedicated line type, and a single-line queue stores service platform instances of the single-line type. By traversing the dedicated line queue, each service platform instance is sequentially retrieved from the queue, a line is allocated to that service platform instance, and the service platform instance is added to the tail of the dedicated line queue and the result queue. By traversing the single-line queue, each service platform instance is sequentially retrieved from the single-line queue, and it is determined whether the number of allocated lines for the service platform instance is greater than 1. If not, a line is allocated to that service platform instance, and the service platform instance is added to the result queue. By using multi-threaded traversal of the result queue, each service platform instance is sequentially retrieved from the result queue, and the clues in the pending clue set of that service platform instance are processed. In this way, not only is on-demand allocation based on the required number and type of lines for the service platform achieved, but also reasonable, accurate, and efficient allocation of lines to multiple service platforms is realized, making full use of line resources and ensuring efficient clue processing.
[0065] Furthermore, by adding service platform instances with allocated lines to the secondary allocation queue, after allocating lines to both the dedicated line queue and the single line queue, if there are idle lines, lines can continue to be allocated to service platform instances in the secondary allocation queue in a loop. This maximizes line resource utilization, improves line resource efficiency, and helps cope with irregular traffic peaks, ensuring efficient processing of leads.
[0066] The various techniques described herein can be implemented in combination with hardware or software, or a combination thereof. Thus, the methods and apparatus of the present invention, or certain aspects or portions thereof, can take the form of program code (i.e., instructions) embedded in a tangible medium, such as a removable hard disk, USB flash drive, floppy disk, CD-ROM, or any other machine-readable storage medium, wherein when the program is loaded into and executed by a machine such as a computer, the machine becomes an apparatus for practicing the present invention.
[0067] When the program code is executed on a programmable computer, the mobile terminal generally includes a processor, a processor-readable storage medium (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device. The memory is configured to store program code; the processor is configured to execute the line allocation method of the present invention according to instructions in the program code stored in the memory.
[0068] By way of example, and not limitation, readable media include readable storage media and communication media. Readable storage media stores information such as computer-readable instructions, data structures, program module 103, or other data. Communication media generally embodies computer-readable instructions, data structures, program module 103, or other data in the form of modulated data signals such as a carrier wave or other transmission mechanism, and includes any information transmission medium. Any combination of the above is also included within the scope of readable media.
[0069] In the specification provided herein, the algorithms and displays are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems can also be used with the examples of this invention. The required structure for constructing such systems is apparent from the above description. Furthermore, this invention is not directed to any particular programming language. It should be understood that the contents of the invention described herein can be implemented using various programming languages, and the above description of specific languages is for the purpose of disclosing the best mode of implementation of the invention.
[0070] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.
[0071] Similarly, it should be understood that, in order to streamline this disclosure and aid in understanding one or more aspects of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof in the above description of exemplary embodiments of the invention. However, this method of disclosure should not be construed as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Therefore, the claims following the detailed description are hereby expressly incorporated into that detailed description, wherein each claim itself is a separate embodiment of the invention.
[0072] Those skilled in the art will understand that modules, units, or components of the devices disclosed in the examples herein can be arranged in the devices described in this embodiment, or alternatively, can be located in one or more devices different from the devices in this example. The modules in the foregoing examples can be combined into a single module or further divided into multiple sub-modules.
[0073] Those skilled in the art will understand that modules in the device of the embodiments can be adaptively changed and placed in one or more devices different from that embodiment. Modules, units, or components in the embodiments can be combined into a single module, unit, or component, and further, they can be divided into multiple sub-modules, sub-units, or sub-components. Except where at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or units of any method or device so disclosed. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.
[0074] Furthermore, those skilled in the art will understand that although some embodiments described herein include certain features included in other embodiments but not others, combinations of features from different embodiments are meant to be within the scope of the invention and form different embodiments.
[0075] Furthermore, some of the embodiments described herein are methods or combinations of method elements that can be implemented by a processor of a computer system or by other means of performing the functions. Therefore, a processor having the necessary instructions for implementing the methods or method elements forms means for implementing the methods or method elements. Furthermore, the elements described herein in the apparatus embodiments are examples of means for implementing the functions performed by elements for the purposes of carrying out the invention.
[0076] As used herein, unless otherwise specified, the use of ordinal numbers such as “first,” “second,” “third,” etc., to describe ordinary objects merely indicates different instances of similar objects and is not intended to imply that the objects being described must have a given order in time, space, ordering, or any other manner.
[0077] Although the invention has been described with respect to a limited number of embodiments, those skilled in the art will understand from the foregoing description that other embodiments are conceivable within the scope of the invention described herein. Furthermore, it should be noted that the language used in this specification has been chosen primarily for readability and edibility purposes, and not for the purpose of interpreting or limiting the subject matter of the invention. Therefore, many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the appended claims. The disclosure of the invention is illustrative rather than restrictive, and the scope of the invention is defined by the appended claims.
Claims
1. A line allocation method, executed in a computing device, said computing device including a dedicated line queue, a single-line queue, and a result queue, wherein, The leased line queue is suitable for storing service platform instances with leased line type, and the single-line queue is suitable for storing service platform instances with single-line type. The method includes: Traverse the dedicated line queue, take out each service platform instance from the dedicated line queue in sequence, allocate a line to the service platform instance, add the service platform instance to the tail of the dedicated line queue, and add it to the result queue; Traverse the single-line queue, take out each service platform instance from the single-line queue in turn, determine whether the number of allocated lines of the service platform instance is greater than 1, if not, allocate a line to the service platform instance and add the service platform instance to the result queue; The result queue is traversed by multiple threads, each service platform instance is retrieved from the result queue in turn, and the clues in the pending clue set of the service platform instance are processed.
2. The method as described in claim 1, wherein, The method further includes: The service platform set for currently pending clues is queried periodically. The service platform set includes multiple service platform instances. Each service platform instance includes the number of subscribed lines, line types, number of allocated lines, and set of pending clues. The line types include dedicated lines and single lines. Store service platform instances with the line type of leased line in the leased line queue, and store service platform instances with the line type of single line in the single line queue.
3. The method as described in claim 1 or 2, wherein, Adding the service platform instance to the tail of the leased line queue and to the results queue includes: Determine whether the number of allocated lines of the service platform instance is less than the number of subscribed lines; If so, add the service platform instance to the tail of the leased line queue and to the result queue; If not, the service platform instance is added to the secondary allocation queue and then to the result queue.
4. The method as described in claim 1 or 2, wherein, Determining whether the number of allocated lines for a service platform instance is greater than 1 also includes: If the value is greater than 1, the service platform instance is added to the secondary allocation queue.
5. The method as described in claim 1 or 2, wherein, Before traversing the dedicated line queue, the following is included: Determine the number of currently available lines for the computing device so as to update the number of currently available lines after allocating lines to the service platform instance.
6. The method of claim 5, wherein, Determining the number of currently available lines for the computing device includes: The number of currently available lines is determined based on the total number of lines, the total number of currently occupied lines, and the average connection rate of the leads.
7. The method of claim 6, wherein, The number of currently available lines = (total number of lines - total number of currently occupied lines) / average connection rate of leads.
8. The method of claim 2, wherein, Also includes: Determine if the number of currently available lines is greater than 0; If so, each service platform instance is sequentially retrieved from the secondary allocation queue, a line is allocated to the service platform instance, and the service platform instance is added to the tail of the secondary allocation queue and then added to the result queue. Until the number of currently available lines is 0.
9. A computing device, comprising: At least one processor; as well as A memory storing program instructions, wherein the program instructions are configured to be executed by the at least one processor, the program instructions including instructions for performing the method as described in any one of claims 1-8.
10. A readable storage medium storing program instructions that, when read and executed by a computing device, cause the computing device to perform the method as described in any one of claims 1-8.