Task scheduling method and device, medium, equipment and computer program product
By grouping processing based on call line resources and call thread pool in the robot calling system, the problem of slow dialing speed during peak call line resources is solved, and the efficiency and accuracy of task scheduling is achieved.
Patent Information
- Application Number
- CN202510589265.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-07-18
AI Technical Summary
In the prior art, robot calls are slow to dial when the call line resources are peak, resulting in low task scheduling efficiency.
By determining the call line resources of the target account, grouping numbers and using multiple call threads in the call thread pool to initiate outbound calls to the number set, efficient scheduling of tasks is achieved.
It improves the accuracy and efficiency of task scheduling, ensures that the target number matches the task processing capabilities of the target account, and improves the task processing capabilities of the single machine.
Smart Images

Figure CN120343156A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular, to a task scheduling method, apparatus, medium, device, and computer program product. Background Art
[0002] Robot calls can accurately identify the conversation intention based on voice dialogue technology and scenario operation requirements to build a natural and smooth voice service experience. For example, in business scenarios such as marketing, food delivery, and taxi-hailing, communication with users can be achieved through robot calls.
[0003] In actual application scenarios, customers usually use robots by creating a task interface, then submitting the task to the robot system, and then the robot schedules the task to make an outbound call based on the numbers in the task. In the related art, the outbound call task is usually scheduled in the form of timed scheduling. For example, a timed task is used to obtain the outbound call tasks submitted by customers, and then each called number in the task is called in turn. However, through the above method, the call speed is slow even when the call line resources are high. Summary of the Invention
[0004] This Summary of the Invention section is provided to introduce concepts in a brief form, which will be described in detail in the subsequent Detailed Description section. This Summary of the Invention section is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to be used to limit the scope of the claimed technical solution.
[0005] In a first aspect, the present disclosure provides a task scheduling method, the method comprising: Determine a target task under a target account to be scheduled, the target task being used to make outbound calls to a plurality of numbers; Based on the call line resources of the target account, determine a target number from the plurality of numbers of the target task; Group the target numbers to obtain at least one number set; Execute the target task based on a plurality of call threads in a call thread pool and the number set, wherein the call thread is used to make an outbound call to the numbers in the number set corresponding to the call thread.
[0006] In a second aspect, the present disclosure provides a task scheduling apparatus, the apparatus comprising: A first determination module, configured to determine a target task under a target account to be scheduled, the target task being used to make outbound calls to a plurality of numbers; A second determination module, configured to determine a target number from the plurality of numbers of the target task based on the call line resources of the target account; A grouping module, configured to group the target numbers to obtain at least one set of numbers; A first processing module, configured to execute the target task based on a plurality of call threads in a call thread pool and the set of numbers, wherein the call thread is used to initiate an outbound call to the numbers in the set of numbers corresponding to the call thread.
[0007] In a third aspect, the present disclosure provides a computer-readable medium, on which a computer program is stored, and when the computer program is executed by a processing device, the steps of the method described in the first aspect are implemented.
[0008] In a fourth aspect, the present disclosure provides an electronic device, including: A storage device, on which a computer program is stored; A processing device, configured to execute the computer program in the storage device to implement the steps of the method described in the first aspect.
[0009] In a fifth aspect, the present disclosure provides a computer program product, including a computer program, and when the computer program is executed by a processor, the steps of the method described in the first aspect are implemented.
[0010] Thus, through the above technical solutions, during the execution of the target task, the target numbers to be scheduled can be determined through the call line resources of the target account, so that the matching between the target numbers to be scheduled and the task processing capabilities of the target account can be ensured, and the accuracy and effectiveness of task scheduling can be improved. And by grouping the numbers of the task and initiating outbound calls to the numbers in the set of numbers based on a plurality of call threads in the call thread pool, the target task can be executed by multiple call threads, and the processing efficiency of task scheduling in a single machine can be improved.
[0011] Other features and advantages of the present disclosure will be described in detail in the subsequent specific implementation part. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Combined with the drawings and referring to the following specific implementation manners, the above and other features, advantages and aspects of each embodiment of the present disclosure will become more obvious. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic, and the original and elements are not necessarily drawn to scale. In the drawings: Figure 1 is a flowchart of a task scheduling method provided according to an embodiment of the present disclosure.
[0013] Figure 2 is a block diagram of a task scheduling device provided according to an embodiment of the present disclosure.
[0014] Figure 3 shows a schematic structural diagram of an electronic device suitable for implementing the embodiments of the present disclosure. Detailed Implementation Modes
[0015] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although some embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. On the contrary, these embodiments are provided to more thoroughly and completely understand the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not used to limit the protection scope of the present disclosure.
[0016] It should be understood that the various steps recited in the method embodiments of the present disclosure can be executed in a different order and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this regard.
[0017] The term "including" and its variants used herein are open-ended, that is, "including but not limited to". The term "based on" is "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0018] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order of the functions performed by these devices, modules or units or their interdependent relationships.
[0019] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive. Those skilled in the art should understand that unless clearly indicated otherwise in the context, it should be understood as "one or more".
[0020] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only for illustrative purposes and are not used to limit the scope of these messages or information.
[0021] It can be understood that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, usage scopes, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to users and the authorization of users should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0022] For example, when responding to an active request from a user, a prompt message is sent to the user to clearly prompt that the operation requested by the user will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application program, server, or storage medium that performs the operations of the present disclosed technical solution based on the prompt message.
[0023] As an optional but non-limiting implementation manner, the manner of sending a prompt message to the user in response to receiving an active request from the user may be, for example, in the form of a pop-up window, and the prompt message may be presented in text in the pop-up window. In addition, the pop-up window may also carry a selection control for the user to select "agree" or "disagree" to provide personal information to the electronic device.
[0024] It can be understood that the above notification and user authorization process is only illustrative and does not limit the implementation manner of the present disclosure. Other manners that comply with relevant laws and regulations can also be applied to the implementation manner of the present disclosure.
[0025] At the same time, it can be understood that the data involved in the present technical solution (including but not limited to the data itself, the acquisition or use of the data) should comply with the requirements of corresponding laws, regulations and related provisions.
[0026] Figure 1 As shown, it is a flowchart of a task scheduling method provided according to an embodiment of the present disclosure. As Figure 1 shown, the method may include: In step 11, determine a target task under a target account to be scheduled, where the target task is used to make outbound calls to multiple numbers.
[0027] In an application scenario, a customer can pre-register an account to obtain the account used by the customer, and then can create and submit a task based on a task interface through the account. When creating a task, the numbers corresponding to the task can be submitted, and then outbound calls are made to each number in the task when the task is executed to execute the task. The solution of the present disclosure can be applied to a single-machine task scheduling scenario or a distributed task scheduling scenario, and task scheduling is performed on each machine in the distributed scenario based on the task scheduling method of the present disclosure.
[0028] As an example, there can be multiple accounts to be scheduled. In this step, one or more of them can be randomly selected as the target accounts from the multiple accounts, and one of the tasks of the target accounts can be selected as the target task. For example, the first task can be selected as the target task based on the sorting of the creation times of the running tasks from the earliest to the latest, or the task with the highest priority among the running tasks can be selected as the target task, or one of the running tasks can be randomly selected as the target task. The specific selection method can be determined based on the rules pre-configured by the user, and the present disclosure does not limit this.
[0029] In step 12, based on the call line resources of the target account, the target number is determined from the multiple numbers of the target task.
[0030] Among them, in the scenario of making an outbound call to a user number, the maximum number of concurrent call lines that the account can provide is also configured during account registration. For example, the call line resources of account A1 can support at most 100 call lines for making calls. In this step, the target number can be determined based on this call line resource to improve the accurate determination of the target number, achieve the matching degree between the selection of the target number and the call line resources, and ensure the stable operation of the outbound call task.
[0031] In step 13, the target numbers are grouped to obtain at least one set of numbers.
[0032] As an example, if the number of target numbers is less than the grouping quantity threshold, the target numbers can be directly used as a set of numbers; if the number of target numbers is greater than or equal to the grouping quantity threshold, the target numbers can be further divided in combination with the grouping rules to obtain the set of numbers. As an example, when grouping the target numbers, the average grouping method can be used for grouping to ensure the balance of the numbers in each set of numbers to a certain extent.
[0033] In step 14, the target task is executed based on the multiple call threads in the call thread pool and the set of numbers, where the call thread is used to make an outbound call to the numbers in the set of numbers corresponding to the call thread.
[0034] For example, different sets of numbers can be distributed to different call threads, so that different call threads can concurrently make outbound calls to the numbers in their corresponding sets of numbers. For example, the call thread can select one of the caller numbers provided by the target account as the displayed number for making the outbound call, and then call the underlying interface for making the outbound call to execute the target task.
[0035] Thus, through the above technical solution, during the execution of the target task, the target number for scheduling can be determined through the call line resources of the target account, thereby ensuring the matching of the target number for scheduling and the task processing capabilities of the target account, and improving the accuracy and effectiveness of task scheduling. Moreover, by grouping the numbers of the tasks and making outbound calls to the numbers in the number set based on multiple call threads in the call thread pool, the target task can be executed by multiple call threads, enhancing the processing efficiency of task scheduling in a single machine.
[0036] In some possible embodiments, determining the target task under the target account to be scheduled includes: Obtaining the scheduling information of the accounts in the account list. The scheduling information may be a timestamp. When creating a task, an account can be added to Redis and stored using the structure of ZSet. ZSet is used to represent an ordered set, and its data structure is an ordered set of strings, where each element is associated with a score. As an example, in the present disclosure, this score can be the scheduling information, and the structure is represented as follows: member: account, score: timestamp.
[0037] Furthermore, a range between a preset minimum value and the current timestamp can be used as the range of the score, so as to query the accounts based on this range and determine the target account based on the queried accounts. For example, the queried accounts can be used as the target accounts to be scheduled.
[0038] As an example, after determining the target account for scheduling, the scheduling information of the target account can be increased based on the weight corresponding to the target account. The weight corresponding to the account can be preset, and the weights corresponding to different accounts can be the same or different. For example, the weight corresponding to each account is 5s. After determining the target account and scheduling it once, the sum of the scheduling information of the account and its weight can be used as the updated scheduling information. For example, after scheduling the target account once, the scheduling information of the target account, that is, the score score, is updated to score + 5s.
[0039] In some possible embodiments, determining the target task under the target account to be scheduled includes: Obtaining the scheduling information of the accounts in the account list. The examples of this scheduling information have been described in detail above and will not be elaborated here. Then, the top N accounts sorted in ascending order of the scheduling information are used as the target accounts, and the scheduling information of the target accounts is increased based on the weights corresponding to the target accounts, where N is a positive integer.
[0040] Among them, the account list can be stored based on the structure of ZSet. Then, the scheduling information can be used as the score in the ZSet structure to achieve ordered storage quickly based on this structure. For example, in the initial situation, the score of account A1 is 2s, the score of account A2 is 1s, the score of account A3 is 4s, and the score of account A4 is 5s. Then, it can be quickly sorted based on the scheduling information based on the ZSet structure. That is, the order of the scheduling information from small to large is A2, A1, A3, A4. If N is 2, A2 and A1 can be used as the target accounts. Then, the scheduling information of A2 and A1 can be increased. For example, the weight of the account is 5s. After scheduling A2 and A1 as the target accounts, the score of account A1 is 7s, and the score of account A2 is 6s. Then, the order of each account according to the scheduling information from small to large is A3, A4, A2, A1. If there are other nodes for task scheduling later, 2 accounts can be selected as the target accounts in this order, that is, A3 and A4 are used as the target accounts, and their scheduling information is updated, and the above process is repeated.
[0041] After determining the target accounts, the running tasks under the target accounts can be obtained, and the target tasks can be determined based on the running tasks.
[0042] Thus, through the above technical solutions, when performing task scheduling in a distributed environment, on the one hand, each machine node can obtain the same number of accounts for task scheduling, avoiding the situation that some machines schedule more accounts while some other machines schedule fewer accounts, and ensuring the balance between the accounts scheduled by different machines. On the other hand, it can also ensure that different accounts are scheduled as evenly as possible, avoiding the situation that the tasks of some accounts are always scheduled and processed while the tasks of some other accounts are always waiting for scheduling.
[0043] In some possible embodiments, the method may further include: At intervals of a preset period, determine whether there are un-called numbers among the tasks of the accounts in the account list; if there are no un-called numbers among the tasks of the account, remove the account from the account list.
[0044] Among them, the preset time period can be set based on the actual application scenario. For example, it can be set to 5s, and then each account in the account list can be traversed every 5s to determine whether there are un-called numbers among the tasks under this account. If there are no un-called numbers among the tasks under the account, it means that there are no tasks that need to initiate outbound calls under this account, that is, the tasks of the account have been completed. At this time, the account can be removed from the account list. If there are un-called numbers among the tasks under the account, that is, the tasks under this account have not been processed yet, the account remains in the account list to facilitate subsequent scheduling of the tasks under this account. It should be noted that in a distributed task scheduling scenario, each machine in the distributed architecture shares this account list to ensure scheduling balance when each machine determines the target account.
[0045] Thus, through the above technical solution, the accounts in the account list can be updated through a scheduled task, so that the accounts in the account list are all accounts that need to be scheduled, providing effective data support for subsequent task scheduling.
[0046] In some possible embodiments, determining the target number from the multiple numbers of the target task based on the call line resources of the target account may include: Based on the call line resources of the target account, determine the number of available call lines of the target account.
[0047] Among them, the total number of call lines of the target account and the call lines already occupied during the execution of the tasks under the target account can be determined based on the call line resources of the target account. Then, the difference between the total number of call lines and the number of call lines already occupied can be used as the number of available call lines of the target account. For example, if the total number of call lines of the target account is 100 and 80 call lines are in the process of making calls during the execution of the current target account's tasks, then the number of available call lines of the target account is 20.
[0048] After that, according to the number of available call lines, determine the target number from the numbers that have not initiated outbound calls among the multiple numbers.
[0049] Among them, the numbers that have not initiated outbound calls mean that no outbound call operation has been initiated to these numbers. To facilitate quickly determining the outbound call status of the numbers, the multiple numbers of the target task can be represented by a status flag to indicate whether an outbound call has been initiated to this number. For example, the status flag defaults to not initiated in the initial state. After an outbound call is initiated to this number during the execution of the task, the status flag can be updated to initiated to ensure the effective execution of the outbound call task. Correspondingly, in this embodiment, the numbers that have not initiated outbound calls can be obtained based on the status flag.
[0050] As an example, the number of available call lines can be used as the number of determined target numbers, and then target numbers can be selected from the numbers that have not initiated outbound calls to obtain the target numbers of the available call line quantity.
[0051] As another example, to ensure the stable operation of the outbound call task, an outbound call quantity threshold of the outbound call system can be preset, that is, the maximum number of outbound calls that the outbound call system can support. Accordingly, the determining the target numbers from the numbers that have not initiated outbound calls among the multiple numbers according to the number of call lines may include: If the number of call lines does not exceed the outbound call quantity threshold, select the target numbers of the number of call lines from the numbers that have not initiated outbound calls among the multiple numbers. Among them, the outbound call quantity threshold can be preconfigured based on the resources of the outbound call system. For example, the outbound call system can be stress-tested to configure the outbound call quantity threshold based on the results of the stress test. In the scenario of this embodiment, that the number of call lines does not exceed the outbound call quantity threshold means that the outbound call system can support the concurrent processing of the numbers of the call line quantity. At this time, target numbers can be selected from the numbers that have not initiated outbound calls based on the number of call lines. The number of call lines is N1, and the outbound call quantity threshold is T. If N1 is less than or equal to T, then N1 numbers can be selected from the numbers that have not initiated outbound calls as target numbers.
[0052] If the number of call lines exceeds the outbound call quantity threshold, select the target numbers of the outbound call quantity threshold from the numbers that have not initiated outbound calls among the multiple numbers. In this scenario, that the number of call lines exceeds the outbound call quantity threshold means that if the numbers of this call line quantity are processed concurrently, it will exceed the concurrent limit of the outbound call system. At this time, target numbers can be selected from the numbers that have not initiated outbound calls based on the outbound call quantity threshold. In this example, the number of call lines is N2. If N2 is greater than T, then T numbers can be selected from the numbers that have not initiated outbound calls as target numbers. Among them, the above control of the number of target numbers can be implemented by configuring a Lua script.
[0053] Thus, through the above technical solution, the limitation of the outbound call concurrency quantity can be achieved through the outbound call quantity threshold to prevent the abnormal operation of the underlying interface of the call service caused by excessive sudden business traffic, thereby effectively avoiding the pressure brought to the downstream by the sudden increase in business traffic and ensuring the safe and stable operation of the outbound call task.
[0054] In some possible embodiments, grouping the target numbers to obtain at least one number set may include: Obtain the number of threads of the call threads in the idle state in the call thread pool.
[0055] Among them, each call thread in the call thread pool can be traversed to determine the current state of the call thread. If the state of the call thread is the running state, it means that the call thread is in the process of task execution. If the state of the call thread is the idle state, it means that the call thread is idle. Then, the idle call thread can be obtained to execute the current target task to be scheduled. In this embodiment, the number of call threads in the idle state is obtained to distribute a number set to each idle thread by grouping.
[0056] After that, the target numbers are grouped based on the number of threads and the total number of the target numbers to obtain the number set, where the number of the number sets is the same as the number of threads.
[0057] For example, the target numbers can be evenly grouped based on the number of threads and the total number of the target numbers to obtain the number set. As an example, when the target numbers can be evenly divided into multiple groups, such as the number of threads is 4 and the total number of the target numbers is 240, the target numbers can be grouped to obtain 4 number sets, and each number set contains 60 numbers. As an example, when the target numbers cannot be evenly divided into multiple groups, such as the number of threads is 4 and the total number of the target numbers is 270, the target numbers can be grouped to obtain 4 number sets. Then, the basic number of the number set can be determined based on the total number of the target numbers and the number of threads. For example, the ratio of the two can be rounded to be the number of numbers. For the first M - 1 number sets among the M number sets, the number of numbers contained in each can be the basic number, and the last number set contains the remaining ungrouped target numbers. For example, number sets 1 - 3 each contain 68 numbers, and number set 4 contains 66 numbers.
[0058] Thus, through the above technical solution, the number of groups to be divided can be determined based on the number of call threads in the idle state in the call thread pool, so as to distribute a number set to each idle call thread subsequently, realizing the effective use of the resources of the call threads and improving the processing efficiency of each call thread at the same time.
[0059] Among them, during a scheduling process, the target numbers are divided into number sets, and there are no duplicates between the numbers in different number sets. In an actual application scenario, the process of the calling thread handling the number set takes a certain amount of time. For example, calling thread 1 is used to initiate outbound calls to the numbers in the number set. Task scheduling is usually executed based on timed tasks and can be scheduled through the scheduling thread in the machine node. Then, it is possible that during the next scheduling, there are still numbers in the number set that have not been called. During the next scheduling process, the numbers in the number set that have not been called may be grouped as target numbers again and processed by another calling thread, such as calling thread 2. Calling thread 1 and calling thread 2 can be threads on the same machine or threads on different machines. When a calling thread initiates an outbound call to a number, to avoid call conflicts between different threads, the thread that initiates the outbound call earliest can obtain the distributed lock for that number. For example, calling thread 1 obtains the distributed lock for number X1. If calling thread 2 obtains the distributed lock for number X1, a lock conflict will occur. At this time, calling thread 1 initiates an outbound call to number X1.
[0060] Therefore, when directly making outbound calls based on the numbers in the number set, in a concurrent situation, it is possible that different threads or different machines obtain the same number, and they may compete for the distributed lock for that number at the same time. It is also possible that after obtaining the distributed lock, it is found that an outbound call has already been made to that number. Therefore, it may be that due to lock conflicts, the calling thread does not effectively initiate a call, wasting the resources of the calling thread. Therefore, the present disclosure also provides the following embodiments.
[0061] In some possible embodiments, the executing the target task based on multiple calling threads in the calling thread pool and the number set may include: Obtaining a target calling thread in the calling thread pool that is in an idle state, where each target calling thread corresponds to a number set.
[0062] Among them, after obtaining the number set, a number set can be distributed to each target calling thread in an idle state, so as to initiate an outbound call to the numbers in the number set through this thread. The method of obtaining the target calling thread has been described in detail above and will not be elaborated here.
[0063] After that, duplicate removal processing is performed on the numbers in the number set of the target calling thread according to the numbers in the number list, and an updated number set is obtained. The numbers in the number list are initially empty values.
[0064] Among them, this number list can be implemented through the map structure in Redis, and the structure is as follows: redis key - task id, map - key: number id, map - value: timestamp.
[0065] Among them, the task id is used to represent the identifier of the target task, the number id is used to represent the identifier of the target number, and the timestamp is used to represent the timestamp when the target number is added to the number list.
[0066] Among them, deduplicating the numbers in the number set of the target call thread according to the numbers in the number list can be to delete the numbers that exist in the number list in the number set, so as to ensure that there are no duplicates between the numbers in the number set and the numbers in the number list.
[0067] Initially, the numbers in the number list are null values. If the target call thread 1 obtains the number set H1 and there are no numbers in the number list at this time, then deduplicate the numbers in the number set of the target call thread according to the numbers in the number list to obtain the updated number set, that is, H1.
[0068] After that, add the numbers in the updated number set to the number list, and initiate an outbound call based on each number in the target call thread and the updated number set to execute the target task. The number list contains the numbers to be called by the call threads in the running state.
[0069] After that, each number in the number set H1 can be added to the number list and the timestamp can be stored. Then the target call thread can initiate outbound calls to the numbers in the number set respectively. If there are still numbers that have not been called in H1 during the next scheduling, then during the next scheduling process, the numbers that have not been called in H1 may be grouped again as target numbers and processed by another call thread, such as call thread 2.
[0070] Then when call thread 2 processes the numbers in its number set H2, it can first deduplicate the numbers in the number set H2 according to the numbers in the number list to obtain the updated number set. During this process, if there are the same numbers in the number set H2 and the number set H1, the same numbers will be deleted in H2, so that the updated number set of call thread 2 does not contain the numbers in the number sets of other call threads, that is, filter out the numbers that have been processed, are being processed, or are to be processed by other threads based on the number list.
[0071] Thus, through the above technical solution, before the target call thread initiates an outbound call to the numbers in the number set, the numbers in the number set can be filtered based on the number list, thereby effectively avoiding lock conflicts or resource waste caused by different call threads processing the same number, ensuring that each machine dials different numbers, avoiding thread idling, ensuring the stable operation of each call thread initiating an outbound call, and improving the multi-machine scheduling and dialing efficiency.
[0072] In some embodiments, the method may further include: In the case where it is determined that the target call thread makes an outbound call based on the numbers in the updated number set, removing the number from the number list.
[0073] In this process, each time a call to a number is completed, the number can be removed from the number list, so as to reduce the number of numbers to be matched in the duplicate removal process, improve the efficiency of the duplicate removal process, and at the same time, the storage capacity of the numbers in the number list can be reduced, and the occupation of storage resources can be reduced.
[0074] It should be noted that if the storage time of a number in the number list exceeds the duration threshold, the number can be removed from the number list. Wherein, the storage time of the number in the number list can be the difference between the current time and the timestamp of the number, and the duration threshold can be set based on the actual application scenario. Thus, automatic timeout deletion of the numbers in the number list can be realized to apply to possible abnormal number call scenarios.
[0075] In some possible embodiments, the making an outbound call based on each number in the target call thread and the updated number set may include: Based on the target call thread and the configuration information of the target task, making an outbound call to each number in the updated number set, wherein the configuration information is stored in the local cache.
[0076] Among them, there may be configuration information that needs to be frequently queried during the process of the target call thread making a number call, and this configuration information usually does not change. For example, call prefix information, call whitelist and other configuration information. When making an outbound call to a number, the call prefix information of the number can be queried, so as to make a call in combination with the number and the call prefix information. For another example, different call whitelists can be set for different time periods, such as querying the call whitelist based on the number to determine whether the number can be called in the current time period.
[0077] Thus, through the above technical solutions, the configuration information can be stored in the local cache, so that the pressure on the qps (queries-per-second) of the downstream service can be effectively reduced, the data query performance can be improved, and further the efficiency of task scheduling can be improved.
[0078] Based on the same inventive concept, the present disclosure also provides a task scheduling device, as Figure 2 shown, the device 10 includes: A first determination module 100, configured to determine a target task under a target account to be scheduled, where the target task is used to make outbound calls to multiple numbers; The second determination module 200 is configured to determine a target number from the multiple numbers of the target task based on the call line resources of the target account; The grouping module 300 is configured to group the target numbers to obtain at least one set of numbers; The first processing module 400 is configured to execute the target task based on multiple call threads in the call thread pool and the set of numbers, where the call thread is used to initiate an outbound call to the numbers in the set of numbers corresponding to the call thread.
[0079] Optionally, the first determination module includes: The first acquisition sub-module is configured to acquire the scheduling information of the accounts in the account list; The first processing sub-module is configured to use the top N accounts with the scheduling information sorted from small to large in the account list as the target accounts, and increase the scheduling information of the target accounts based on the weights corresponding to the target accounts, where N is a positive integer; The second processing sub-module is configured to acquire the tasks in progress under the target account, and determine the target task based on the tasks in progress.
[0080] Optionally, the apparatus further includes: The third determination module is configured to determine whether there are un-called numbers in each task under the accounts in the account list at preset time intervals; The second processing module is configured to remove the account from the account list if there are no un-called numbers in each task under the account.
[0081] Optionally, the first processing module includes: The second acquisition sub-module is configured to acquire target call threads in the call thread pool that are in an idle state, where each target call thread corresponds to a set of numbers; The third processing sub-module is configured to perform duplicate removal processing on the numbers in the set of numbers of the target call thread according to the numbers in the number list, and obtain an updated set of numbers, where the numbers in the number list are initially empty; The fourth processing sub-module is configured to add the numbers in the updated set of numbers to the number list, and initiate an outbound call based on the target call thread and each number in the updated set of numbers to execute the target task.
[0082] Optionally, the apparatus further includes: The third processing module is configured to remove the number from the number list when it is determined that the target call thread initiates an outbound call based on the numbers in the updated set of numbers.
[0083] Optionally, the fourth processing sub-module is further configured to: Initiate an outbound call to each number in the updated number set based on the configuration information of the target call thread and the target task, where the configuration information is stored in the local cache.
[0084] Optionally, the grouping module includes: A third acquisition sub-module, configured to acquire the number of threads of the call threads in the idle state in the call thread pool; A grouping sub-module, configured to group the target numbers based on the number of threads and the total number of the target numbers to obtain the number set, where the number of the number sets is the same as the number of threads.
[0085] Optionally, the second determination module includes: A first determination sub-module, configured to determine the number of available call lines of the target account based on the call line resources of the target account; A second determination sub-module, configured to determine the target number from the numbers that have not initiated an outbound call among the multiple numbers according to the number of available call lines.
[0086] Optionally, the second determination sub-module includes: A third determination sub-module, configured to select the target numbers equal to the number of available call lines from the numbers that have not initiated an outbound call among the multiple numbers if the number of available call lines does not exceed the outbound call quantity threshold; A fourth determination sub-module, configured to select the target numbers equal to the outbound call quantity threshold from the numbers that have not initiated an outbound call among the multiple numbers if the number of available call lines exceeds the outbound call quantity threshold.
[0087] Next, referring to Figure 3 , which shows a schematic structural diagram of an electronic device (such as a terminal device or a server) 600 suitable for implementing the embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Tablet Computers), PMPs (Portable Multimedia Players), in-vehicle terminals (such as in-vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 3 The electronic device shown is only an example and should not impose any limitation on the functions and usage scope of the embodiments of the present disclosure.
[0088] As Figure 3As shown, the electronic device 600 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 601, which may perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0089] Generally, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or wiredly to exchange data. Although Figure 3 the electronic device 600 with various devices is shown, it should be understood that it is not required to implement or include all the shown devices. Instead, more or fewer devices may be implemented or included.
[0090] Specifically, according to an embodiment of the present disclosure, the process described above with reference to the flowchart may be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes program codes for performing the method shown in the flowchart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the above functions defined in the method of the embodiment of the present disclosure are executed.
[0091] It should be noted that the computer-readable medium described above in the present disclosure can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, the computer-readable storage medium can be any tangible medium that contains or stores a program, which can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present disclosure, a computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0092] In some embodiments, the client and the server can communicate using any currently known or future-developed network protocol such as HTTP (HyperText Transfer Protocol), and can be interconnected with digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include local area networks ("LANs"), wide area networks ("WANs"), the Internet (e.g., the Internet), and end-to-end networks (e.g., ad hoc end-to-end networks), as well as any currently known or future-developed networks.
[0093] The above computer-readable medium can be included in the above electronic device; or it can exist separately without being assembled into the electronic device.
[0094] The above computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to: determine a target task under a target account to be scheduled, where the target task is used to initiate outbound calls to multiple numbers; based on the call line resources of the target account, determine a target number from the multiple numbers of the target task; group the target numbers to obtain at least one set of numbers; and execute the target task based on multiple call threads in a call thread pool and the set of numbers, where the call thread is used to initiate an outbound call to a number in the set of numbers corresponding to the call thread.
[0095] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or combinations thereof. The programming languages include, but are not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code may execute entirely on the user's computer, partially on the user's computer, execute as a stand-alone software package, execute partially on the user's computer and partially on a remote computer, or execute entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0096] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that, in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, may be implemented by a dedicated hardware-based system for performing the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.
[0097] The modules involved in the embodiments of the present disclosure can be implemented in software or in hardware. Among them, the name of the module does not constitute a limitation to the module itself in some cases. For example, the first determination module can also be described as "the module for determining the target task under the target account to be scheduled".
[0098] The functions described above herein can be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that can be used include: Field Programmable Gate Array (FPGA), Application Specific Integrated Circuit (ASIC), Application Specific Standard Product (ASSP), System on Chip (SOC), Complex Programmable Logic Device (CPLD), and so on.
[0099] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media would include electrical connections based on one or more wires, portable computer disks, hard disks, Random Access Memory (RAM), Read Only Memory (ROM), Erasable Programmable Read Only Memory (EPROM or Flash Memory), optical fibers, portable compact disc read only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0100] According to one or more embodiments of the present disclosure, Example 1 provides a task scheduling method, wherein the method includes: Determine a target task under a target account to be scheduled, where the target task is used to initiate outbound calls to multiple numbers; Based on the call line resources of the target account, determine a target number from the multiple numbers of the target task; Group the target numbers to obtain at least one set of numbers; Execute the target task based on multiple call threads in a call thread pool and the set of numbers, where the call thread is used to initiate outbound calls to the numbers in the set of numbers corresponding to the call thread.
[0101] According to one or more embodiments of the present disclosure, Example 2 provides the method of Example 1, wherein the determining the target task under the target account to be scheduled includes: Obtain the scheduling information of the accounts in the account list; Sort the scheduling information in ascending order and use the top N accounts as the target accounts, and increase the scheduling information of the target accounts based on the weights corresponding to the target accounts, where N is a positive integer; Obtain the tasks in progress under the target accounts, and determine the target tasks based on the tasks in progress.
[0102] According to one or more embodiments of the present disclosure, Example 3 provides the method of Example 2, wherein the method further includes: At preset time intervals, determine whether there are un-called numbers among the tasks of each account in the account list; If there are no un-called numbers among the tasks of the account, remove the account from the account list.
[0103] According to one or more embodiments of the present disclosure, Example 4 provides the method of Example 1, wherein performing the target task based on multiple call threads in the call thread pool and the number set includes: Obtain the target call threads in the idle state in the call thread pool, where each target call thread corresponds to a number set; Deduplicate the numbers in the number set of the target call thread according to the numbers in the number list, and obtain an updated number set, where the numbers in the number list are initially null; Add the numbers in the updated number set to the number list, and initiate outbound calls based on each number in the target call thread and the updated number set to perform the target task.
[0104] According to one or more embodiments of the present disclosure, Example 5 provides the method of Example 4, wherein the method further includes: In the case where it is determined that the target call thread makes an outbound call based on the numbers in the updated number set, remove the numbers from the number list.
[0105] According to one or more embodiments of the present disclosure, Example 6 provides the method of Example 4, wherein making an outbound call based on each number in the target call thread and the updated number set includes: Based on the target call thread and the configuration information of the target task, make an outbound call to each number in the updated number set, where the configuration information is stored in the local cache.
[0106] According to one or more embodiments of the present disclosure, Example 7 provides the method of Example 1, wherein grouping the target numbers to obtain at least one number set includes: Obtain the number of call threads in the call thread pool that are in the idle state; Group the target numbers based on the number of threads and the total number of the target numbers to obtain the number set, where the number of the number sets is the same as the number of threads.
[0107] According to one or more embodiments of the present disclosure, Example 8 provides the method of Example 1, wherein the determining the target numbers from the multiple numbers of the target task based on the call line resources of the target account includes: Based on the call line resources of the target account, determine the number of available call lines of the target account; According to the number of available call lines, determine the target numbers from the numbers among the multiple numbers that have not initiated outbound calls.
[0108] According to one or more embodiments of the present disclosure, Example 9 provides the method of Example 8, wherein the determining the target numbers from the numbers among the multiple numbers that have not initiated outbound calls according to the number of available call lines includes: If the number of available call lines does not exceed the outbound call quantity threshold, select the target numbers of the number of available call lines from the numbers among the multiple numbers that have not initiated outbound calls; If the number of available call lines exceeds the outbound call quantity threshold, select the target numbers of the outbound call quantity threshold from the numbers among the multiple numbers that have not initiated outbound calls.
[0109] According to one or more embodiments of the present disclosure, Example 10 provides a task scheduling device, and the device includes: A first determination module, configured to determine a target task under a target account to be scheduled, where the target task is used to initiate outbound calls to multiple numbers; A second determination module, configured to determine target numbers from the multiple numbers of the target task based on the call line resources of the target account; A grouping module, configured to group the target numbers to obtain at least one number set; A first processing module, configured to execute the target task based on multiple call threads in a call thread pool and the number set, where the call threads are used to initiate outbound calls to the numbers in the number set corresponding to the call threads.
[0110] According to one or more embodiments of the present disclosure, Example 11 provides a computer-readable medium, on which a computer program is stored, and when the computer program is executed by a processing device, the steps of the method described in any one of Examples 1-9 are implemented.
[0111] According to one or more embodiments of the present disclosure, Example 12 provides an electronic device, including: A storage device on which a computer program is stored; A processing device for executing the computer program in the storage device to implement the steps of the method according to any one of Examples 1-9.
[0112] According to one or more embodiments of the present disclosure, Example 13 provides a computer program product including a computer program which, when executed by a processor, implements the steps of the method according to any one of Examples 1-9.
[0113] The above description is only a preferred embodiment of the present disclosure and an explanation of the applied technical principles. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above technical features. At the same time, it should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosure concept. For example, the technical solutions formed by mutually replacing the above features with the technical features (but not limited to) having similar functions disclosed in the present disclosure.
[0114] In addition, although the operations are depicted in a particular order, this should not be construed as requiring that the operations be performed in the particular order shown or in sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, although several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features described in the context of separate embodiments may also be implemented combinatorially in a single embodiment. Conversely, the various features described in the context of a single embodiment may also be implemented separately or in any suitable sub-combination in multiple embodiments.
[0115] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. On the contrary, the specific features and acts described above are merely example forms for implementing the claims. Regarding the device in the above embodiments, the specific manner in which each module performs operations has been described in detail in the embodiments related to the method, and will not be elaborated here.
Claims
1. A task scheduling method, characterized in that, The method includes: Determine a target task under a target account to be scheduled, where the target task is used to make outbound calls to multiple numbers; Based on the call line resources of the target account, determine a target number from the multiple numbers of the target task; Group the target numbers to obtain at least one set of numbers; Execute the target task based on multiple call threads in a call thread pool and the set of numbers, where the call thread is used to make outbound calls to the numbers in the set of numbers corresponding to the call thread.
2. The method according to claim 1, wherein The determining of the target task under the target account to be scheduled includes: Obtain the scheduling information of the accounts in the account list; Sort the accounts with the top N scheduling information in ascending order as the target accounts, and increase the scheduling information of the target accounts based on the weights corresponding to the target accounts, where N is a positive integer; Obtain the tasks in progress under the target account, and determine the target task based on the tasks in progress.
3. The method according to claim 2, wherein The method further includes: At preset time intervals, determine whether there are un-called numbers in each task under the accounts in the account list; If there are no un-called numbers in each task under the account, remove the account from the account list.
4. The method according to claim 1, wherein The executing of the target task based on multiple call threads in a call thread pool and the set of numbers includes: Obtain target call threads in the call thread pool that are in an idle state, where each target call thread corresponds to a set of numbers; Deduplicate the numbers in the set of numbers of the target call thread according to the numbers in the number list, where the numbers in the number list are initially null values, to obtain an updated set of numbers; Add the numbers in the updated set of numbers to the number list, and make outbound calls based on the target call thread and each number in the updated set of numbers to execute the target task.
5. The method according to claim 4, wherein The method further includes: In the case of determining that the target call thread makes an outbound call based on the numbers in the updated set of numbers, remove the numbers from the number list.
6. The method according to claim 4, characterized in that, The making of outbound calls based on the target call thread and each number in the updated set of numbers includes: Based on the target call thread and the configuration information of the target task, make outbound calls to each number in the updated set of numbers, where the configuration information is stored in a local cache.
7. The method according to claim 1, wherein The grouping of the target numbers to obtain at least one set of numbers includes: Obtain the number of threads of the call threads in the call thread pool that are in an idle state; Group the target numbers based on the number of threads and the total number of the target numbers to obtain the set of numbers, where the number of sets of numbers is the same as the number of threads.
8. The method according to claim 1, wherein The determining of the target number from the multiple numbers of the target task based on the call line resources of the target account includes: Based on the call line resources of the target account, determine the number of available call lines of the target account; According to the number of available call lines, determine the target number from the numbers that have not made outbound calls among the multiple numbers.
9. The method according to claim 8, characterized in that, Determining the target number from the numbers among the multiple numbers that have not initiated outbound calls according to the number of available call lines includes: If the number of available call lines does not exceed the outbound call quantity threshold, select the target number of the number of available call lines from the numbers among the multiple numbers that have not initiated outbound calls; If the number of available call lines exceeds the outbound call quantity threshold, select the target number of the outbound call quantity threshold from the numbers among the multiple numbers that have not initiated outbound calls.
10. A task scheduling device, characterized in that, The device includes: A first determination module, configured to determine a target task under a target account to be scheduled, where the target task is used to initiate outbound calls to multiple numbers; A second determination module, configured to determine a target number from the multiple numbers of the target task based on the call line resources of the target account; A grouping module, configured to group the target numbers to obtain at least one number set; A first processing module, configured to execute the target task based on multiple call threads in a call thread pool and the number set, where the call thread is used to initiate outbound calls to the numbers in the number set corresponding to the call thread.
11. A computer-readable medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processing device, the steps of the method according to any one of claims 1-9 are implemented.
12. An electronic device, characterized in that, It includes: A storage device on which a computer program is stored; A processing device, configured to execute the computer program in the storage device to implement the steps of the method according to any one of claims 1-9.
13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, the steps of the method according to any one of claims 1-9 are implemented.