WO2019075980A1 - 一种线程的调整方法及其终端 - Google Patents

一种线程的调整方法及其终端 Download PDF

Info

Publication number
WO2019075980A1
WO2019075980A1 PCT/CN2018/077682 CN2018077682W WO2019075980A1 WO 2019075980 A1 WO2019075980 A1 WO 2019075980A1 CN 2018077682 W CN2018077682 W CN 2018077682W WO 2019075980 A1 WO2019075980 A1 WO 2019075980A1
Authority
WO
WIPO (PCT)
Prior art keywords
thread
upper limit
tasks
task
processed
Prior art date
Application number
PCT/CN2018/077682
Other languages
English (en)
French (fr)
Inventor
陈海涛
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2019075980A1 publication Critical patent/WO2019075980A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/48Indexing scheme relating to G06F9/48
    • G06F2209/484Precedence

Definitions

  • the present application belongs to the field of computer technology, and in particular, to a method for adjusting a thread and a terminal thereof.
  • the server responds to the customer-initiated service by means of concurrent processing. Specifically, the server processes multiple service requests simultaneously by starting multiple threads.
  • the adjustment method of the existing thread the number of threads is fixed, if during the busy period of the business, the starting thread may not be able to meet the current traffic, resulting in a backlog of pending tasks, thereby reducing the efficiency of the business response, and even A large number of tasks are invalidated or timed out, which reduces the quality of service of the server and the user experience.
  • the embodiment of the present application provides a method for adjusting a thread and a terminal thereof, so as to solve the adjustment method of the existing thread, the number of threads is fixed. If the thread is in a busy period, the started thread may not be able to satisfy the current traffic. This results in a backlog of pending tasks, which reduces the efficiency of business response, and even leads to a large number of tasks failing or timeouts, reducing the quality of service of the server and the user experience.
  • a first aspect of the embodiment of the present application provides a method for adjusting a thread, where the method for adjusting the thread includes:
  • Determining the current number of thread starts according to the number of tasks and a preset thread start limit
  • a thread corresponding to the number of thread startups is started, and the pending task is responded to by the thread.
  • the current thread start number is adjusted according to the to-be-processed task included in the current to-be-processed task library, so as to maintain the time at which each service response period arrives.
  • the service response capability of the terminal device matches the current number of tasks, which improves the efficiency of the service response and the service quality of the terminal device, and provides a better user experience.
  • FIG. 1 is a flowchart of an implementation of a method for adjusting a thread according to a first embodiment of the present application
  • FIG. 2 is a flowchart of a specific implementation of a thread adjustment method S102 according to a second embodiment of the present application
  • FIG. 3 is a flowchart of a specific implementation of a method for adjusting a thread according to a third embodiment of the present application
  • FIG. 4 is a flowchart of a specific implementation of a thread adjustment method S102 according to a fourth embodiment of the present application.
  • FIG. 5 is a flowchart of a specific implementation of a thread adjustment method S103 according to a fifth embodiment of the present application.
  • FIG. 6 is a structural block diagram of a thread adjustment terminal according to an embodiment of the present application.
  • FIG. 7 is a schematic diagram of a terminal device according to an embodiment of the present application.
  • FIG. 1 is a flowchart of an implementation of a method for adjusting a thread provided by a first embodiment of the present application, which is described in detail as follows:
  • the number of tasks included in the to-be-processed task library is queried at preset time intervals.
  • the terminal device after receiving the processing task sent by another user terminal, stores the processing task in the to-be-processed task library, so that when the processing opportunity arrives, according to the priority and receiving order of each to-be-processed task. , extract the corresponding pending task to respond.
  • the to-be-processed task library may be in the local memory of the terminal device.
  • the terminal device directly reads the local memory, and can obtain related information of the task to be processed; the task library to be processed may also be one.
  • a separate storage server that specifically receives and stores processing tasks sent by individual user terminals. Because the terminal device needs to respond to the processing tasks sent by multiple user terminals at the same time, that is, a certain number of ports need to be allocated to perform the processing of receiving the processing task, on the other hand, after the terminal device completes the corresponding pending task, it needs to The processing result is returned to the user terminal. At this time, the return operation needs to call a certain number of ports.
  • the terminal device may set up an independent storage server, set a corresponding number of ports, and receive processing tasks sent by other user terminals, and the terminal device only needs to establish a relationship with the task library to be processed.
  • the data link is used to obtain the required pending task, and other ports can be used to feed back the generated processing result to the user terminal.
  • the terminal device queries the number of tasks included in the to-be-processed task library at a preset time interval, where the preset time interval is specifically a task extraction period of the terminal device.
  • the terminal device has a preset task extraction period and a task response period.
  • the terminal device extracts a corresponding number of pending tasks from the to-be-processed task library, and enters the task response period.
  • the terminal device responds to the extracted task to be processed through multiple threads, and does not extract the to-be-processed task from the to-be-processed task library.
  • the step S101 provided in this embodiment is an operation performed when the terminal device enters the task extraction period. For example, if the preset time interval is 2 minutes, the terminal device will query the number of tasks included in the to-be-processed task library every two minutes, and then respond to the tasks in the to-be-processed task library.
  • the preset time interval may be set according to the actual needs of the user, for example, 30 seconds, 10 minutes, etc., or may be adjusted according to whether the current time period belongs to a busy time period.
  • the current number of thread starts is determined according to the number of tasks and a preset thread start upper limit.
  • the terminal device after acquiring the number of tasks included in the to-be-processed task library, acquires a preset thread start upper limit, determines the number of tasks and the thread start upper limit, and determines whether it can be Each pending task is assigned a separate thread to respond. If the number of tasks is less than or equal to the upper limit of the thread start, it means that a thread can be set for each pending task to respond to the to-be-processed task. At this time, the current number of threads started is the number of tasks; If the number is greater than the preset thread start limit, it means that the number of tasks cannot exceed the number of threads that can be opened, that is, the task cannot respond to all pending tasks within the task response period. Therefore, the thread start limit is set to the current one. The number of threads started.
  • the number of tasks of the first type is smaller than the upper limit of the thread start corresponding thereto, and the number of tasks of the second type is greater than the upper limit of the thread start corresponding thereto, and at this time, the number of tasks of the first type
  • the remaining threads can be used to respond to the second type of task.
  • the number of tasks of the first type is 15, and the corresponding upper thread start limit is 30. Therefore, the remaining 15 threads of the resources allocated by the terminal device to the task of the first type are idle and can respond. Other types of tasks.
  • the terminal device determines that the number of tasks of the second type is 25, and the corresponding upper limit of the second thread is 20, so that 5 of the remaining 15 threads of the first type of thread can be extracted for response.
  • the second type of task so that each type of resource is reasonably called according to the actual situation.
  • the to-be-processed task matching the number of the thread-starting is extracted from the to-be-processed task library.
  • the terminal device first obtains the priority of each task to be processed, and extracts the N tasks to be processed with the highest priority from the to-be-processed task library according to the current number of startup threads N determined in S102. A pending task that is executed as a response to this task.
  • the priority of the task to be processed may be set by the task initiator, that is, the user requested by the task, and when the user generates the task to be processed, the priority of the task to be processed is set, so that the terminal device receives the When the task is to be processed, the corresponding response timing can be determined based on its corresponding priority.
  • the user directly sets the priority parameter, such as the priority byte of the task to be processed, and sets the corresponding parameter value.
  • the priority of the task to be processed may also be set indirectly by limiting the task feedback time, for example, for the priority. The higher scheduled task has a shorter predetermined feedback time, and the corresponding scheduled feedback time is longer for the pending task with lower priority.
  • the priority of the task to be processed may also be set by the terminal device. Specifically, the terminal device queries the preset task type and the priority correspondence relationship list according to the task type of the task to be processed, so as to determine the priority of the task to be processed, and generates a correspondence list between the task to be processed and the priority. When performing the operation of S103, the terminal device directly reads the correspondence list of the task to be processed and the priority, and determines the priority corresponding to each task to be processed.
  • the to-be-processed tasks in the correspondence between the task to be processed and the priority are sorted according to the priority order of the priorities, and if the tasks to be processed with the same priority are sorted according to the order of the task acquisition time, Therefore, the terminal device directly intercepts the to-be-processed task corresponding to the number of thread-starting N, and does not need to obtain the priority information one by one, and then extracts, thereby improving the task response efficiency.
  • the terminal device starts a thread corresponding to the number of threads determined in S102, and responds to the to-be-processed task extracted in S103 by the activated thread. Specifically, each thread responds to a task to be processed, thereby achieving the purpose of concurrently responding to multiple tasks to be processed.
  • the request user identifier corresponding to the task is obtained, and the task processing result is fed back to the terminal corresponding to the request user identifier according to the request user identifier.
  • the operation result feedback operation may be performed by the thread responding to the to-be-processed task, or after the thread performs the completion task, the processing result and the network address of the corresponding terminal are sent to the processing result sending module, and the processing result sending module is sent to the processing result sending module. Unified sending of task results.
  • the terminal device may summarize the processing results generated by all threads in the current response period, and then uniformly report the processing result to the corresponding user terminal.
  • the thread processing the task of the type to be processed may complete the response operation earlier, and the processing result is uniformly sent, that is, the thread is idle. status.
  • the terminal device can arrange the idle thread to support the thread with slow progress, that is, execute the slow-going pending task through two threads at the same time, thereby achieving the response rate of the faster task and the utilization of the resource.
  • the method for adjusting the thread queries the number of tasks included in the to-be-processed task library at a preset time interval, and adjusts the current number of threads to be started according to the number of tasks.
  • the terminal device waits for the priority of each task to be processed from the to-be-processed task library.
  • the processing task library extracts the to-be-processed task that is consistent with the number of threads to be started, and responds, thereby realizing the purpose of dynamically adjusting the number of thread startups of the terminal device.
  • the number of startup threads of the server remains unchanged.
  • the thread is easy to start but idle, which wastes the resources of the server.
  • the number of current thread starts is increased, which may easily lead to a backlog of tasks.
  • the current task will be adjusted according to the pending tasks included in the current pending task library. The number of threads is started, so that the service response capability of the terminal device is matched with the current number of tasks at the time when each service response period arrives, thereby improving the efficiency of the service response and the service quality of the terminal device, thereby providing a better user. Use experience.
  • FIG. 2 is a flowchart showing a specific implementation of a thread adjustment method S102 according to the second embodiment of the present application.
  • a thread adjustment method S102 provided by this embodiment further includes the following steps, which are as follows:
  • the determining, according to the number of tasks and a preset thread start upper limit, the current number of thread startups including:
  • the preset thread start upper limit in the terminal device changes with time, that is, different time segments correspond to one thread start upper limit. For example, for an idle time period, the number of pending tasks received by the terminal device is generally small. At this time, the terminal device does not need to be in a full load state to work, but can gradually respond to the processing task, so the thread start upper limit is small; During busy hours, the terminal device will continue to receive a large number of pending tasks. At this time, the terminal device can be in a full load state, avoiding a large number of pending tasks and causing batch tasks to fail.
  • the terminal device determines the time information of the current time.
  • the time information may be absolute time information, such as 18:53, and the current time is uniquely determined; the time information may also be relative time information, such as the duration of operation of the terminal device, the duration of the full load mode, etc., for indicating the terminal.
  • Time information of the running status of the device In this case, the terminal device defines the maximum running time of each operating mode. If the time information of the current time, that is, the running time of the running mode is greater than the maximum running time, the operating mode of the terminal device is switched, and the current mode is adjusted accordingly.
  • the thread starts the upper limit, so that the administrator can adjust the thread start limit of the terminal device in real time by configuring the running mode of the response and the thread to start the upper limit relationship list.
  • the terminal device stores in advance a thread start upper limit corresponding to each different time information, and generates a correspondence relationship between the thread start upper limit and the time information.
  • the corresponding relationship may be obtained from a host server of the terminal device, and the upper server determines the running limit of the thread corresponding to each device in different time segments by acquiring the running status of the multiple terminal devices, and then generates a suitable upper limit for each terminal device.
  • the general thread starts the correspondence between the online and time information. Therefore, each terminal device can directly obtain the correspondence from the upper server and store it in the local storage module.
  • the user may generate a correspondence between the thread start upper limit and the time information according to actual usage requirements, or may perform adjustment based on the existing correspondence.
  • the terminal device In order to facilitate management, the terminal device generates a corresponding relationship between the thread start upper limit and the time information by means of the default setting of the system, and can also be generated or adjusted by the user.
  • the terminal device After determining the current time information, the terminal device queries the preset relationship between the preset thread start upper limit and the time information, determines the current thread corresponding to the thread start upper limit, and then performs the related operation of S203.
  • the current thread start number is determined according to the number of tasks and the thread start upper limit corresponding to the time information.
  • the terminal device compares the number of tasks included in the task library to be executed with the thread start upper limit, and selects the smaller of the two as the current The number of threads started.
  • the value of the thread start upper limit is not fixed, but may be adjusted according to different time information, thereby effectively utilizing the thread resources of the terminal device, avoiding unnecessary resource waste, and improving resources.
  • the terminal device may work in a full-load or overload mode for a long time during a busy period, so in order to provide a certain buffer period for the terminal device, the terminal device may be in a state of less load during the non-busy period. For example, in a certain task extraction period of the idle time, the terminal device detects that the to-be-processed task library contains 100 pending tasks, and the thread starting limit corresponding to the time is 50, and the next extraction period database does not receive the new one.
  • the pending task therefore, the terminal device can perform the above 100 pending tasks through two task response periods, although the terminal device can reach 100 in the busy period during the busy period, but the time period is the idle time period, that is, the During the time period, the mathematical expectation value of the task amount of the task to be processed is small, and a large number of pending tasks are not continuously acquired for a long time, so that the lower thread start upper limit can be maintained even if a sudden increase of pending tasks is encountered. , can still respond gradually.
  • FIG. 3 is a flowchart showing a specific implementation of a method for adjusting a thread according to a third embodiment of the present application. As shown in FIG. 3, with respect to the embodiment shown in FIG. 2, a thread adjustment method provided by this embodiment further includes the following steps, which are detailed as follows:
  • the adjusting method of the thread further includes:
  • a history service response record is acquired; wherein the history service response record includes to-be-processed task information and hardware resource operation information of each time period.
  • the terminal device after responding to the task to be executed, the terminal device generates a to-be-processed task response record corresponding to the task to be processed, wherein the to-be-processed task response record specifically includes: response opening time, response completion time, and execution time. , hardware resource occupancy, response waiting time and other information.
  • the terminal device may determine the number of tasks to be processed included in different time segments, and the consumption of hardware resources of the terminal device in each time period, and then generate the history. Service response record.
  • the hardware resource running information includes but is not limited to the following one or a combination of at least two: operating state of the CPU, occupation of the memory, operating temperature of the terminal device, data read/write rate, and the like.
  • the hardware resource operation information is related to external factors such as the number of tasks currently being responded to, and is related to external factors such as temperature, voltage, and power of the equipment room. Therefore, the terminal device not only acquires information about the task to be processed in each time period, but also acquires hardware.
  • the resource runs information and generates a corresponding historical service response record to determine the thread start limit, taking into account internal factors as well as factors affecting the external environment to the terminal device.
  • the terminal device determines the average number of tasks to be executed in each time period according to different time periods in the historical service response record or the number of tasks to be executed corresponding to the task extraction period, thereby obtaining the number of tasks to be executed over time.
  • Trend The terminal device obtains a first factor that determines a correspondence between the thread start upper limit and the time information based on the trend of the number of tasks to be executed.
  • the terminal device determines the running state of the terminal device in each time period according to the hardware operation information corresponding to the different time periods or the task extraction period in the historical service response record, and the running state includes the load condition, the running efficiency, and the abnormality.
  • the incidence rate so that the running state changes with time.
  • the terminal device obtains a second factor that determines a correspondence between the thread start upper limit and the time information based on the running state change trend.
  • the terminal device generates a correspondence between the thread start upper limit and the time information according to the first factor and the second factor.
  • the first factor is specifically an average execution task number
  • the second factor is hardware operation efficiency
  • the thread start upper limit corresponding to any time period is: average execution task number ⁇ hardware operation efficiency.
  • the proportional coefficient is a positive number greater than zero.
  • the terminal device may further adjust the correspondence relationship between the thread start upper limit and the time information according to the historical service response record. Based on the foregoing purpose, the terminal device first acquires the historical service response record of the local device, and then passes the history. The service response record is learned to improve the accuracy of the correspondence list.
  • FIG. 4 is a flowchart showing a specific implementation of a thread adjustment method S102 according to the fourth embodiment of the present application.
  • the current thread is determined according to the number of tasks and a preset thread start upper limit.
  • the number of startups, including S401 ⁇ S405, is as follows:
  • the thread start limit of the terminal device may be adjusted according to the current actual number of tasks, so that the task processing capability of the terminal device matches the current task amount. Since the preset thread start upper limit is obtained based on the administrator or the system history record, various sudden situations often occur in the actual process. Therefore, the terminal device sets a process of adjusting the thread start limit. To flexibly adjust the thread start limit.
  • the terminal device detects that the number of tasks included in the current task library to be processed is greater than the thread start upper limit, that is, the terminal device cannot complete the response to all the pending tasks in the current task response period, and the actual task amount Greater than the task processing capability of the current terminal device. At this time, the terminal device calculates a first ratio between the number of tasks and the thread start upper limit, and determines whether the first ratio is greater than a preset up trigger threshold.
  • the up trigger threshold is used to define whether the current task amount belongs to an abnormal increase, and whether the current task processing capability is sufficient to cope with the current task amount without causing a large batch of tasks to be backlogged and invalid. Therefore, if the first ratio is less than or equal to the up trigger threshold, it indicates that the current task processing capability of the terminal device matches the current task amount, and the thread start upper limit does not need to be adjusted, and the current thread start upper limit is maintained; When the ratio is greater than the upper trigger threshold, the current task amount is increased, and the current processing capability of the terminal device cannot ensure that the pending task can respond normally. Therefore, the thread start upper limit is adjusted, and the related operation of S403 is performed.
  • the thread start upper limit is increased based on the first ratio, and the number of the tasks and the increased thread start upper limit are selected. The smaller value is used as the number of current thread startups.
  • the terminal device after detecting that the first ratio is greater than the preset uplink trigger threshold, performs corresponding adjustment on the thread start upper limit of the terminal device.
  • the terminal device pre-sets a correspondence list of the first ratio and the adjustment range, and queries the adjustment coefficient corresponding to the first ratio according to the currently calculated first ratio, and then increases the thread start upper limit by using the adjustment coefficient.
  • the terminal device selects a smaller one from the number of tasks and the adjusted thread start upper limit as the current thread start number. Since the adjustment factor may be greater than the first ratio, the actual calculated thread start upper limit may be greater than the number of tasks.
  • the terminal device further adjusts the current thread start upper limit according to the current number of tasks. Because the terminal device sets the correspondence between the time information and the thread start upper limit, it may be based on the current time in each period in the history record. The upper limit is used as the basis for the setting. Therefore, in order to make the correspondence more accurate and allocate the thread resources of the terminal device reasonably, the terminal device can also appropriately reduce the thread start upper limit according to the current number of tasks, so that the reserved thread can be executed. Other operations.
  • the terminal device when determining that the number of tasks is less than the thread start upper limit, calculates a second ratio between the thread start upper limit and the number of tasks, and determines whether the second ratio is greater than a preset down trigger threshold. If the second ratio is greater than the down trigger threshold, it indicates that the task processing capability of the terminal device is far greater than the currently required task amount, so the thread start upper limit is lowered, and the operation of S405 is performed; otherwise, if the second ratio is less than or equal to the lower limit Trigger the threshold to maintain the current thread start limit.
  • the thread start upper limit is lowered based on the first ratio, and the number of the tasks and the reduced thread start upper limit are selected. The smaller value is used as the number of current thread startups.
  • the terminal device after detecting that the second ratio is greater than the preset down trigger threshold, performs corresponding adjustment on the thread start upper limit of the terminal device.
  • the terminal device pre-sets a correspondence list of the second ratio and the adjustment range, and queries the adjustment coefficient corresponding to the second ratio according to the currently calculated second ratio, and then reduces the thread start upper limit by the adjustment coefficient.
  • FIG. 5 is a flowchart showing a specific implementation of a thread adjustment method S103 according to the fifth embodiment of the present application. As shown in FIG. 5, with respect to the embodiment shown in FIG. 1, the thread adjustment method S103 provided in this embodiment further includes the following steps, which are described in detail as follows:
  • the terminal device first acquires the current time information and the sending time of the task, and calculates a waiting time length relative to the current time. If the waiting time length is greater than the maximum waiting time length, it indicates that the task has expired and is identified as an invalid pending task. Conversely, if the waiting duration is less than or equal to the maximum waiting duration, it indicates that the task is valid and is identified as a valid pending task.
  • the terminal device detects that the task to be processed is an invalid task, the task to be processed is deleted from the task library, thereby ensuring that the to-be-processed tasks included in the to-be-processed task library are valid. Pending task. Further, in order to notify the user of the service request that the pending task sent by the user fails, the terminal device pushes the service timeout information to the client corresponding to the task to be processed, so that the client re-initiates the task request.
  • the priority of the to-be-processed task is adjusted based on the remaining effective duration of the to-be-processed task.
  • the terminal device determines that the to-be-processed task is a valid task, the remaining valid time included in the task is extracted, so that the priority of the to-be-processed task is adjusted according to the remaining valid time.
  • the terminal device avoids the failure of the pending task, and first responds to the more urgent pending task. Therefore, the terminal device increases the priority of the pending task with a shorter remaining time according to the effective remaining time of each task to be processed, and the effective remaining Longer pending tasks maintain their priorities.
  • the terminal device first filters the processing task before the extracting operation, thereby improving the efficiency of the service response, thereby improving the efficiency of the service response.
  • FIG. 6 is a structural block diagram of a thread adjustment terminal according to an embodiment of the present application. Each unit included in the adjustment terminal of the thread is used to execute each step in the embodiment corresponding to FIG. 1. Referring to FIG. 6, the thread adjustment terminal includes:
  • the task number determining unit 61 is configured to query the number of tasks included in the to-be-processed task library at preset time intervals;
  • the current thread start number determining unit 62 is configured to determine the current thread start number according to the number of tasks and a preset thread start upper limit;
  • the to-be-processed task extracting unit 63 is configured to extract, from the to-be-processed task library, a to-be-processed task that matches the number of the thread-startings based on the priority of each to-be-processed task;
  • the to-be-processed task response unit 64 is configured to start a thread corresponding to the number of threads to be started, and respond to the to-be-processed task by the thread.
  • the current thread startup number determining unit 62 includes:
  • a time information determining unit configured to acquire time information of a current time
  • a thread start upper limit determining unit configured to determine, according to a preset correspondence between a preset thread start upper limit and time information, the thread start upper limit corresponding to the time information
  • the current thread start number setting unit is configured to determine the current thread start number according to the number of tasks and the thread start upper limit corresponding to the time information.
  • the adjusting device of the thread further includes:
  • a history service response record obtaining unit configured to acquire a history service response record, where the history service response record includes to-be-processed task information and hardware resource running information of each time period;
  • the thread start upper limit correspondence generating unit is configured to generate a correspondence between the thread start upper limit and the time information based on the historical service response record.
  • the current thread startup number determining unit 62 further includes:
  • the up trigger triggering unit is configured to determine, if the number of the tasks is greater than the thread start upper limit, whether the first ratio between the number of tasks and the thread start upper limit is greater than a preset up trigger threshold;
  • the threading start upper limit up-up unit is configured to: if the first ratio is greater than a preset up trigger threshold, increase the thread start upper limit based on the first ratio, and select the number of tasks and the enhanced The smaller value in the thread start upper limit is used as the current thread start number;
  • a triggering determination unit configured to determine whether a second ratio between the thread start upper limit and the number of tasks is greater than a preset down trigger threshold if the number of tasks is less than the thread start upper limit
  • a thread start upper limit down-control unit configured to: if the second ratio is greater than a preset down trigger threshold, reduce the thread start upper limit based on the first ratio, and select the number of tasks and the reduced The smaller of the thread start caps is used as the current number of threads to start.
  • the to-be-processed task extracting unit 63 includes:
  • the to-be-processed task failure determining unit is configured to determine whether each of the to-be-processed tasks is valid according to a maximum waiting time length of each to-be-processed task and a task sending time;
  • a task failure response unit configured to: if the to-be-processed task is invalid, delete the to-be-processed task from the to-be-processed task library, and return service timeout information to the client corresponding to the to-be-processed task;
  • the to-be-processed task priority determining unit is configured to adjust the priority of the to-be-processed task based on the remaining effective duration of the to-be-processed task if the to-be-processed task is valid.
  • the adjustment terminal of the thread provided by the embodiment of the present application can also adjust the current number of threads to be started according to the to-be-processed task included in the current to-be-processed task library, before the batch concurrent response is processed.
  • the service response capability of the terminal device is matched with the current number of tasks, which improves the efficiency of the service response and the service quality of the terminal device, and provides a better user experience.
  • FIG. 7 is a schematic diagram of a terminal device according to another embodiment of the present application.
  • the terminal device 7 of this embodiment includes a processor 70, a memory 71, and computer readable instructions 72 stored in the memory 71 and operable on the processor 70, such as thread adjustment. program.
  • the processor 70 executes the computer readable instructions 72, the steps in the embodiment of the adjustment method of each thread described above are implemented, such as S101 to S104 shown in FIG. 1.
  • the processor 70 when executing the computer readable instructions 72, implements the functions of the various units in the various apparatus embodiments described above, such as the functions of the modules 61-64 shown in FIG.
  • the computer readable instructions 72 may be partitioned into one or more units, the one or more units being stored in the memory 71 and executed by the processor 70 to complete the application.
  • the one or more units may be a series of computer readable instruction instructions segments capable of performing a particular function for describing the execution of the computer readable instructions 72 in the terminal device 7.
  • the computer readable instructions 72 may be divided into a task number determining unit, a current thread start number determining unit, a to-be-processed task extracting unit, and a to-be-processed task response unit, each unit having a specific function as described above.
  • the terminal device 7 may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server.
  • the terminal device may include, but is not limited to, a processor 70 and a memory 71. It will be understood by those skilled in the art that FIG. 7 is only an example of the terminal device 7, and does not constitute a limitation of the terminal device 7, and may include more or less components than those illustrated, or combine some components or different components.
  • the terminal device may further include an input/output device, a network access device, a bus, and the like.
  • the so-called processor 70 can be a central processing unit (Central Processing Unit, CPU), can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc.
  • the general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
  • the memory 71 may be an internal storage unit of the terminal device 7, such as a hard disk or a memory of the terminal device 7.
  • the memory 71 may also be an external storage device of the terminal device 7, for example, a plug-in hard disk provided on the terminal device 7, a smart memory card (SMC), and a secure digital (SD). Card, flash card (Flash Card) and so on.
  • the memory 71 may also include both an internal storage unit of the terminal device 7 and an external storage device.
  • the memory 71 is configured to store the computer readable instructions and other programs and data required by the terminal device.
  • the memory 71 can also be used to temporarily store data that has been output or is about to be output.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)
  • Computer And Data Communications (AREA)

Abstract

本申请适用于计算机技术领域,提供了一种线程的调整方法及其终端,包括:以预设的时间间隔查询待处理任务库中包含的任务个数;根据任务个数以及预设的线程启动上限,确定当前的线程启动个数;基于各个待处理任务的优先级,从待处理任务库中提取与线程启动个数匹配的待处理任务;启动与线程启动个数对应的线程,并通过线程响应待处理任务。本申请解决了现有线程的调整方法,线程的数量是固定不变的,若在业务繁忙时期,启动的线程可能无法满足当前的业务量,从而导致待处理任务积压,从而降低了业务响应的效率,甚至导致大量的任务失效或超时,降低了服务器的服务质量以及用户的使用体验的问题。

Description

一种线程的调整方法及其终端
本申请申明享有2017年10月20日递交的申请号为201710985525.9、名称为“一种线程的调整方法及其终端”中国专利申请的优先权,该中国专利申请的整体内容以参考的方式结合在本申请中。
技术领域
本申请属于计算机技术领域,尤其涉及一种线程的调整方法及其终端。
背景技术
随着科学技术的不断发展,用户可通过网络完成的服务种类也越来越多,因而服务器的业务压力也随之增大,通常情况下,服务器采用并发处理的方式对客户发起的业务进行响应,具体地,服务器通过启动多条线程同时处理多个业务请求。然而现有线程的调整方法,线程的数量是固定不变的,若在业务繁忙时期,启动的线程可能无法满足当前的业务量,从而导致待处理任务积压,从而降低了业务响应的效率,甚至导致大量的任务失效或超时,降低了服务器的服务质量以及用户的使用体验。
技术问题
本申请实施例提供了一种线程的调整方法及其终端,以解决现有线程的调整方法,线程的数量是固定不变的,若在业务繁忙时期,启动的线程可能无法满足当前的业务量,从而导致待处理任务积压,从而降低了业务响应的效率,甚至导致大量的任务失效或超时,降低了服务器的服务质量以及用户的使用体验的问题。
技术解决方案
本申请实施例的第一方面提供了一种线程的调整方法,所述线程的调整方法包括:
以预设的时间间隔查询待处理任务库中包含的任务个数;
根据所述任务个数以及预设的线程启动上限,确定当前的线程启动个数;
基于各个待处理任务的优先级,从所述待处理任务库中提取与所述线程启动个数匹配的待处理任务;
启动与所述线程启动个数对应的线程,并通过所述线程响应所述待处理任务。
有益效果
本申请实施例在每次对待处理任务进行批量并发响应之前,将根据当前待处理任务库中包含的待处理任务,调整当前的线程启动个数,从而在每个服务响应周期到达的时刻,保持终端设备的服务响应能力与当前的任务数相匹配,提高了服务响应的效率以及终端设备的服务质量,为用户提供更好的使用体验。
附图说明
图1是本申请第一实施例提供的一种线程的调整方法的实现流程图;
图2是本申请第二实施例提供的一种线程调整方法S102具体实现流程图;
图3是本申请第三实施例提供的一种线程的调整方法的具体实现流程图;
图4是本申请第四实施例提供的一种线程调整方法S102具体实现流程图;
图5是本申请第五实施例提供的一种线程调整方法S103具体实现流程图;
图6是本申请一实施例提供的一种线程的调整终端的结构框图;
图7是本申请一实施例提供的一种终端设备的示意图。
本发明的实施方式
在本申请实施例中,流程的执行主体为安装有线程调整程序的终端设备。图1示出了本申请第一实施例提供的线程的调整方法的实现流程图,详述如下:
在S101中,以预设的时间间隔查询待处理任务库中包含的任务个数。
在本实施例中,终端设备在接收到其他用户终端发送的处理任务后,则把处理任务存储与待处理任务库中,以便当处理时机到达时,根据各个待处理任务的优先级以及接收次序,提取相应的待处理任务进行响应。
需要说明的是,该待处理任务库可为终端设备的本地存储器中,在该情况下,终端设备直接读取本地存储器,即可获取待处理任务的相关信息;待处理任务库也可以为一独立的存储服务器,专门接收并存储各个用户终端发送的处理任务。由于终端设备需要同时响应多个用户终端发送的处理任务,即需要分配一定的端口数量,来执行处理任务接收的操作,另一方面,终端设备在响应完成对应的待处理任务后,还需将处理结果返回给用户终端,此时,返回操作又需要调用一定的端口数量。因此,终端设备为了提高其服务响应的效率,可将设置一独立的存储服务器,设置相应数量的端口,接收其他用户终端发送的处理任务,终端设备只需与待处理任务库之间,建立一条数据链路用于获取需要的待处理任务即可,其他端口可用于将生成的处理结果反馈给用户终端。
在本实施例中,终端设备以预设的时间间隔查询待处理任务库中包含的任务个数,其中,该预设的时间间隔具体为终端设备的任务提取周期。终端设备具有预设的任务提取周期以及任务响应周期,终端设备在到达任务提取周期时,将从待处理任务库中提取相应数量的待处理任务,并进入任务响应周期。在任务响应周期内,终端设备通过多个线程对提取的待处理任务进行响应,且并不会从待处理任务库中提取待处理任务,在任务响应周期完毕后,若再次到达任务提取周期对应的开启时刻,则循环执行提取待处理任务的操作。而本实施例提供的S101的步骤则为终端设备进入任务提取周期时执行的操作。举例性地,例如预设的时间间隔为2分钟,则终端设备每两分钟将会查询待处理任务库中包含的任务个数,继而对该待处理任务库中的任务进行响应。当然,预设的时间间隔的时长可根据用户的实际需求进行设置,例如30秒、10分钟等,也可以根据当前时间段是否属于繁忙时间段,调整该预设的时间间隔。
在S102中,根据所述任务个数以及预设的线程启动上限,确定当前的线程启动个数。
在本实施例中,终端设备在获取了待处理任务库中包含的任务个数后,则获取预设的线程启动上限,判断任务个数与线程启动上限两者的大小,从而确定是否能够为每一个待处理任务分配一条独立的线程进行响应。若任务个数小于或等于线程启动上限,则表示可以为每一个待处理任务设置一条线程,来响应上述待处理任务,此时当前的线程启动个数即为任务个数;反之,若任务个数大于预设的线程启动上限,则表示无法为任务的数量超过可开启的线程数量,即本次任务响应周期内,无法对全部的待处理任务进行响应,因此将线程启动上限设置为当前的线程启动个数。
优选地,对于上述方案,第一类型的任务个数小于与之对应的线程启动上限,并且第二类型的任务个数大于与之对应的线程启动上限,此时,第一类型的任务个数剩余的线程,可用于响应第二类型的任务。举例性,第一类型的任务个数为15,而其对应的第一线程启动上限为30,因此,终端设备分配给该第一类型的任务的资源还剩余15个线程将处于空闲,可响应其他类型的任务。此时,终端设备确定第二类型的任务个数为25,其对应的第二线程启动上限为20,因此可将第一类型的线程中剩余的15个线程中,提取5个线程用于响应第二类型的任务,从而根据实际情况,合理调用各个类型的资源。
在S103中,基于各个待处理任务的优先级,从所述待处理任务库中提取与所述线程启动个数匹配的待处理任务。
在本实施例中,终端设备首先获取各个待处理任务的优先级,并根据在S102中确定的当前的启动线程个数N,从待处理任务库中提取优先级最高的N个待处理任务,作为本次任务响应流程执行的待处理任务。
在本实施例中,待处理任务的优先级可以由任务发起方,即由任务请求的用户进行设置,用户在生成待处理任务时,则设置待处理任务的优先级,以便终端设备在接收到待处理任务时,可基于其对应的优先级,确定对应的响应时机。具体地,用户直接设置优先级参数,如在待处理任务的优先级字节,设置相应的参数值;也可以通过限定任务反馈时间的方式,间接设置待处理任务的优先级,例如对于优先级较高的待处理任务,其对应的预定反馈时间较短;而对应优先级较低的待处理任务,其对应的预定反馈时间较长。
在本实施例中,待处理任务的优先级也可以由终端设备进行设置。具体地,终端设备根据待处理任务的任务类型,查询预设的任务类型与优先级对应关系列表,从而确定待处理任务的优先级,并生成待处理任务与优先级的对应关系列表。终端设备在执行S103的操作时,则直接读取该待处理任务与优先级的对应关系列表,即可确定各个待处理任务对应优先级。优选地,待处理任务与优先级的对应关系列表中的待处理任务,根据优先级的大小顺序,依次进行排序,若优先级相同的待处理任务,则根据任务获取时间的先后顺序进行排序,从而终端设备直接截取与线程启动个数N相应的待处理任务,无需逐一获取优先级信息后,再进行提取,提高了任务响应效率。
在S104中,启动与所述线程启动个数对应的线程,并通过所述线程响应所述待处理任务。
在本实施例中,终端设备根据S102中确定的线程启动个数,启动与其对应数量的线程,并通过已启动的线程响应在S103中提取得到的待处理任务。具体地,每一个线程响应一个待处理任务,从而实现多个待处理任务并发响应的目的。
在本实施例中,终端设备某一线程已完成一待处理任务后,则获取该任务对应的请求用户标识,并根据该请求用户标识,将任务处理结果反馈给该请求用户标识对应的终端。其中,处理结果反馈的操作可交由响应该待处理任务的线程执行,也可以在线程执行完成任务后,将处理结果以及对应终端的网络地址发送给处理结果发送模块,交由处理结果发送模块统一进行任务结果的发送操作。
可选地,在本实施例中,终端设备可汇总本次响应周期所有线程生成的处理结果后,才统一将处理结果的反馈给对应的用户终端。在该情况下,由于某些待处理任务可能涉及的数据运算量较少,因此处理该类型的待处理任务的线程可较早完成响应操作,并且处理结果是统一进行发送,即上述线程处于空闲状态。在该情况下,终端设备可安排该空闲的线程支援进度较慢的线程,即通过两个线程同时执行进度较慢的待处理任务,从而较快任务的响应速率以及资源的利用率。
以上可以看出,本申请实施例提供的一种线程的调整方法通过以预设的时间间隔查询待处理任务库中包含的任务个数,并根据该任务个数实时调整当前的线程启动个数,以使终端设备的服务响应能力与当前的待处理任务的数量相匹配;终端设备在确定了线程启动个数后,则从待处理任务库中,基于各个待处理任务的优先级,从待处理任务库中提取与线程启动个数一致的待处理任务,并进行响应,从而实现了动态调整终端设备的线程启动个数的目的。与现有的服务响应技术相比,服务器的启动线程个数保持不变,当待处理任务较少时,容易出现线程启动但空闲,浪费了服务器的资源,当待处理任务较多时,又不会增加当前的线程启动的个数,容易导致任务积压的情况,而本实施例在每次对待处理任务进行批量并发响应之前,将根据当前待处理任务库中包含的待处理任务,调整当前的线程启动个数,从而在每个服务响应周期到达的时刻,保持终端设备的服务响应能力与当前的任务数相匹配,提高了服务响应的效率以及终端设备的服务质量,为用户提供更好的使用体验。
图2示出了本申请第二实施例提供的一种线程的调整方法S102的具体实现流程图。参见图2所示,相对于图1所述实施例,本实施例提供的一种线程的调整方法S102还包括以下步骤,详述如下:
进一步地,所述根据所述任务个数以及预设的线程启动上限,确定当前的线程启动个数,包括:
在S201中,获取当前时刻的时间信息。
在本实施例中,终端设备中预设的线程启动上限是随时间的变化而变化的,即不同的时间段,均对应一个线程启动上限。例如,对于空闲时间段,终端设备平均接收的待处理任务数量一般较少,此时,终端设备无需处于满载状态进行工作,而是可以逐步对待处理任务进行响应,因此线程启动上限较小;反之,在繁忙时段,终端设备将持续接收大量的待处理任务,此时,终端设备可处于满载状态,避免待处理任务大量堆积而导致批量任务失效。
在本实施例中,终端设备在确定了当前待处理任务库中包含的任务个数后,将确定当前时刻的时间信息。其中,该时间信息可以为绝对的时间信息,如18:53,唯一确定当前的时间;该时间信息也可以为相对的时间信息,如终端设备运行的时长、满载模式的时长等用于表示终端设备运行状态的时间信息。在该情况下,终端设备限定了各个运行模式的最大运行时间,若当前时刻的时间信息,即运行模式的运行时间大于最大的运行时间,则切换该终端设备的运行模式,并相应地调整当前的线程启动上限,从而管理员通过配置响应的运行模式与线程启动上限关系列表,则可实时调整终端设备的线程启动上限。
在S202中,基于预设的线程启动上限与时间信息的对应关系,确定所述时间信息对应的所述线程启动上限。
在本实施例中,终端设备预先存储有各个不同的时间信息对应的线程启动上限,并生成线程启动上限与时间信息的对应关系。其中,该对应关系可以从终端设备的上位服务器中获取,该上位服务器通过获取多个终端设备的运行情况,确定各个设备在不同时间段对应的线程启动上限,继而生成一个适用于各个终端设备的通用线程启动上线与时间信息的对应关系。因此,各个终端设备可直接从上位服务器中获取该对应关系,并存储与本地的存储模块中。
在本实施例中,用户可根据实际的使用需求,生成该线程启动上限与时间信息的对应关系,也可以基于已有的对应关系进行调整。为了便于管理,终端设备从而系统默认设置的方式外生成该线程启动上限与时间信息的对应关系,还可以让用户进行生成或调整。
终端设备在确定了当前的时间信息后,将查询预设的线程启动上限与时间信息的对应关系,确定当前时刻对应线程启动上限,继而执行S203的相关操作。
在S203中,根据所述任务个数以及所述时间信息对应的所述线程启动上限,确定当前的线程启动个数。
在本实施例中,终端设备在确定了当前时间信息对应的线程启动上限后,将待执行任务库中包含的任务个数与线程启动上限进行比较,选取上述两者中较小的数值作为当前的线程启动个数。
在本申请实施例中,线程启动上限的数值并非固定不变的,而是可以根据不同的时间信息进行调整,从而有效地利用终端设备的线程资源,避免不必要的资源浪费,提高了资源的利用效率,以及终端设备的灵活性。特别地,终端设备在繁忙时段可能长时间处于满载或超载的模式下进行工作,因此为了对终端设备提供一定的缓冲期,在非繁忙时间段,终端设备可以处于负载较少的状态下工作。例如,在空闲时间的某一任务提取周期,终端设备检测到待处理任务库中包含100个待处理任务,而该时刻对应的线程启动上限为50,并且下一提取周期数据库并未接受到新的待处理任务,因此,终端设备可通过两个任务响应周期,来执行上述100个待处理任务,虽然终端设备在繁忙时段线程启动上限可以达到100,但该时间段为空闲时间段,即该时间段内,待处理任务的任务量的数学期望值较少,并不会长时间持续获取到大量的待处理任务,因此可保持较低的线程启动上限,即便遇到突发增多的待处理任务,仍可逐步进行响应。
图3示出了本申请第三实施例提供的一种线程的调整方法的具体实现流程图。参见图3所示,相对于图2所述实施例,本实施例提供的一种线程的调整方法还包括以下步骤,详述如下:
进一步地,在S101之前,所述线程的调整方法还包括:
在S301中,获取历史服务响应记录;其中,所述历史服务响应记录包括各个时间段的待处理任务信息以及硬件资源运行信息。
在本实施例中,终端设备在每次响应待执行任务后,将生成与之对应的待处理任务响应记录,其中,该待处理任务响应记录具体包括:响应开启时间、响应完成时间、执行时长、硬件资源占用情况、响应等待时长等信息。终端设备在获取了各个待处理任务对应的任务响应记录后,则可以确定在不同时间段包含的待处理任务的数量,以及各个时间段的终端设备整体的硬件资源的消耗情况,继而生成该历史服务响应记录。
在本实施例中,硬件资源运行信息包括但不限于以下一种或至少两种的组合:CPU的运行情况、内存的占用情况、终端设备的运行温度、数据读写速率等。由于硬件资源运行信息除了与当前响应的任务数量等内部因素相关外,还与如机房温度、电压、功率等外部因素有关,因此,终端设备不仅获取各个时间段的待处理任务信息,还获取硬件资源运行信息,并生成对应的历史服务响应记录,以便确定线程启动上限时,既考虑内部因素还考虑外部环境对终端设备的影响因素。
在S302中,基于所述历史服务响应记录,生成所述线程启动上限与时间信息的对应关系。
在本实施例中,终端设备根据历史服务响应记录中不同时间段或者任务提取周期对应的待执行任务数,确定各个时间段内平均的待执行任务数,从而得到待执行任务数随时间推移的变化趋势。终端设备基于该待执行任务数变化趋势,得到确定线程启动上限与时间信息的对应关系的第一因子。
在本实施例中,终端设备根据历史服务响应记录中不同时间段或者任务提取周期对应的硬件运行信息,确定各个时间段内终端设备的运行状态,该运行状态包括负载情况、运行效率情况以及异常发生率,从而得到运行状态随时间推移的变化趋势。终端设备基于该运行状态变化趋势,得到确定线程启动上限与时间信息的对应关系的第二因子。
在本实施例中,终端设备根据第一因子与第二因子生成线程启动上限与时间信息的对应关系。可选地,第一因子具体为平均执行任务数,第二因子为硬件运行效率,因此任一时间段对应的线程启动上限为:平均执行任务数×硬件运行效率。具体地,终端设备的运行状态越良好,即负载越少、运行效率越高和/或异常发生率越低,其对应的比例系数越大,则终端设备在该时间段可响应更多的待执行任务,因此线程启动上限越高;反之,终端设备的运作状态越差,其对应的比例系数越小。其中,该比例系数为大于0的正数。
在本申请实施例中,终端设备还可以根据历史服务响应记录,对线程启动上限与时间信息的对应关系列表进行调整,基于上述目的,终端设备首先获取本机的历史服务响应记录,继而通过历史服务响应记录进行学习,提高了对应关系列表的准确性。
图4示出了本申请第四实施例提供的一种线程的调整方法S102的具体实现流程图。参见图4所示,相对于图1至图3所述实施例,本实施例提供的一种线程的调整方法中所述根据所述任务个数以及预设的线程启动上限,确定当前的线程启动个数,还包含S401~S405,详述如下:
在S401中,判断所述任务个数是否大于所述线程启动上限。
在S402中,若所述任务个数大于所述线程启动上限,则判断所述任务个数与所述线程启动上限之间的第一比值是否大于预设的上调触发阈值。
在本实施例中,终端设备的线程启动上限可根据当前实际的任务个数进行调整,以使终端设备的任务处理能力与当前任务量相匹配。由于预设的线程启动上限是根据管理员或者系统历史记录进行预判得到的,而实际过程中常常会出现各种各样的突发情况,因此,终端设备设置有调整线程启动上限的流程,来灵活调整该线程启动上限。
在本实施例中,终端设备检测到当前待处理任务库中包含的任务个数大于线程启动上限,即表示终端设备无法在本次任务响应周期内对所有待处理任务完成响应,实际的任务量大于当前终端设备的任务处理能力。此时,终端设备则计算任务个数与线程启动上限之间的第一比值,并判断该第一比值是否大于预设的上调触发阈值。
在本实施例中,上调触发阈值用于界定当前的任务量是否属于异常增多的情况,并且当前的任务处理能力是否足以应对当前的任务量,而不会导致大批量的任务积压并失效。因此,若第一比值小于或等于上调触发阈值,则表示终端设备当前的任务处理能力与当前的任务量是匹配的,无需调整线程启动上限,维持当前的线程启动上限不变;反之,若第一比值大于上调触发阈值,则表示当前的任务量突发增大,且终端设备当前的处理能力无法确保待处理任务均能正常响应,因此将调整线程启动上限,执行S403的相关操作。
在S403中,若所述第一比值大于预设的上调触发阈值,则基于所述第一比值,提高所述线程启动上限,并选取所述任务个数与提高后的所述线程启动上限中的较小值作为所述当前的线程启动个数。
在本实施例中,终端设备检测到第一比值大于预设的上调触发阈值后,则对终端设备的线程启动上限进行对应的调整。终端设备预设有第一比值与调整幅度的对应关系列表,根据当前计算得到的第一比值,查询该第一比值对应的调整系数,继而通过该调整系数增大该线程启动上限。
在本实施例中,终端设备在确定了线程启动上限后,则从任务个数以及调整后的线程启动上限中,选取较小的一个数值作为当前的线程启动个数。由于调整系数可能大于第一比值,因此实际计算得到的线程启动上限可能大于任务个数。
在S404中,若所述任务个数小于所述线程启动上限,则判断所述线程启动上限与所述任务个数之间的第二比值是否大于预设的下调触发阈值。
在本实施例中,终端设备还会根据当前的任务个数适当调整当前的线程启动上限,由于终端设备在设置时间信息与线程启动上限的对应关系时,可能会根据历史记录中各个时段的当前启动上限来作为设置的依据,因而为了使得该对应关系更加准确,并且合理地分配终端设备的线程资源,因此终端设备还可以根据当前的任务数量适当降低线程启动上限,以便预留的线程可执行其他操作。
在本实施例中,终端设备在确定任务个数小于线程启动上限时,则计算线程启动上限与任务个数之间的第二比值,并判断第二比值是否大于预设的下调触发阈值。若第二比值大于下调触发阈值,则表示终端设备的任务处理能力远远大于当前所需的任务量,因此将降低线程启动上限,并执行S405的操作;反之,若第二比值小于或等于下调触发阈值,则保持当前的线程启动上限。
在S405中,若所述第二比值大于预设的下调触发阈值,则基于所述第一比值,降低所述线程启动上限,并选取所述任务个数与降低后的所述线程启动上限中的较小值作为所述当前的线程启动个数。
在本实施例中,终端设备检测到第二比值大于预设的下调触发阈值后,则对终端设备的线程启动上限进行对应的调整。终端设备预设有第二比值与调整幅度的对应关系列表,根据当前计算得到的第二比值,查询该第二比值对应的调整系数,继而通过该调整系数减少该线程启动上限。
在本申请实施例中,通过获取任务个数与线程启动上限之间的比值,确定是否需要对线程启动上限进行调整,从而灵活调整终端设备的任务处理能力,提高了线程启动上限的准确性。
图5示出了本申请第五实施例提供的一种线程的调整方法S103的具体实现流程图。参见图5所示,相对于图1所述实施例,本实施例提供的一种线程的调整方法S103还包括以下步骤,详述如下:
在S501中,根据各个待处理任务的最大等待时长以及任务发送时刻,分别判定各个所述待处理任务是否有效。
具体地,终端设备首先获取当前的时间信息以及该任务的发送时刻,计算相对于当前时刻的等待时长,若该等待时长大于最大等待时长,则表示该任务已经失效,识别为无效的待处理任务;反之,若该等待时长小于或等于最大等待时长,则表示该任务有效,识别为有效的待处理任务。
在S502中,若所述待处理任务无效,则将所述待处理任务从所述待处理任务库中删除,并向所述待处理任务对应的客户返回服务超时信息。
在本实施例中,终端设备若检测到待处理任务为无效的任务,则将该待处理任务宠待处理任务库中进行删除,从而确保待处理任务库中包含的待处理任务均为有效的待处理任务。进一步地,为了告知服务请求的用户其发送的待处理任务失效,终端设备向待处理任务对应的客户推送服务超时信息,以便该客户重新发起任务请求。
在S503中,若所述待处理任务有效,则基于所述待处理任务的剩余有效时长,调整所述待处理任务的优先级。
在本实施例中,终端设备若判定该待处理任务为有效任务,则提取该任务中包含的剩余有效时间,从而根据该剩余有效时间调整该待处理任务的优先级。终端设备避免待处理任务失效,对于较为紧急的待处理任务首先进行响应,因此终端设备将根据各个待处理任务的有效剩余时间,提高剩余时间较短的待处理任务的优先级,而对于有效剩余时间较长的待处理任务则维持其优先级不变。
在本申请实施例中,终端设备在提取操作前首先对待处理任务进行筛选,从而提高了服务响应的有效率,从而提高了服务响应的效率。
图6示出了本申请一实施例提供的一种线程的调整终端的结构框图,该线程的调整终端包括的各单元用于执行图1对应的实施例中的各步骤。参见图6,所述线程的调整终端包括:
任务个数确定单元61,用于以预设的时间间隔查询待处理任务库中包含的任务个数;
当前线程启动个数确定单元62,用于根据所述任务个数以及预设的线程启动上限,确定当前的线程启动个数;
待处理任务提取单元63,用于基于各个待处理任务的优先级,从所述待处理任务库中提取与所述线程启动个数匹配的待处理任务;
待处理任务响应单元64,用于启动与所述线程启动个数对应的线程,并通过所述线程响应所述待处理任务。
可选地,所述当前线程启动个数确定单元62包括:
时间信息确定单元,用于获取当前时刻的时间信息;
线程启动上限确定单元,用于基于预设的线程启动上限与时间信息的对应关系,确定所述时间信息对应的所述线程启动上限;
当前线程启动个数设置单元,用于根据所述任务个数以及所述时间信息对应的所述线程启动上限,确定当前的线程启动个数。
可选地,所述线程的调整装置还包括:
历史服务响应记录获取单元,用于获取历史服务响应记录;其中,所述历史服务响应记录包括各个时间段的待处理任务信息以及硬件资源运行信息;
线程启动上限对应关系生成单元,用于基于所述历史服务响应记录,生成所述线程启动上限与时间信息的对应关系。
可选地,所述当前线程启动个数确定单元62还包括:
上调触发判定单元,用于若所述任务个数大于所述线程启动上限,则判断所述任务个数与所述线程启动上限之间的第一比值是否大于预设的上调触发阈值;
线程启动上限上调单元,用于若所述第一比值大于预设的上调触发阈值,则基于所述第一比值,提高所述线程启动上限,并选取所述任务个数与提高后的所述线程启动上限中的较小值作为所述当前的线程启动个数;
下调触发判定单元,用于若所述任务个数小于所述线程启动上限,则判断所述线程启动上限与所述任务个数之间的第二比值是否大于预设的下调触发阈值;
线程启动上限下调单元,用于若所述第二比值大于预设的下调触发阈值,则基于所述第一比值,降低所述线程启动上限,并选取所述任务个数与降低后的所述线程启动上限中的较小值作为所述当前的线程启动个数。
可选地,所述待处理任务提取单元63包括:
待处理任务失效判定单元,用于根据各个待处理任务的最大等待时长以及任务发送时刻,分别判定各个所述待处理任务是否有效;
待处理任务失效响应单元,用于若所述待处理任务无效,则将所述待处理任务从所述待处理任务库中删除,并向所述待处理任务对应的客户返回服务超时信息;
待处理任务优先级确定单元,用于若所述待处理任务有效,则基于所述待处理任务的剩余有效时长,调整所述待处理任务的优先级。
因此,本申请实施例提供的线程的调整终端同样可以在每次对待处理任务进行批量并发响应之前,将根据当前待处理任务库中包含的待处理任务,调整当前的线程启动个数,从而在每个服务响应周期到达的时刻,保持终端设备的服务响应能力与当前的任务数相匹配,提高了服务响应的效率以及终端设备的服务质量,为用户提供更好的使用体验。
图7是本申请另一实施例提供的一种终端设备的示意图。如图7所示,该实施例的终端设备7包括:处理器70、存储器71以及存储在所述存储器71中并可在所述处理器70上运行的计算机可读指令72,例如线程的调整程序。所述处理器70执行所述计算机可读指令72时实现上述各个线程的调整方法实施例中的步骤,例如图1所示的S101至S104。或者,所述处理器70执行所述计算机可读指令72时实现上述各装置实施例中各单元的功能,例如图6所示模块61至64功能。
示例性的,所述计算机可读指令72可以被分割成一个或多个单元,所述一个或者多个单元被存储在所述存储器71中,并由所述处理器70执行,以完成本申请。所述一个或多个单元可以是能够完成特定功能的一系列计算机可读指令指令段,该指令段用于描述所述计算机可读指令72在所述终端设备7中的执行过程。例如,所述计算机可读指令72可以被分割成任务个数确定单元、当前线程启动个数确定单元、待处理任务提取单元以及待处理任务响应单元,各单元具体功能如上所述。
所述终端设备7可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。所述终端设备可包括,但不仅限于,处理器70、存储器71。本领域技术人员可以理解,图7仅仅是终端设备7的示例,并不构成对终端设备7的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述终端设备还可以包括输入输出设备、网络接入设备、总线等。
所称处理器70可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器 (Digital Signal Processor,DSP)、专用集成电路 (Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA) 或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
所述存储器71可以是所述终端设备7的内部存储单元,例如终端设备7的硬盘或内存。所述存储器71也可以是所述终端设备7的外部存储设备,例如所述终端设备7上配备的插接式硬盘,智能存储卡(Smart Media Card, SMC),安全数字(Secure Digital, SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器71还可以既包括所述终端设备7的内部存储单元也包括外部存储设备。所述存储器71用于存储所述计算机可读指令以及所述终端设备所需的其他程序和数据。所述存储器71还可以用于暂时地存储已经输出或者将要输出的数据。
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。

Claims (20)

  1. 一种线程的调整方法,其特征在于,包括:
    以预设的时间间隔查询待处理任务库中包含的任务个数;
    根据所述任务个数以及预设的线程启动上限,确定当前的线程启动个数;
    基于各个待处理任务的优先级,从所述待处理任务库中提取与所述线程启动个数匹配的待处理任务;
    启动与所述线程启动个数对应的线程,并通过所述线程响应所述待处理任务。
  2. 根据权利要求1所述的调整方法,其特征在于,所述根据所述任务个数以及预设的线程启动上限,确定当前的线程启动个数,包括:
    获取当前时刻的时间信息;
    基于预设的线程启动上限与时间信息的对应关系,确定所述时间信息对应的所述线程启动上限;
    根据所述任务个数以及所述时间信息对应的所述线程启动上限,确定当前的线程启动个数。
  3. 根据权利要求2所述的调整方法,其特征在于,所述调整方法还包括:
    获取历史服务响应记录;其中,所述历史服务响应记录包括各个时间段的待处理任务信息以及硬件资源运行信息;
    基于所述历史服务响应记录,生成所述线程启动上限与时间信息的对应关系。
  4. 根据权利要求1-3任一项所述的调整方法,其特征在于,所述根据所述任务个数以及预设的线程启动上限,确定当前的线程启动个数,还包括:
    若所述任务个数大于所述线程启动上限,则判断所述任务个数与所述线程启动上限之间的第一比值是否大于预设的上调触发阈值;
    若所述第一比值大于预设的上调触发阈值,则基于所述第一比值,提高所述线程启动上限,并选取所述任务个数与提高后的所述线程启动上限中的较小值作为所述当前的线程启动个数;
    若所述任务个数小于所述线程启动上限,则判断所述线程启动上限与所述任务个数之间的第二比值是否大于预设的下调触发阈值;
    若所述第二比值大于预设的下调触发阈值,则基于所述第一比值,降低所述线程启动上限,并选取所述任务个数与降低后的所述线程启动上限中的较小值作为所述当前的线程启动个数。
  5. 根据权利要求1所述的调整方法,其特征在于,所述基于各个待处理任务的优先级,从所述待处理任务库中提取与所述线程启动个数匹配的待处理任务,包括:
    根据各个待处理任务的最大等待时长以及任务发送时刻,分别判定各个所述待处理任务是否有效;
    若所述待处理任务无效,则将所述待处理任务从所述待处理任务库中删除,并向所述待处理任务对应的客户返回服务超时信息;
    若所述待处理任务有效,则基于所述待处理任务的剩余有效时长,调整所述待处理任务的优先级。
  6. 一种线程的调整终端,其特征在于,包括:
    任务个数确定单元,用于以预设的时间间隔查询待处理任务库中包含的任务个数;
    当前线程启动个数确定单元,用于根据所述任务个数以及预设的线程启动上限,确定当前的线程启动个数;
    待处理任务提取单元,用于基于各个待处理任务的优先级,从所述待处理任务库中提取与所述线程启动个数匹配的待处理任务;
    待处理任务响应单元,用于启动与所述线程启动个数对应的线程,并通过所述线程响应所述待处理任务。
  7. 根据权利要求6所述的调整终端,其特征在于,所述当前线程启动个数确定单元包括:
    时间信息确定单元,用于获取当前时刻的时间信息;
    线程启动上限确定单元,用于基于预设的线程启动上限与时间信息的对应关系,确定所述时间信息对应的所述线程启动上限;
    当前线程启动个数设置单元,用于根据所述任务个数以及所述时间信息对应的所述线程启动上限,确定当前的线程启动个数。
  8. 根据权利要求7所述的调整终端,其特征在于,还包括:
    历史服务响应记录获取单元,用于获取历史服务响应记录;其中,所述历史服务响应记录包括各个时间段的待处理任务信息以及硬件资源运行信息;
    线程启动上限对应关系生成单元,用于基于所述历史服务响应记录,生成所述线程启动上限与时间信息的对应关系。
  9. 根据权利要求6-8任一项所述的调整终端,其特征在于,所述当前线程启动个数确定单元还包括:
    上调触发判定单元,用于若所述任务个数大于所述线程启动上限,则判断所述任务个数与所述线程启动上限之间的第一比值是否大于预设的上调触发阈值;
    线程启动上限上调单元,用于若所述第一比值大于预设的上调触发阈值,则基于所述第一比值,提高所述线程启动上限,并选取所述任务个数与提高后的所述线程启动上限中的较小值作为所述当前的线程启动个数;
    下调触发判定单元,用于若所述任务个数小于所述线程启动上限,则判断所述线程启动上限与所述任务个数之间的第二比值是否大于预设的下调触发阈值;
    线程启动上限下调单元,用于若所述第二比值大于预设的下调触发阈值,则基于所述第一比值,降低所述线程启动上限,并选取所述任务个数与降低后的所述线程启动上限中的较小值作为所述当前的线程启动个数。
  10. 根据权利要求6所述的调整终端,其特征在于,所述待处理任务提取单元63包括:
    待处理任务失效判定单元,用于根据各个待处理任务的最大等待时长以及任务发送时刻,分别判定各个所述待处理任务是否有效;
    待处理任务失效响应单元,用于若所述待处理任务无效,则将所述待处理任务从所述待处理任务库中删除,并向所述待处理任务对应的客户返回服务超时信息;
    待处理任务优先级确定单元,用于若所述待处理任务有效,则基于所述待处理任务的剩余有效时长,调整所述待处理任务的优先级。
  11. 一种终端设备,其特征在于,所述终端设备包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:
    以预设的时间间隔查询待处理任务库中包含的任务个数;
    根据所述任务个数以及预设的线程启动上限,确定当前的线程启动个数;
    基于各个待处理任务的优先级,从所述待处理任务库中提取与所述线程启动个数匹配的待处理任务;
    启动与所述线程启动个数对应的线程,并通过所述线程响应所述待处理任务。
  12. 根据权利要求11所述的终端设备,其特征在于,其特征在于,所述根据所述任务个数以及预设的线程启动上限,确定当前的线程启动个数,包括:
    获取当前时刻的时间信息;
    基于预设的线程启动上限与时间信息的对应关系,确定所述时间信息对应的所述线程启动上限;
    根据所述任务个数以及所述时间信息对应的所述线程启动上限,确定当前的线程启动个数。
  13. 根据权利要求12所述的终端设备,其特征在于,所述处理器执行所述计算机可读指令时还实现如下步骤:
    获取历史服务响应记录;其中,所述历史服务响应记录包括各个时间段的待处理任务信息以及硬件资源运行信息;
    基于所述历史服务响应记录,生成所述线程启动上限与时间信息的对应关系。
  14. 根据权利要求11-13任一项所述的终端设备,其特征在于,所述根据所述任务个数以及预设的线程启动上限,确定当前的线程启动个数,包括:
    若所述任务个数大于所述线程启动上限,则判断所述任务个数与所述线程启动上限之间的第一比值是否大于预设的上调触发阈值;
    若所述第一比值大于预设的上调触发阈值,则基于所述第一比值,提高所述线程启动上限,并选取所述任务个数与提高后的所述线程启动上限中的较小值作为所述当前的线程启动个数;
    若所述任务个数小于所述线程启动上限,则判断所述线程启动上限与所述任务个数之间的第二比值是否大于预设的下调触发阈值;
    若所述第二比值大于预设的下调触发阈值,则基于所述第一比值,降低所述线程启动上限,并选取所述任务个数与降低后的所述线程启动上限中的较小值作为所述当前的线程启动个数。
  15. 根据权利要求11所述的终端设备,其特征在于,所述基于各个待处理任务的优先级,从所述待处理任务库中提取与所述线程启动个数匹配的待处理任务,包括:
    根据各个待处理任务的最大等待时长以及任务发送时刻,分别判定各个所述待处理任务是否有效;
    若所述待处理任务无效,则将所述待处理任务从所述待处理任务库中删除,并向所述待处理任务对应的客户返回服务超时信息;
    若所述待处理任务有效,则基于所述待处理任务的剩余有效时长,调整所述待处理任务的优先级。
  16. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可读指令,其特征在于,所述计算机可读指令被处理器执行时实现如下步骤:
    以预设的时间间隔查询待处理任务库中包含的任务个数;
    根据所述任务个数以及预设的线程启动上限,确定当前的线程启动个数;
    基于各个待处理任务的优先级,从所述待处理任务库中提取与所述线程启动个数匹配的待处理任务;
    启动与所述线程启动个数对应的线程,并通过所述线程响应所述待处理任务。
  17. 根据权利要求16所述的计算机可读存储介质,其特征在于,所述根据所述任务个数以及预设的线程启动上限,确定当前的线程启动个数,包括:
    获取当前时刻的时间信息;
    基于预设的线程启动上限与时间信息的对应关系,确定所述时间信息对应的所述线程启动上限;
    根据所述任务个数以及所述时间信息对应的所述线程启动上限,确定当前的线程启动个数。
  18. 根据权利要求17所述的计算机可读存储介质,其特征在于,所述处理器执行所述计算机可读指令时还实现如下步骤:
    获取历史服务响应记录;其中,所述历史服务响应记录包括各个时间段的待处理任务信息以及硬件资源运行信息;
    基于所述历史服务响应记录,生成所述线程启动上限与时间信息的对应关系。
  19. 根据权利要求16-18任一项所述的计算机可读存储介质,其特征在于,所述根据所述任务个数以及预设的线程启动上限,确定当前的线程启动个数,还包括:
    若所述任务个数大于所述线程启动上限,则判断所述任务个数与所述线程启动上限之间的第一比值是否大于预设的上调触发阈值;
    若所述第一比值大于预设的上调触发阈值,则基于所述第一比值,提高所述线程启动上限,并选取所述任务个数与提高后的所述线程启动上限中的较小值作为所述当前的线程启动个数;
    若所述任务个数小于所述线程启动上限,则判断所述线程启动上限与所述任务个数之间的第二比值是否大于预设的下调触发阈值;
    若所述第二比值大于预设的下调触发阈值,则基于所述第一比值,降低所述线程启动上限,并选取所述任务个数与降低后的所述线程启动上限中的较小值作为所述当前的线程启动个数。
  20. 根据权利要求16所述的计算机可读存储介质,其特征在于,所述基于各个待处理任务的优先级,从所述待处理任务库中提取与所述线程启动个数匹配的待处理任务,包括:
    根据各个待处理任务的最大等待时长以及任务发送时刻,分别判定各个所述待处理任务是否有效;
    若所述待处理任务无效,则将所述待处理任务从所述待处理任务库中删除,并向所述待处理任务对应的客户返回服务超时信息;
    若所述待处理任务有效,则基于所述待处理任务的剩余有效时长,调整所述待处理任务的优先级。
PCT/CN2018/077682 2017-10-20 2018-02-28 一种线程的调整方法及其终端 WO2019075980A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710985525.9 2017-10-20
CN201710985525.9A CN107832126B (zh) 2017-10-20 2017-10-20 一种线程的调整方法及其终端

Publications (1)

Publication Number Publication Date
WO2019075980A1 true WO2019075980A1 (zh) 2019-04-25

Family

ID=61648667

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/077682 WO2019075980A1 (zh) 2017-10-20 2018-02-28 一种线程的调整方法及其终端

Country Status (2)

Country Link
CN (1) CN107832126B (zh)
WO (1) WO2019075980A1 (zh)

Families Citing this family (27)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110413419A (zh) * 2018-04-28 2019-11-05 北京京东尚科信息技术有限公司 一种规则执行的方法和装置
CN108710538B (zh) * 2018-05-14 2023-06-02 中国平安人寿保险股份有限公司 一种线程配置方法、计算机可读存储介质及终端设备
CN109086132A (zh) * 2018-06-26 2018-12-25 深圳市买买提信息科技有限公司 一种人脸识别任务均衡调用方法、装置及终端设备
CN109254835A (zh) * 2018-06-27 2019-01-22 阿里巴巴集团控股有限公司 批处理任务的处理方法、装置、服务器及可读存储介质
CN109063140A (zh) * 2018-08-03 2018-12-21 福州麦辽自动化设备有限公司 一种数据查询方法、中转服务器及计算机可读存储介质
CN109189336A (zh) * 2018-08-17 2019-01-11 郑州云海信息技术有限公司 一种存储系统线程调整方法、系统及电子设备和存储介质
CN109271252B (zh) * 2018-08-29 2021-07-16 华为技术有限公司 一种调整线程数的方法及装置
CN109544015B (zh) * 2018-11-26 2023-07-25 平安科技(深圳)有限公司 一种基于数据处理的任务分配方法及相关设备
CN111262894B (zh) * 2018-11-30 2023-06-20 北京嘀嘀无限科技发展有限公司 一种控制在线咨询用户量的方法及装置
CN109815007A (zh) * 2018-12-15 2019-05-28 平安科技(深圳)有限公司 基于云监控的线程控制方法、装置、电子设备及存储介质
CN109710402A (zh) * 2018-12-17 2019-05-03 平安普惠企业管理有限公司 处理资源获取请求的方法、装置、计算机设备和存储介质
CN111324447B (zh) * 2019-06-26 2023-03-28 杭州海康威视系统技术有限公司 线程的调整方法、装置、应用服务器和存储介质
CN110287018B (zh) * 2019-07-04 2021-08-13 中国工商银行股份有限公司 批量任务编排方法及装置
CN111415725B (zh) * 2020-03-05 2023-09-26 北京深睿博联科技有限责任公司 一种应用于ai医疗影像诊断算法调度方法、系统、终端及存储介质
CN111552567B (zh) * 2020-04-27 2023-07-07 北京奇艺世纪科技有限公司 一种线程管理方法、装置、电子设备及存储介质
CN112991094A (zh) * 2020-06-16 2021-06-18 洪江川 基于人工智能和大数据的信息分析方法及系统
CN112000446A (zh) * 2020-07-13 2020-11-27 深圳市优必选科技股份有限公司 一种数据传输的方法及机器人
CN111782378B (zh) * 2020-07-29 2024-04-16 平安银行股份有限公司 自适应性的处理性能调整方法、服务器及可读存储介质
CN112069367A (zh) * 2020-09-07 2020-12-11 上海金仕达软件科技有限公司 一种任务调度方法及系统
CN112153060A (zh) * 2020-09-27 2020-12-29 苏州浪潮智能科技有限公司 Smb协议服务器的通信控制方法、系统及相关组件
CN112882818A (zh) * 2021-03-30 2021-06-01 中信银行股份有限公司 任务动态调整方法、装置以及设备
CN113222456B (zh) * 2021-05-29 2023-05-05 长沙市到家悠享家政服务有限公司 任务处理方法、系统、电子设备及计算机可读介质
CN113568737B (zh) * 2021-06-30 2024-03-26 北京达佳互联信息技术有限公司 硬件资源分配方法及装置
CN113885956B (zh) * 2021-09-29 2023-08-29 北京百度网讯科技有限公司 服务部署方法及装置、电子设备和存储介质
CN113886185B (zh) * 2021-10-16 2023-07-11 深圳市瑞云科技有限公司 一种自动判断平台繁忙状态的方法
CN116755869B (zh) * 2023-08-23 2023-10-27 北京浩然五洲软件技术有限公司 一种金融业务进件处理方法、系统和介质
CN117453363A (zh) * 2023-11-06 2024-01-26 北京明朝万达科技股份有限公司 一种附件处理方法及装置、电子设备、存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102779062A (zh) * 2011-05-09 2012-11-14 阿里巴巴集团控股有限公司 一种访问系统资源的线程数量的控制方法及装置
CN104572277A (zh) * 2014-12-17 2015-04-29 大唐移动通信设备有限公司 一种线程流控方法和装置
CN106952163A (zh) * 2016-01-07 2017-07-14 平安科技(深圳)有限公司 保险数据处理方法及系统

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8136113B2 (en) * 2006-12-20 2012-03-13 International Business Machines Corporation Method and apparatus for adjusting sleep time of fixed high-priority threads

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102779062A (zh) * 2011-05-09 2012-11-14 阿里巴巴集团控股有限公司 一种访问系统资源的线程数量的控制方法及装置
CN104572277A (zh) * 2014-12-17 2015-04-29 大唐移动通信设备有限公司 一种线程流控方法和装置
CN106952163A (zh) * 2016-01-07 2017-07-14 平安科技(深圳)有限公司 保险数据处理方法及系统

Also Published As

Publication number Publication date
CN107832126B (zh) 2020-06-12
CN107832126A (zh) 2018-03-23

Similar Documents

Publication Publication Date Title
WO2019075980A1 (zh) 一种线程的调整方法及其终端
US10169060B1 (en) Optimization of packet processing by delaying a processor from entering an idle state
WO2020228177A1 (zh) 批量数据处理方法、装置、计算机设备及存储介质
US7137115B2 (en) Method for controlling multithreading
US10042583B2 (en) Device management method, device, and device management controller
US20170048163A1 (en) Method and system for resource scheduling
US20120297216A1 (en) Dynamically selecting active polling or timed waits
US11899939B2 (en) Read/write request processing method and apparatus, electronic device, and storage medium
CN112650575B (zh) 资源调度方法、装置和云端服务系统
WO2016000470A1 (zh) 一种内存控制方法和装置
WO2021164163A1 (zh) 一种请求处理方法、装置、设备及存储介质
WO2019062019A1 (zh) 一种数据列表的导出方法及其终端
WO2023143274A1 (zh) 一种对流表中的流表项处理的方法及装置
CN111586140A (zh) 一种数据交互的方法及服务器
CN107132903B (zh) 一种节能管理实现方法、装置及网络设备
WO2020098266A1 (zh) 一种异常响应的方法及设备
CN108388409B (zh) 打印请求处理方法、装置、计算机设备和存储介质
CN103823712A (zh) 一种多cpu虚拟机系统的数据流处理方法和装置
JP6189545B2 (ja) 電力消費の低減のためのネットワークアプリケーション並行スケジューリング
WO2024021485A1 (zh) 处理器性能调整方法、装置、电子设备及存储介质
EP4357916A1 (en) Job processing method and apparatus, computer device, and storage medium
WO2022111466A1 (zh) 任务调度方法、控制方法、电子设备、计算机可读介质
WO2022095862A1 (zh) 调整线程优先级的方法、终端及计算机可读存储介质
US20230393782A1 (en) Io request pipeline processing device, method and system, and storage medium
WO2022133827A1 (zh) 一种任务处理请求的处理方法、装置以及区块链节点设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18869411

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 24.09.2020)

122 Ep: pct application non-entry in european phase

Ref document number: 18869411

Country of ref document: EP

Kind code of ref document: A1