A pathological specimen auxiliary diagnosis system based on multi-thread control and task scheduling
The pathology specimen auxiliary diagnosis system with multi-threaded control and task scheduling solves the problem of low efficiency of traditional pathology diagnosis, realizes efficient auxiliary diagnosis of pathology specimens, and ensures the stability of the system and the efficiency of task processing.
Patent Information
- Application Number
- CN202510034247.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-09
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2045-01-09
AI Technical Summary
Traditional pathology diagnosis methods rely on pathologists to manually analyze full-slice images, resulting in low diagnostic efficiency. It is difficult to meet the increasing demand for pathology samples and cases, and there is also the problem of difficulty in improving diagnostic efficiency.
A pathology specimen auxiliary diagnosis system based on multi-threaded control and task scheduling is adopted. The distributed lock management module monitors the task resource status, regularly scans the task queue, and realizes multi-threaded scheduling and control of periodic tasks and delayed tasks to ensure system stability and efficiency.
It improves the efficiency and effectiveness of auxiliary diagnosis of pathological specimens, avoids resource access conflicts, and ensures the stability of system operation and the efficiency of task processing.
Smart Images

Figure CN119883571B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a pathological specimen auxiliary diagnosis system based on multi-thread control and task scheduling. Background Art
[0002] At present, in the field of pathology, with the development of medical technology and the increasing number of pathological samples, pathological diagnosis has become more arduous and complicated. Therefore, auxiliary diagnosis systems have gradually played an important role in digital pathology.
[0003] However, traditional pathology diagnosis often relies on pathologists to manually analyze whole slide images (WSI). This method is time-consuming and labor-intensive. With the increasing number of cases and the shortage of pathologists, diagnostic efficiency is difficult to meet clinical needs. Moreover, a single diagnostic process usually requires analyzing multiple images and massive amounts of data. Traditional pathology diagnosis methods are currently unable to address these issues, significantly reducing the efficiency of pathology diagnosis.
[0004] Therefore, in order to overcome the above-mentioned defects, the present invention provides a pathological specimen auxiliary diagnosis system based on multi-thread control and task scheduling. Summary of the Invention
[0005] The present invention provides a pathology specimen auxiliary diagnosis system based on multi-threaded control and task scheduling, which is used to monitor the task initiation request of the pathology specimen auxiliary diagnosis task, and use distributed locks to judge the running status of the resources required for the task according to the monitoring results, so as to facilitate the determination of whether the current task can be effectively executed according to the running status, and avoid the conflict of different tasks accessing the same resource. Secondly, when the required resources are not locked, the task execution is started and the task queue is scanned regularly, so as to facilitate multi-threaded task scheduling and control of periodic tasks and delayed tasks in the task queue, realize efficient parallel processing of different tasks, and ensure the operating stability of the system. Finally, the lock is released after the execution is completed, so as to facilitate the processing of the pending tasks in the task queue, and ensure the efficiency and effect of the pathology specimen auxiliary diagnosis.
[0006] The present invention provides a pathology specimen auxiliary diagnosis system based on multi-thread control and task scheduling, comprising:
[0007] The distributed lock management module is used to obtain tasks for auxiliary diagnosis of pathological specimens. Based on the task initiation request, it uses distributed locks to determine the running status of the resources required for the task. If the required resources are not locked, it allocates locks and starts the task execution.
[0008] The scheduled task scheduling module is used to periodically scan the task queue based on the startup results, and assign periodic tasks and delayed tasks in the task queue to the thread pool based on the scanning results;
[0009] A multi-threaded task execution module is used to perform multi-threaded task scheduling and control on periodic tasks and delayed tasks according to a priority mechanism based on the allocation result, and perform data processing on the periodic tasks and delayed tasks based on the multi-threaded task scheduling and control result;
[0010] The loop operation management module is used to release the lock after the execution is completed, and notify the idle thread to continue processing the pending tasks in the task queue based on the release result.
[0011] In this embodiment, the thread pool is a form of multi-threaded processing. A certain number of threads are created in advance and placed in a pool for management. When a task needs to be executed, a thread is taken out of the thread pool to execute the task. After the task is completed, the thread is not destroyed, but returns to the thread pool to wait for the next task. This can avoid the overhead caused by frequent creation and destruction of threads, improve system performance and resource utilization, and the thread pool can effectively manage and schedule threads, such as controlling the number of threads, setting task queues, etc., to achieve more efficient concurrent processing.
[0012] Preferably, a pathology specimen auxiliary diagnosis system based on multi-threaded control and task scheduling, a distributed lock management module, includes:
[0013] a time determination unit, which obtains the allowable task processing time of a single use of the distributed lock based on the management terminal, and determines a timeout time of the distributed lock based on the allowable task processing time;
[0014] The distributed lock configuration unit is used to configure the distributed lock based on the timeout period. At the same time, it obtains the processing strategy after the timeout based on the management terminal, and configures the workflow of the distributed lock based on the processing strategy to obtain the final distributed lock.
[0015] Preferably, a pathology specimen auxiliary diagnosis system based on multi-threaded control and task scheduling, a distributed lock management module, includes:
[0016] A request monitoring unit is configured to establish a monitoring mechanism based on system operation requirements, and to monitor the data status of the request access interface in real time based on the monitoring mechanism, thereby obtaining a state sequence of the request access interface. When there is a sudden change in the data status at adjacent moments in the state sequence, it is determined that a task initiation request has been received.
[0017] Request parsing unit, used to:
[0018] Parse the received task initiation request and determine the target resources required for the current task based on the parsing results;
[0019] Traverse the access data of the target resource and determine the current access status of the target resource based on the traversal result. If no object is accessing the target resource, determine that the required resource is not locked.
[0020] The task initiation unit is used to initiate a request for allocation lock for the current task based on the determination result, lock the required resources, and call the required resources based on the locking result to perform a process response to the task initiation request.
[0021] Preferably, a pathology specimen auxiliary diagnosis system based on multi-thread control and task scheduling, the request parsing unit includes:
[0022] The result retrieval subunit is used to obtain the current access status of the target resource determined based on the traversal result, and when there is object access to the target resource, determine that the required resource has been locked;
[0023] A processing subunit, configured to:
[0024] Extracting the time attribute of the task initiation request based on the determination result, and determining the specific timestamp corresponding to the task initiation request based on the time attribute;
[0025] Obtain the waiting queue for the required resources based on the background management terminal, and sort the task initiation requests based on the specific timestamp;
[0026] Based on the sorting results, each task initiation request is sorted and waited in the waiting queue. At the same time, based on the configuration parameters of the distributed lock, the processing time of all task initiation requests before each task initiation request is evaluated, and based on the evaluation results, the response time of each task initiation request is determined in turn, and the response time of each task initiation request is marked based on the determination result.
[0027] Preferably, a pathology specimen auxiliary diagnosis system based on multi-threaded control and task scheduling, a timed task scheduling module, includes:
[0028] an interval determination unit, configured to determine a scanning frequency for the task queue based on management requirements, and determine a time interval for performing a single scan of the task queue based on the scanning frequency;
[0029] Scanning unit for:
[0030] Adapting a time trigger parameter of a preset trigger based on a time interval, and periodically generating a trigger instruction based on the time trigger parameter adaptation result;
[0031] The task queue is scanned periodically based on the trigger instruction, and tasks to be processed in the task queue are identified based on the periodic scanning result, and periodic tasks and delayed tasks are obtained based on the identification result;
[0032] The task allocation unit is used to allocate the identified periodic tasks and delayed tasks to the thread pool for execution.
[0033] Preferably, a pathology specimen auxiliary diagnosis system based on multi-thread control and task scheduling, a scanning unit, comprises:
[0034] The task attribute definition subunit is used to obtain the pathology specimen auxiliary diagnosis system, analyze the pathology specimen auxiliary diagnosis system, and determine the periodic task indicators and delayed task indicators;
[0035] Identify unit subunits for:
[0036] Based on the periodic task index and the delayed task index, each task in the task queue is traversed to obtain the task attributes of each task, and the task attributes of each task are matched with the periodic task index and the delayed task index respectively;
[0037] Based on the matching results, periodic tasks and delayed tasks are obtained, and the periodic tasks and delayed tasks are classified and integrated.
[0038] Preferably, a pathology specimen auxiliary diagnosis system based on multi-threaded control and task scheduling, a multi-threaded task execution module, includes:
[0039] Task parsing unit, used to:
[0040] Obtain the periodic tasks and delayed tasks, and extract basic information of the periodic tasks and delayed tasks;
[0041] Based on the extraction results, the task factors of periodic tasks and delayed tasks are determined respectively, and the influence weight of each task factor is determined based on the pathological specimen auxiliary diagnosis system;
[0042] The urgency of each periodic task and delayed task is evaluated based on task factors, predefined standards and corresponding impact weights, and the periodic tasks and delayed tasks are prioritized based on the positive correlation between urgency and priority mechanism to obtain the execution order;
[0043] Multi-threaded task scheduling and control unit, used for:
[0044] Based on the priority sorting results, periodic tasks are set as main thread tasks, and delayed tasks are set as background tasks. Threads are then allocated to each main thread task and background task in turn based on the setting results and execution order.
[0045] Based on the allocation results, each main thread task and background task are processed in parallel, and the parallel processing process is monitored in real time to determine the resource utilization characteristics of each thread;
[0046] Determine resource utilization based on utilization characteristics, and limit the number of threads in thread allocation results when resource utilization is lower than a preset threshold;
[0047] Based on the qualification results, the resource dependency characteristics of each periodic task and delayed task are determined according to the extraction results of the basic information, and the periodic tasks and delayed tasks are dynamically sorted without resource interference based on the resource dependency characteristics;
[0048] Dynamically adjust the execution order of each periodic task and delayed task based on dynamic sorting without resource interference;
[0049] The data processing unit is used to control multiple threads to perform data processing operations on each periodic task and delayed task based on the dynamic adjustment result of the execution order, and to track and dynamically adjust the data processing process.
[0050] Preferably, a pathology specimen auxiliary diagnosis system based on multi-thread control and task scheduling, the data processing unit includes:
[0051] The task tracking subunit is used to extract the address information of each periodic task and delayed task, and to track the data processing progress of each periodic task and delayed task in real time based on the address information;
[0052] Dynamically adjust the subunit for:
[0053] Determine the execution parameters of each periodic task and delayed task based on the real-time tracking results, and determine the task execution effect based on the execution parameters;
[0054] When the execution result of a task does not meet the expected requirements, the abnormal task is locked, and the target resources corresponding to the abnormal task are also locked synchronously;
[0055] Based on the locking result, resources and threads of abnormal tasks are rescheduled and processed again until the expected requirements are met;
[0056] The recording subunit is used to generate a processing log for each periodic task and delayed task when the task execution effect meets the expected requirements, and record the processing log.
[0057] Preferably, a pathology specimen auxiliary diagnosis system based on multi-threaded control and task scheduling, a cyclic operation management module, includes:
[0058] The lock release control unit is used to determine whether the data processing process of the periodic task and the delayed task is completed, and when the execution is completed, generate a lock control instruction and control the release of the lock according to the lock control instruction;
[0059] The notification unit is used to locate the idle thread and obtain the task sequence number value of the task queue, determine the first task to be processed according to the task sequence number value, and process the first task to be processed according to the idle thread.
[0060] Preferably, a pathology specimen auxiliary diagnosis system based on multi-thread control and task scheduling, a release lock control unit, comprises:
[0061] The result reading subunit is used to read the target processing results of periodic tasks and delayed tasks, and at the same time, obtain the preset conditions;
[0062] The judgment subunit is used to:
[0063] Match the target processing results with the preset conditions to determine whether the data processing process for periodic tasks and delayed tasks is completed;
[0064] When the target processing result meets the pre-condition, it is determined that the data processing process of the periodic task and the delayed task is completed;
[0065] Otherwise, it is determined that the data processing process for the periodic task and the delayed task has not been completed;
[0066] Release lock control subunit, used to:
[0067] When the data processing process of the periodic task and the delayed task is completed, the lock control instruction is triggered, and at the same time, the lock is released according to the lock control instruction.
[0068] Compared with the prior art, the present invention has the following beneficial effects:
[0069] By monitoring the task initiation requests for pathological specimen auxiliary diagnosis tasks and using distributed locks to judge the running status of the resources required for the task based on the monitoring results, it is convenient to determine whether the current task can be effectively executed based on the running status, avoiding conflicts in access to the same resource by different tasks. Secondly, when the required resources are not locked, the task execution is started and the task queue is scanned regularly, which facilitates multi-threaded task scheduling and control of periodic tasks and delayed tasks in the task queue, realizes efficient parallel processing of different tasks, and ensures the operating stability of the system. Finally, the lock is released after the execution is completed, which facilitates the processing of pending tasks in the task queue and ensures the efficiency and effectiveness of pathological specimen auxiliary diagnosis.
[0070] Other features and advantages of the present invention will be described in the following description, and in part will become apparent from the description, or will be understood by practicing the present invention. The purpose and other advantages of the present invention can be achieved and obtained through the structures specifically pointed out in this application document.
[0071] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0073] Figure 1 This is a structural diagram of a pathology specimen auxiliary diagnosis system based on multi-threaded control and task scheduling in an embodiment of the present invention;
[0074] Figure 2 This is a working principle diagram of a pathology specimen auxiliary diagnosis system based on multi-threaded control and task scheduling in an embodiment of the present invention;
[0075] Figure 3 This is a structural diagram of a distributed lock management module in a pathology specimen auxiliary diagnosis system based on multi-thread control and task scheduling in Example 3 of the present invention. DETAILED DESCRIPTION
[0076] The preferred embodiments of the present invention are described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.
[0077] Example 1:
[0078] This embodiment provides a pathology specimen auxiliary diagnosis system based on multi-thread control and task scheduling, such as Figure 1 Shown, including:
[0079] The distributed lock management module is used to obtain tasks for auxiliary diagnosis of pathological specimens. Based on the task initiation request, it uses distributed locks to determine the running status of the resources required for the task. If the required resources are not locked, it allocates locks and starts the task execution.
[0080] The scheduled task scheduling module is used to periodically scan the task queue based on the startup results, and assign periodic tasks and delayed tasks in the task queue to the thread pool based on the scanning results;
[0081] A multi-threaded task execution module is used to perform multi-threaded task scheduling and control on periodic tasks and delayed tasks according to a priority mechanism based on the allocation result, and perform data processing on the periodic tasks and delayed tasks based on the multi-threaded task scheduling and control result;
[0082] The loop operation management module is used to release the lock after the execution is completed, and notify the idle thread to continue processing the pending tasks in the task queue based on the release result.
[0083] In this embodiment, the principle diagram of the pathological specimen auxiliary diagnosis system based on multi-threaded control and task scheduling is as follows: Figure 2 shown.
[0084] In this embodiment, the thread pool is a form of multi-threaded processing. A certain number of threads are created in advance and placed in a pool for management. When a task needs to be executed, a thread is taken out of the thread pool to execute the task. After the task is completed, the thread is not destroyed, but returns to the thread pool to wait for the next task. This can avoid the overhead caused by frequent creation and destruction of threads, improve system performance and resource utilization, and the thread pool can effectively manage and schedule threads, such as controlling the number of threads, setting task queues, etc., to achieve more efficient concurrent processing.
[0085] In this embodiment, the distributed lock refers to the Redis distributed lock. Redis is used as the distributed lock management component, and the mutual exclusion mechanism is implemented through the SETNX and EXPIRE commands to ensure that only one thread or node can access or operate shared resources at the same time. At the same time, the RedLock algorithm is used to enhance the reliability of the lock and prevent the lock from failing due to network partitions or process abnormalities.
[0086] In this embodiment, the resources required for the task refer to the data resources needed when performing the corresponding pathological specimen auxiliary diagnosis task.
[0087] In this embodiment, the running status refers to whether the required resource is currently being accessed or is in an idle state.
[0088] In this embodiment, the required resources are not locked, which means that the resources required for the pathological specimen auxiliary diagnosis task are not accessed, that is, there is no thread calling the currently required resources.
[0089] In this embodiment, allocating a lock means allocating the required resource to the current pathology specimen auxiliary diagnosis task when the required resource is not locked, that is, locking the required resource, thereby ensuring execution of the current pathology specimen auxiliary diagnosis task.
[0090] In this embodiment, the task queue contains multiple tasks to be processed.
[0091] In this embodiment, periodic tasks and delayed tasks refer to classifying the attributes of tasks in the task queue into two categories, namely periodic tasks and delayed tasks, wherein periodic tasks can be tasks such as data synchronization and resource cleaning related to auxiliary diagnosis of pathological specimens, and delayed tasks can be asynchronous data processing. Specifically, in asynchronous data processing, when an operation (such as initiating a network request, performing a long calculation, etc.) is started, the program will not block and wait for the completion of the operation, but will continue to execute other tasks. When the asynchronous operation is completed, the program will be notified in some way (such as callback function, event, etc.) so that the program can perform subsequent processing.
[0092] In this embodiment, the priority mechanism is a mechanism for sorting the processing order of different tasks included in the periodic tasks and the delayed tasks.
[0093] In this embodiment, multi-threaded task scheduling and control refers to the allocation of different threads to the tasks to be processed, and at the same time, the execution order and required threads of different tasks are scheduled and managed according to the actual processing situation during the processing process, in order to ensure that different tasks can be effectively processed at the same time.
[0094] In this embodiment, data processing refers to performing business analysis and corresponding diagnosis assistance on corresponding tasks according to the assigned threads.
[0095] In this embodiment, releasing the lock refers to releasing the resources required by the current task after the current task is completed, so as to facilitate the execution of other tasks that require the current resources.
[0096] In this embodiment, the pending tasks refer to other tasks in the task queue that need to be processed.
[0097] The working principle and beneficial effects of the above technical solution are: by monitoring the task initiation request of the pathological specimen auxiliary diagnosis task, and using distributed locks to judge the running status of the resources required for the task based on the monitoring results, it is convenient to determine whether the current task can be effectively executed based on the running status, avoiding conflicts in access to the same resource by different tasks; secondly, when the required resources are not locked, the task execution is started, and the task queue is scanned regularly, so as to facilitate multi-threaded task scheduling and control of periodic tasks and delayed tasks in the task queue, realize efficient parallel processing of different tasks, and ensure the operation stability of the system; finally, the lock is released after the execution is completed, so as to facilitate the processing of pending tasks in the task queue, and ensure the efficiency and effect of pathological specimen auxiliary diagnosis.
[0098] Example 2:
[0099] Based on Example 1, this embodiment provides a pathology specimen auxiliary diagnosis system based on multi-thread control and task scheduling, and a distributed lock management module, including:
[0100] a time determination unit, which obtains the allowable task processing time of a single use of the distributed lock based on the management terminal, and determines a timeout time of the distributed lock based on the allowable task processing time;
[0101] The distributed lock configuration unit is used to configure the distributed lock based on the timeout period. At the same time, it obtains the processing strategy after the timeout based on the management terminal, and configures the workflow of the distributed lock based on the processing strategy to obtain the final distributed lock.
[0102] In this embodiment, the processing strategy is set in advance, and the distributed lock may be automatically released after a timeout so that other nodes can acquire it.
[0103] In this embodiment, the timeout configuration of the distributed lock based on the timeout period refers to the maximum threshold of the processing task duration. When the maximum threshold is exceeded, the distributed lock is automatically released based on the processing strategy.
[0104] In this embodiment, configuring the workflow of the distributed lock based on the processing strategy refers to configuring the processing strategy into a mechanism that can be automatically executed, that is, determining the operation mode of the distributed lock in different situations according to specific rules and methods.
[0105] The working principle and beneficial effects of the above technical solution are: by obtaining the allowable task processing time when the distributed lock is used once, the timeout time of the distributed lock is effectively determined, and then the distributed lock is configured with a timeout based on the timeout time and the workflow of the distributed lock is configured based on the processing strategy, thereby effectively realizing the acquisition of the distributed lock, enhancing the precise control and management of the use time of the distributed lock, ensuring that resources are used within a reasonable time, and avoiding unlimited occupation.
[0106] Example 3:
[0107] Based on Example 1, this embodiment provides a pathology specimen auxiliary diagnosis system based on multi-thread control and task scheduling, such as Figure 3 As shown, the distributed lock management module includes:
[0108] A request monitoring unit is configured to establish a monitoring mechanism based on system operation requirements, and to monitor the data status of the request access interface in real time based on the monitoring mechanism, thereby obtaining a state sequence of the request access interface. When there is a sudden change in the data status at adjacent moments in the state sequence, it is determined that a task initiation request has been received.
[0109] Request parsing unit, used to:
[0110] Parse the received task initiation request and determine the target resources required for the current task based on the parsing results;
[0111] Traverse the access data of the target resource and determine the current access status of the target resource based on the traversal result. If no object is accessing the target resource, determine that the required resource is not locked.
[0112] The task initiation unit is used to initiate a request for allocation lock for the current task based on the determination result, lock the required resources, and call the required resources based on the locking result to perform a process response to the task initiation request.
[0113] In this embodiment, the monitoring mechanism refers to a tool that is determined according to pre-set system operation requirements and is used to monitor the data status of the access request interface.
[0114] In this embodiment, the data status of the access request interface may be a working status or a busy status of the access request interface.
[0115] In this embodiment, the state sequence of requesting access to the interface refers to a set of sequences obtained by recording the state of requesting access to the interface in real time according to a preset time interval.
[0116] The working principle and beneficial effects of the above technical solution are: through the constructed monitoring mechanism, the data status of the request access interface is monitored in real time, and when a sudden change in the data status is found at adjacent moments, it is determined that there is a task initiation request; the task initiation request is parsed to find the required target resource, and then the current access status of the target resource is determined by traversing the access data to determine whether it is locked; lock allocation and resource locking are performed when it is determined that the resource is not locked, and then the locked resource is used to respond to the task initiation request, thereby realizing the response to the process, being able to monitor the task initiation request in real time and accurately, and process it in time, thereby improving the responsiveness and real-time performance of the system; effectively managing resource access in a distributed environment to ensure the stable operation of the system and data consistency.
[0117] Example 4:
[0118] Based on Example 3, this embodiment provides a pathology specimen auxiliary diagnosis system based on multi-thread control and task scheduling, wherein the request parsing unit includes:
[0119] The result retrieval subunit is used to obtain the current access status of the target resource determined based on the traversal result, and when there is object access to the target resource, determine that the required resource has been locked;
[0120] A processing subunit, configured to:
[0121] Extracting the time attribute of the task initiation request based on the determination result, and determining the specific timestamp corresponding to the task initiation request based on the time attribute;
[0122] Obtain the waiting queue for the required resources based on the background management terminal, and sort the task initiation requests based on the specific timestamp;
[0123] Based on the sorting results, each task initiation request is sorted and waited in the waiting queue. At the same time, based on the configuration parameters of the distributed lock, the processing time of all task initiation requests before each task initiation request is evaluated, and based on the evaluation results, the response time of each task initiation request is determined in turn, and the response time of each task initiation request is marked based on the determination result.
[0124] In this embodiment, the specific timestamp indicates the starting time point corresponding to the specific task initiation request.
[0125] The working principle and beneficial effects of the above technical solution are as follows: by determining the access status of the target resource, it is effectively determined whether the resource is locked. When the resource is locked, the time attribute of the task initiation request is extracted and the specific timestamp is determined. Then, based on the waiting queue obtained in the background, the task initiation requests are sorted according to the timestamp. At the same time, the processing time of all predecessor task initiation requests is evaluated according to the configuration parameters of the distributed lock, and the response time of each task initiation request is determined and marked. It can finely handle task initiation requests under resource locking conditions, improve the orderliness and fairness of the system through orderly queuing and time management, effectively avoid confusion and errors caused by resource competition, and ensure that tasks are processed in a reasonable order and time.
[0126] Example 5:
[0127] Based on Example 1, this embodiment provides a pathology specimen auxiliary diagnosis system based on multi-threaded control and task scheduling, and a scheduled task scheduling module, including:
[0128] an interval determination unit, configured to determine a scanning frequency for the task queue based on management requirements, and determine a time interval for performing a single scan of the task queue based on the scanning frequency;
[0129] Scanning unit for:
[0130] Adapting a time trigger parameter of a preset trigger based on a time interval, and periodically generating a trigger instruction based on the time trigger parameter adaptation result;
[0131] The task queue is scanned periodically based on the trigger instruction, and tasks to be processed in the task queue are identified based on the periodic scanning result, and periodic tasks and delayed tasks are obtained based on the identification result;
[0132] The task allocation unit is used to allocate the identified periodic tasks and delayed tasks to the thread pool for execution.
[0133] In this embodiment, the management requirement is set in advance and is used to represent the scanning frequency of the task queue.
[0134] In this embodiment, the preset trigger is a tool or device that is set in advance and is used to generate a trigger signal.
[0135] In this embodiment, time trigger parameter adaptation refers to configuring parameters of a preset trigger according to a determined time interval, in order to ensure that the preset trigger can generate a periodic trigger signal.
[0136] In this embodiment, periodically generating a trigger instruction refers to controlling the generation of an instruction by a preset trigger according to the adaptation result of the time trigger parameter, for the purpose of periodically scanning the task queue.
[0137] The working principle and beneficial effects of the above technical solution are: by parsing the management requirements, the scanning frequency of the task queue is determined, and the time interval of a single scan is locked. Secondly, the time trigger parameters of the preset trigger are adapted according to the determined time interval, so as to periodically generate trigger instructions. Finally, the task queue is scanned regularly according to the periodically generated trigger instructions, and periodic tasks and delayed tasks are effectively identified. The identified periodic tasks and delayed tasks are assigned to the thread pool for execution, ensuring the efficiency of the execution of pathological specimen auxiliary diagnosis tasks.
[0138] Example 6:
[0139] Based on Example 5, this embodiment provides a pathology specimen auxiliary diagnosis system based on multi-thread control and task scheduling, wherein the scanning unit includes:
[0140] The task attribute definition subunit is used to obtain the pathology specimen auxiliary diagnosis system, analyze the pathology specimen auxiliary diagnosis system, and determine the periodic task indicators and delayed task indicators;
[0141] Identify unit subunits for:
[0142] Based on the periodic task index and the delayed task index, each task in the task queue is traversed to obtain the task attributes of each task, and the task attributes of each task are matched with the periodic task index and the delayed task index respectively;
[0143] Based on the matching results, periodic tasks and delayed tasks are obtained, and the periodic tasks and delayed tasks are classified and integrated.
[0144] In this embodiment, the pathology specimen auxiliary diagnosis system is known in advance and is used to characterize all knowledge and parameters related to pathology specimen auxiliary diagnosis.
[0145] In this embodiment, the periodic task indicator refers to an indicator parameter that can characterize the current task as a periodic task, such as a data synchronization indicator and a data cleaning indicator, both of which are tasks that need to be performed periodically.
[0146] In this embodiment, the delay task indicator refers to an indicator parameter that can characterize the current task as a delay task, for example, it can be a processing time parameter. When the processing time parameter exceeds a certain threshold, it is a delay task.
[0147] In this embodiment, the task attributes refer to parameter information that can characterize the type or requirements of each task.
[0148] The working principle and beneficial effects of the above technical solution are: by analyzing the auxiliary diagnosis system of the acquired pathological specimens, the periodic task indicators and delayed task indicators are effectively determined, providing a reference basis for task identification; secondly, according to the obtained periodic task indicators and delayed task indicators, each task in the task queue is matched and analyzed to achieve effective identification and distinction of periodic tasks and delayed tasks, thereby providing convenience and guarantee for multi-threaded allocation and task scheduling of periodic tasks and delayed tasks.
[0149] Example 7:
[0150] Based on Example 1, this embodiment provides a pathology specimen auxiliary diagnosis system based on multi-threaded control and task scheduling, and a multi-threaded task execution module, including:
[0151] Task parsing unit, used to:
[0152] Obtain the periodic tasks and delayed tasks, and extract basic information of the periodic tasks and delayed tasks;
[0153] Based on the extraction results, the task factors of periodic tasks and delayed tasks are determined respectively, and the influence weight of each task factor is determined based on the pathological specimen auxiliary diagnosis system;
[0154] The urgency of each periodic task and delayed task is evaluated based on task factors, predefined standards and corresponding impact weights, and the periodic tasks and delayed tasks are prioritized based on the positive correlation between urgency and priority mechanism to obtain the execution order;
[0155] Multi-threaded task scheduling and control unit, used for:
[0156] Based on the priority sorting results, periodic tasks are set as main thread tasks, and delayed tasks are set as background tasks. Threads are then allocated to each main thread task and background task in turn based on the setting results and execution order.
[0157] Based on the allocation results, each main thread task and background task are processed in parallel, and the parallel processing process is monitored in real time to determine the resource utilization characteristics of each thread;
[0158] Determine resource utilization based on utilization characteristics, and limit the number of threads in thread allocation results when resource utilization is lower than a preset threshold;
[0159] Based on the qualification results, the resource dependency characteristics of each periodic task and delayed task are determined according to the extraction results of the basic information, and the periodic tasks and delayed tasks are dynamically sorted without resource interference based on the resource dependency characteristics;
[0160] Dynamically adjust the execution order of each periodic task and delayed task based on dynamic sorting without resource interference;
[0161] The data processing unit is used to control multiple threads to perform data processing operations on each periodic task and delayed task based on the dynamic adjustment result of the execution order, and to track and dynamically adjust the data processing process.
[0162] In this embodiment, the basic information refers to the service types corresponding to the periodic tasks and delayed tasks and the basic parameters included, such as the pathology type.
[0163] In this embodiment, the task factors refer to parameters that can characterize the specific conditions of periodic tasks and delayed tasks, such as task start time and task deadline.
[0164] In this embodiment, the impact weight refers to the importance of each task factor when determining the urgency, and a larger value indicates greater importance.
[0165] In this embodiment, the predefined standard is set in advance and is a standard and basis for characterizing and evaluating the urgency of each periodic task and delayed task.
[0166] In this embodiment, the main thread task refers to a task that needs to be executed in real time, that is, task blocking cannot occur.
[0167] In this embodiment, the background task refers to a task that can be executed in the background.
[0168] In this embodiment, the utilization feature refers to the utilization of resources by each thread, and the purpose is to determine whether there is any waste of resources.
[0169] In this embodiment, the preset threshold is set in advance and is used as a basis for measuring whether the resource utilization rate is lower than the minimum standard, and can be adjusted.
[0170] In this embodiment, the purpose of limiting the number of threads is to improve resource utilization.
[0171] In this embodiment, the resource dependency characteristics refer to the types and quantities of resources required when executing each periodic task and delayed task.
[0172] In this embodiment, dynamic sorting without resource interference refers to conflict-free sorting of the resources required by each periodic task and delayed task, that is, when different tasks access the same resource, the two are sorted separately. At the same time, when different tasks do not access the same resource, they are sorted according to priority order. The purpose is to dynamically adjust the execution order of each periodic task and delayed task according to the actual execution situation to ensure the reliability and stability of multi-threaded operation.
[0173] The working principle and beneficial effects of the above technical solution are: by extracting and parsing the basic information of periodic tasks and delayed tasks, the urgency of each periodic task and delayed task can be accurately and effectively determined, so as to facilitate the priority sorting of periodic tasks and delayed tasks according to the positive correlation between urgency and priority mechanism; secondly, threads are allocated to each periodic task and delayed task in turn according to the sorting results, and parallel processing is performed; at the same time, during processing, the resource utilization characteristics of each thread are monitored, so that when there is resource waste, the number of threads is limited, thereby ensuring the reliability of multi-threaded control and task scheduling; finally, while processing, the resource dependency characteristics of each periodic task and delayed task are determined respectively, and the execution order of each periodic task and delayed task is dynamically adjusted according to the resource dependency characteristics, thereby ensuring the stability and orderliness of the simultaneous processing of different tasks, greatly improving the efficiency of auxiliary diagnosis of pathological specimens.
[0174] Example 8:
[0175] Based on Example 7, this embodiment provides a pathology specimen auxiliary diagnosis system based on multi-thread control and task scheduling, wherein the data processing unit includes:
[0176] The task tracking subunit is used to extract the address information of each periodic task and delayed task, and to track the data processing progress of each periodic task and delayed task in real time based on the address information;
[0177] Dynamically adjust the subunit for:
[0178] Determine the execution parameters of each periodic task and delayed task based on the real-time tracking results, and determine the task execution effect based on the execution parameters;
[0179] When the execution result of a task does not meet the expected requirements, the abnormal task is locked, and the target resources corresponding to the abnormal task are also locked synchronously;
[0180] Based on the locking result, resources and threads of abnormal tasks are rescheduled and processed again until the expected requirements are met;
[0181] The recording subunit is used to generate a processing log for each periodic task and delayed task when the task execution effect meets the expected requirements, and record the processing log.
[0182] In this embodiment, the address information refers to specific address parameters corresponding to each periodic task and delayed task, and is intended to track the processing status of each periodic task and delayed task.
[0183] In this embodiment, the execution parameter refers to the specific execution status of each periodic task and delayed task.
[0184] In this embodiment, the expected requirements are set in advance, for example, normal execution and execution efficiency must meet a certain numerical requirement.
[0185] In this embodiment, an abnormal task refers to a task whose execution effect does not meet expected requirements, and is one or more of a periodic task and a delayed task.
[0186] The working principle and beneficial effects of the above technical solution are: by tracking the data processing process, the task execution effect of each periodic task and delayed task can be effectively determined, so that when the task execution effect does not meet the expected requirements, resource scheduling and thread processing of abnormal tasks can be carried out until the expected requirements are met. At the same time, when the task execution effect meets the expected requirements, a processing log for each periodic task and delayed task is generated, and the processing log is recorded, which improves the reliability of auxiliary diagnosis management of pathological specimens and facilitates effective understanding of the auxiliary diagnosis situation.
[0187] Example 9:
[0188] Based on Example 1, this embodiment provides a pathology specimen auxiliary diagnosis system based on multi-threaded control and task scheduling, and a cyclic operation management module, including:
[0189] The lock release control unit is used to determine whether the data processing process of the periodic task and the delayed task is completed, and when the execution is completed, generate a lock control instruction and control the release of the lock according to the lock control instruction;
[0190] The notification unit is used to locate the idle thread and obtain the task sequence number value of the task queue, determine the first task to be processed according to the task sequence number value, and process the first task to be processed according to the idle thread.
[0191] The working principle and beneficial effects of the above technical solution are: by judging whether the data processing process of periodic tasks and delayed tasks is completed, lock control instructions can be effectively and accurately generated, thereby ensuring the accuracy and timeliness of releasing the lock; by locating idle threads and determining the first task to be processed, the timeliness and effectiveness of multi-threaded control and task scheduling can be effectively guaranteed, thereby improving the efficiency of multi-threaded control and task scheduling.
[0192] Example 10:
[0193] Based on Example 9, this embodiment provides a pathology specimen auxiliary diagnosis system based on multi-thread control and task scheduling, wherein the release lock control unit includes:
[0194] The result reading subunit is used to read the target processing results of periodic tasks and delayed tasks, and at the same time, obtain the preset conditions;
[0195] The judgment subunit is used to:
[0196] Match the target processing results with the preset conditions to determine whether the data processing process for periodic tasks and delayed tasks is completed;
[0197] When the target processing result meets the pre-condition, it is determined that the data processing process of the periodic task and the delayed task is completed;
[0198] Otherwise, it is determined that the data processing process for the periodic task and the delayed task has not been completed;
[0199] Release lock control subunit, used to:
[0200] When the data processing process of the periodic task and the delayed task is completed, the lock control instruction is triggered, and at the same time, the lock is released according to the lock control instruction.
[0201] In this embodiment, the preset conditions are set in advance and are used as a measurement standard for measuring the target processing results of the periodic tasks and the delayed tasks.
[0202] In this embodiment, the lock control instruction is an instruction for releasing the lock that is automatically triggered when the data processing process of the periodic task and the delayed task is completed according to the determination result.
[0203] The working principle and beneficial effects of the above technical solution are: by reading the target processing results of periodic tasks and delayed tasks, and matching the target processing results of periodic tasks and delayed tasks with preset conditions, it is possible to effectively determine the target processing results of periodic tasks and delayed tasks, and when the data processing process of periodic tasks and delayed tasks is completed, trigger the lock control instruction to effectively ensure the integrity of the data processing process of periodic tasks and delayed tasks, release the lock according to the lock control instruction, and ensure the intelligence, timeliness and effectiveness of lock control.
[0204] Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if such changes and modifications fall within the scope of the claims and their equivalents, the present invention is intended to include such changes and modifications.
Claims
1. A pathology specimen auxiliary diagnosis system based on multi-thread control and task scheduling, characterized in that: include: The distributed lock management module is used to obtain tasks for auxiliary diagnosis of pathological specimens. Based on the task initiation request, it uses distributed locks to determine the running status of the resources required for the task. If the required resources are not locked, it allocates locks and starts the task execution. The scheduled task scheduling module is used to periodically scan the task queue based on the startup results, and assign periodic tasks and delayed tasks in the task queue to the thread pool based on the scanning results; A multi-threaded task execution module is used to perform multi-threaded task scheduling and control on periodic tasks and delayed tasks according to a priority mechanism based on the allocation result, and perform data processing on the periodic tasks and delayed tasks based on the multi-threaded task scheduling and control result; The loop operation management module is used to release the lock after the execution is completed, and notify the idle thread to continue processing the pending tasks in the task queue based on the release result; Among them, the multi-threaded task execution module includes: Task parsing unit, used to: Obtain the periodic tasks and delayed tasks, and extract basic information of the periodic tasks and delayed tasks; Based on the extraction results, the task factors of periodic tasks and delayed tasks are determined respectively, and the influence weight of each task factor is determined based on the pathological specimen auxiliary diagnosis system; Based on task factors, predefined criteria and corresponding impact weights, the urgency of each periodic task and delayed task is evaluated respectively. Based on the positive correlation between urgency and priority mechanism, the periodic tasks and delayed tasks are prioritized to obtain the execution order. Multi-threaded task scheduling and control unit, used for: Based on the priority sorting results, periodic tasks are set as main thread tasks, and delayed tasks are set as background tasks. Threads are then allocated to each main thread task and background task in turn based on the setting results and execution order. Based on the allocation results, each main thread task and background task are processed in parallel, and the parallel processing process is monitored in real time to determine the resource utilization characteristics of each thread; Determine resource utilization based on utilization characteristics, and limit the number of threads in thread allocation results when resource utilization is lower than a preset threshold; Based on the limited results and the extraction results of the basic information, the resource dependency characteristics of each periodic task and the delayed task are determined respectively, and the periodic tasks and the delayed tasks are dynamically sorted without resource interference based on the resource dependency characteristics; Dynamically adjust the execution order of each periodic task and delayed task based on dynamic sorting without resource interference; The data processing unit is used to control multiple threads to perform data processing operations on each periodic task and delayed task based on the dynamic adjustment result of the execution order, and to track and dynamically adjust the data processing process.
2. A pathological specimen auxiliary diagnosis system based on multi-thread control and task scheduling according to claim 1, characterized in that: Distributed lock management module, including: a time determination unit, which obtains the allowable task processing time of a single use of the distributed lock based on the management terminal, and determines a timeout time of the distributed lock based on the allowable task processing time; The distributed lock configuration unit is used to configure the distributed lock based on the timeout period. At the same time, it obtains the processing strategy after the timeout based on the management terminal, and configures the workflow of the distributed lock based on the processing strategy to obtain the final distributed lock.
3. A pathological specimen auxiliary diagnosis system based on multi-thread control and task scheduling according to claim 1, characterized in that: Distributed lock management module, including: A request monitoring unit is configured to establish a monitoring mechanism based on system operation requirements, and to monitor the data status of the request access interface in real time based on the monitoring mechanism, thereby obtaining a state sequence of the request access interface. When there is a sudden change in the data status at adjacent moments in the state sequence, it is determined that a task initiation request has been received. Request parsing unit, used to: Parse the received task initiation request and determine the target resources required for the current task based on the parsing results; Traverse the access data of the target resource and determine the current access status of the target resource based on the traversal result. If no object is accessing the target resource, determine that the required resource is not locked. The task initiation unit is used to initiate a request for allocation lock for the current task based on the determination result, lock the required resources, and call the required resources based on the locking result to perform a process response to the task initiation request.
4. A pathological specimen auxiliary diagnosis system based on multi-thread control and task scheduling according to claim 3, characterized in that: Request parsing unit, including: The result retrieval subunit is used to obtain the current access status of the target resource determined based on the traversal result, and when there is object access to the target resource, determine that the required resource has been locked; A processing subunit, configured to: Extracting the time attribute of the task initiation request based on the determination result, and determining the specific timestamp corresponding to the task initiation request based on the time attribute; Obtain the waiting queue for the required resources based on the background management terminal, and sort the task initiation requests based on the specific timestamp; Based on the sorting results, each task initiation request is sorted and waited in the waiting queue. At the same time, based on the configuration parameters of the distributed lock, the processing time of all task initiation requests before each task initiation request is evaluated, and based on the evaluation results, the response time of each task initiation request is determined in turn, and the response time of each task initiation request is marked based on the determination result.
5. The pathological specimen auxiliary diagnosis system based on multi-thread control and task scheduling according to claim 1 is characterized in that: Scheduled task scheduling module, including: an interval determination unit, configured to determine a scanning frequency for the task queue based on management requirements, and determine a time interval for performing a single scan of the task queue based on the scanning frequency; Scanning unit for: Adapting a time trigger parameter of a preset trigger based on a time interval, and periodically generating a trigger instruction based on the time trigger parameter adaptation result; The task queue is scanned periodically based on the trigger instruction, and tasks to be processed in the task queue are identified based on the periodic scanning result, and periodic tasks and delayed tasks are obtained based on the identification result; The task allocation unit is used to allocate the identified periodic tasks and delayed tasks to the thread pool for execution.
6. A pathology specimen auxiliary diagnosis system based on multi-thread control and task scheduling according to claim 5, characterized in that: Scanning unit, including: The task attribute definition subunit is used to obtain the pathology specimen auxiliary diagnosis system, analyze the pathology specimen auxiliary diagnosis system, and determine the periodic task indicators and delayed task indicators; Identify unit subunits for: Based on the periodic task index and the delayed task index, each task in the task queue is traversed to obtain the task attributes of each task, and the task attributes of each task are matched with the periodic task index and the delayed task index respectively; Based on the matching results, periodic tasks and delayed tasks are obtained, and the periodic tasks and delayed tasks are classified and integrated.
7. A pathological specimen auxiliary diagnosis system based on multi-thread control and task scheduling according to claim 1, characterized in that: Data processing unit, including: The task tracking subunit is used to extract the address information of each periodic task and delayed task, and to track the data processing progress of each periodic task and delayed task in real time based on the address information; Dynamically adjust the subunit for: Determine the execution parameters of each periodic task and delayed task based on the real-time tracking results, and determine the task execution effect based on the execution parameters; When the execution result of a task does not meet the expected requirements, the abnormal task is locked, and the target resources corresponding to the abnormal task are also locked synchronously; Based on the locking result, resources and threads of abnormal tasks are rescheduled and processed again until the expected requirements are met; The recording subunit is used to generate a processing log for each periodic task and delayed task when the task execution effect meets the expected requirements, and record the processing log.
8. The pathological specimen auxiliary diagnosis system based on multi-thread control and task scheduling according to claim 1 is characterized in that: Cycle operation management module, including: The lock release control unit is used to determine whether the data processing process of the periodic task and the delayed task is completed, and when the execution is completed, generate a lock control instruction and control the release of the lock according to the lock control instruction; The notification unit is used to locate the idle thread and obtain the task sequence number value of the task queue, determine the first task to be processed according to the task sequence number value, and process the first task to be processed according to the idle thread.
9. A pathological specimen auxiliary diagnosis system based on multi-thread control and task scheduling according to claim 8, characterized in that: Release lock control unit, including: The result reading subunit is used to read the target processing results of periodic tasks and delayed tasks, and at the same time, obtain the preset conditions; The judgment subunit is used to: Match the target processing results with the preset conditions to determine whether the data processing process for periodic tasks and delayed tasks is completed; When the target processing result meets the pre-condition, it is determined that the data processing process of the periodic task and the delayed task is completed; Otherwise, it is determined that the data processing process for the periodic task and the delayed task has not been completed; Release lock control subunit, used to: When the data processing process of the periodic task and the delayed task is completed, the lock control instruction is triggered, and at the same time, the lock is released according to the lock control instruction.
Citation Information
Patent Citations
Task scheduling system and method, equipment and storage medium
CN112181621A
Business processing method and device, electronic equipment and computer readable storage medium
CN118277109A