Pathological specimen auxiliary diagnosis system based on multi-thread control and task scheduling

By adopting multi-threaded control and task scheduling technology in the pathological diagnosis system, the problem of inefficiency of traditional pathological diagnosis methods is solved, and efficient parallel processing and system stability of assisted diagnosis of pathological specimens are achieved.

CN119883571AActive Publication Date: 2025-04-25GUANGZHOU FANGXIN MEDICAL TECH CO LTD

Patent Information

Application Number
CN202510034247.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-09
Publication Date
2025-04-25
Estimated Expiration
2045-01-09

AI Technical Summary

Technical Problem

Traditional pathological diagnosis methods are time-consuming and labor-intensive and difficult to meet clinical needs. Especially in the case of an increase in the number of cases and a shortage of pathologists, it is difficult to improve diagnostic efficiency.

Method used

The pathological specimen-assisted diagnosis system based on multi-threaded control and task scheduling is adopted to monitor the task resource status through the distributed lock management module to avoid resource conflicts, and efficient parallel processing of periodic tasks and delayed tasks is achieved through the timed task scheduling module and the multi-threaded task execution module.

Benefits of technology

It improves the efficiency and effectiveness of assisted diagnosis of pathological specimens, ensures the operating stability of the system, and effectively manages the pending tasks in the task queue.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119883571A_ABST
    Figure CN119883571A_ABST
Patent Text Reader

Abstract

The invention provides a pathological specimen auxiliary diagnosis system based on multi-thread control and task scheduling, and the system comprises a distributed lock management module which is used for employing a distributed lock to judge the operation state of a resource needed by a task based on a task initiation request, and distributing the lock and starting task execution when the needed resource is not locked; the timed task scheduling module is used for regularly scanning the task queue and distributing periodic tasks and delayed tasks in the task queue to a thread pool based on a scanning result; the multi-thread task execution module is used for performing multi-thread task scheduling and control on the periodic tasks and the delayed tasks according to a priority mechanism on the basis of the distribution result, and performing data processing on the periodic tasks and the delayed tasks on the basis of a multi-thread task scheduling and control result; and the loop operation management module is used for releasing the lock after the execution is finished, and notifying the idle thread to continuously process the to-be-processed task in the task queue based on a release result. And the efficiency and the effect of auxiliary diagnosis of the pathological specimen are ensured.
Need to check novelty before this filing date? Find Prior Art

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. However, traditional pathological diagnosis often relies on pathologists to manually analyze whole slide images (WSI), which is time-consuming and labor-intensive. With the increase in the number of cases and the shortage of pathologists, the diagnostic efficiency is difficult to meet clinical needs. In addition, a diagnosis process usually requires the analysis of multiple images and massive data. At present, traditional pathological diagnosis methods are difficult to solve the above problems, which greatly reduces the efficiency of pathological diagnosis. Therefore, in order to overcome the above defects, the present invention provides a pathological specimen auxiliary diagnosis system based on multi-thread control and task scheduling. Summary of the invention

[0003] The present invention provides a pathological specimen auxiliary diagnosis system based on multi-threaded control and task scheduling, which is used to monitor the task initiation request of the pathological specimen auxiliary diagnosis task, and use distributed locks to judge the running status of the resources required for the task according to the monitoring result, 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 running 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 pathological specimen auxiliary diagnosis.

[0004] The present invention provides a pathological specimen auxiliary diagnosis system based on multi-thread control and task scheduling, comprising: The distributed lock management module is used to obtain the task of auxiliary diagnosis of pathological specimens, and uses the distributed lock to determine the running status of the resources required for the task based on the task initiation request, and when the required resources are not locked, allocates the lock and starts the task execution; The scheduled task scheduling module is used to periodically scan the task queue based on the startup results, and allocate the periodic tasks and delayed tasks in the task queue to the thread pool based on the scanning results; A multi-threaded task execution module, used for performing multi-threaded task scheduling and control on periodic tasks and delayed tasks according to a priority mechanism based on the allocation result, and performing data processing on 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.

[0005] 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 the performance and resource utilization of the system, 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.

[0006] Preferably, a pathological specimen auxiliary diagnosis system based on multi-thread control and task scheduling, a distributed lock management module, comprises: 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 the timeout time of the distributed lock based on the allowable task time; The distributed lock configuration unit is used to perform timeout configuration on the distributed lock based on the timeout period, and at the same time, obtain the processing strategy after the timeout based on the management terminal, and configure the workflow of the distributed lock based on the processing strategy to obtain the final distributed lock.

[0007] Preferably, a pathological specimen auxiliary diagnosis system based on multi-thread control and task scheduling, a distributed lock management module, comprises: The request monitoring unit is used to build a monitoring mechanism based on the system operation requirements, and monitor the data status of the request access interface in real time based on the monitoring mechanism to obtain a state sequence of the request access interface, and 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 result; Traverse the access data of the target resource, and determine the current access status of the target resource based on the traversal result, and when no object accesses the target resource, determine that the required resource is not locked; The task initiation unit is used to initiate a request for allocating a lock for the current task based on the determination result, and to lock the required resources, and to call the required resources based on the locking result to perform a process response to the task initiation request.

[0008] Preferably, a pathological specimen auxiliary diagnosis system based on multi-thread control and task scheduling, request parsing unit, comprises: The result calling 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 for: 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 result, 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 result, 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.

[0009] Preferably, a pathological specimen auxiliary diagnosis system based on multi-thread control and task scheduling, a timed task scheduling module, comprises: An interval determination unit, used to determine a scanning frequency of the task queue based on management requirements, and to determine a time interval for 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 a result of the time trigger parameter adaptation; Performing a periodic scan on the task queue based on the trigger instruction, and identifying the pending tasks in the task queue at each scan based on the periodic scan result, and obtaining the periodic tasks and the delayed tasks 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.

[0010] Preferably, a pathological specimen auxiliary diagnosis system based on multi-thread control and task scheduling, a scanning unit, comprises: The task attribute definition subunit is used to obtain the pathological specimen auxiliary diagnosis system, analyze the pathological 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 attribute of each task, and the task attribute of each task is 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.

[0011] Preferably, a pathological specimen auxiliary diagnosis system based on multi-thread control and task scheduling, a multi-thread task execution module, comprises: 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 standards and corresponding impact weights, the urgency of each periodic task and delayed task is evaluated respectively, and based on the positive correlation between the urgency and the priority mechanism, the periodic tasks and delayed tasks are prioritized to obtain the execution order; Multithreaded task scheduling and control unit for: Based on the priority sorting results, the periodic tasks are set as main thread tasks, and the delayed tasks are set as background tasks. Threads are allocated to the main thread tasks and background tasks 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 the utilization characteristics, and limit the number of threads in the thread allocation result when the resource utilization is lower than a preset threshold; Based on the qualification result, the resource dependency characteristics of each periodic task and delayed task are determined according to the extraction result of the basic information, and the periodic tasks and 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 the multi-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.

[0012] Preferably, a pathological specimen auxiliary diagnosis system based on multi-thread control and task scheduling, a data processing unit, comprises: 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 subunits 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 effect of a task does not meet the expected requirements, the abnormal task is locked, and the target resources corresponding to the abnormal task are locked synchronously; Reschedule resources and process threads for abnormal tasks based on the locking results 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.

[0013] Preferably, a pathological specimen auxiliary diagnosis system based on multi-thread control and task scheduling, a cyclic operation management module, includes: A 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.

[0014] Preferably, a pathological specimen auxiliary diagnosis system based on multi-thread control and task scheduling, a release lock control unit, comprises: The result reading subunit is used to read the target processing results of the periodic task and the delayed task, 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-realized condition, it is determined that the data processing process for 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.

[0015] Compared with the prior art, the present invention has the following beneficial effects: By monitoring the task initiation requests of the 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, and avoid conflicts in the access of different tasks to 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 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 effectiveness of pathological specimen auxiliary diagnosis.

[0016] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures specifically pointed out in this application document.

[0017] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] 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: Figure 1 It is a structural diagram of a pathological specimen auxiliary diagnosis system based on multi-thread control and task scheduling in an embodiment of the present invention; Figure 2 It is a working principle diagram of a pathological specimen auxiliary diagnosis system based on multi-thread control and task scheduling in an embodiment of the present invention; Figure 3 This is a structural diagram of a distributed lock management module in a pathological specimen auxiliary diagnosis system based on multi-thread control and task scheduling in Example 3 of the present invention. DETAILED DESCRIPTION

[0019] The preferred embodiments of the present invention are described below in conjunction with 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.

[0020] Embodiment 1: This embodiment provides a pathological specimen auxiliary diagnosis system based on multi-thread control and task scheduling. Figure 1 As shown, including: The distributed lock management module is used to obtain the task of auxiliary diagnosis of pathological specimens, and uses the distributed lock to determine the running status of the resources required for the task based on the task initiation request, and when the required resources are not locked, allocates the lock and starts the task execution; The scheduled task scheduling module is used to periodically scan the task queue based on the startup results, and allocate the periodic tasks and delayed tasks in the task queue to the thread pool based on the scanning results; A multi-threaded task execution module, used for performing multi-threaded task scheduling and control on periodic tasks and delayed tasks according to a priority mechanism based on the allocation result, and performing data processing on 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.

[0021] In this embodiment, the schematic diagram of the pathological specimen auxiliary diagnosis system based on multi-thread control and task scheduling is as follows: Figure 2 shown.

[0022] 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 the performance and resource utilization of the system, 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.

[0023] In this embodiment, the distributed lock refers to the Redis distributed lock. Redis is used as the distributed lock management component. 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 to prevent the lock from failing due to network partitions or process abnormalities.

[0024] In this embodiment, the resources required for the task refer to the data resources needed when performing the corresponding pathological specimen auxiliary diagnosis task.

[0025] In this embodiment, the running state refers to whether the required resource is currently being accessed or is in an idle state.

[0026] 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.

[0027] In this embodiment, allocating a lock means that when the required resource is not locked, the required resource is allocated to the current pathological specimen auxiliary diagnosis task, that is, the required resource is locked, thereby ensuring that the current pathological specimen auxiliary diagnosis is performed.

[0028] In this embodiment, the task queue contains a plurality of tasks to be processed.

[0029] 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 the periodic tasks may be tasks such as data synchronization and resource cleanup related to auxiliary diagnosis of pathological specimens, and the delayed tasks may be asynchronous data processing. Specifically, in asynchronous data processing, when an operation (such as initiating a network request, executing 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 a callback function, event, etc.) so that the program can perform subsequent processing.

[0030] 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.

[0031] In this embodiment, multi-threaded task scheduling and control refers to the allocation of different threads to the tasks to be processed, and scheduling and managing the execution order and required threads of different tasks according to the actual processing situation during the processing, in order to ensure that different tasks can be effectively processed at the same time.

[0032] In this embodiment, data processing refers to performing business analysis and corresponding diagnosis assistance on corresponding tasks according to the assigned threads.

[0033] In this embodiment, releasing the lock means releasing the resources required by the current task after the current task is executed, so as to facilitate the execution of other tasks that need the current resources.

[0034] In this embodiment, the tasks to be processed refer to other tasks in the task queue that need to be processed.

[0035] 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, and avoid conflicts in the access of different tasks to 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 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 auxiliary diagnosis of pathological specimens.

[0036] Embodiment 2: Based on Example 1, this embodiment provides a pathological specimen auxiliary diagnosis system based on multi-thread control and task scheduling, and a 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 the timeout time of the distributed lock based on the allowable task time; The distributed lock configuration unit is used to perform timeout configuration on the distributed lock based on the timeout period, and at the same time, obtain the processing strategy after the timeout based on the management terminal, and configure the workflow of the distributed lock based on the processing strategy to obtain the final distributed lock.

[0037] 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.

[0038] 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.

[0039] 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.

[0040] 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 timed out based on the timeout time and the workflow of the distributed lock is configured based on the processing strategy, thereby effectively obtaining 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.

[0041] Embodiment 3: Based on Example 1, this example provides a pathological specimen auxiliary diagnosis system based on multi-thread control and task scheduling, such as Figure 3 As shown, the distributed lock management module includes: The request monitoring unit is used to build a monitoring mechanism based on the system operation requirements, and monitor the data status of the request access interface in real time based on the monitoring mechanism to obtain a state sequence of the request access interface, and 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 result; Traverse the access data of the target resource, and determine the current access status of the target resource based on the traversal result, and when no object accesses the target resource, determine that the required resource is not locked; The task initiation unit is used to initiate a request for allocating a lock for the current task based on the determination result, and to lock the required resources, and to call the required resources based on the locking result to perform a process response to the task initiation request.

[0042] In this embodiment, the monitoring mechanism refers to a tool that is determined according to a pre-set system operation requirement to monitor the data status of the access request interface.

[0043] In this embodiment, the data status of the requesting access interface may be a working status and a busy status of the requesting access interface.

[0044] In this embodiment, the state sequence of requesting access to the interface refers to a sequence set obtained by recording the state of requesting access to the interface in real time according to a preset time interval.

[0045] 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 at adjacent moments is found, 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.

[0046] Embodiment 4: Based on Example 3, this embodiment provides a pathological specimen auxiliary diagnosis system based on multi-thread control and task scheduling, and the request parsing unit includes: The result calling 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 for: 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 result, 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 result, 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.

[0047] In this embodiment, the specific timestamp indicates the starting time point corresponding to the specific task initiation request.

[0048] The working principle and beneficial effects of the above technical solution are: by determining the access status of the target resource, it is effectively determined whether the resource is locked, and when the resource is locked, the time attribute of the task initiation request is extracted and the specific timestamp is determined, and then the task initiation request is sorted according to the waiting queue obtained in the background 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 then the response time of each task initiation request is determined and marked; it can finely handle task initiation requests under resource locking, and 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.

[0049] Embodiment 5: Based on Example 1, this embodiment provides a pathological specimen auxiliary diagnosis system based on multi-thread control and task scheduling, and a scheduled task scheduling module, including: An interval determination unit, used to determine a scanning frequency of the task queue based on management requirements, and to determine a time interval for 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 a result of the time trigger parameter adaptation; Performing a periodic scan on the task queue based on the trigger instruction, and identifying the pending tasks in the task queue at each scan based on the periodic scan result, and obtaining the periodic tasks and the delayed tasks 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.

[0050] In this embodiment, the management requirement is set in advance and is used to represent the scanning frequency of the task queue.

[0051] In this embodiment, the preset trigger is a tool or device that is set in advance and is used to generate a trigger signal.

[0052] 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.

[0053] In this embodiment, periodically generating a trigger instruction refers to controlling the generation of an instruction by a preset trigger according to a time trigger parameter adaptation result, and the purpose is to periodically scan the task queue.

[0054] 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 periodic 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, thereby ensuring the efficiency of the execution of pathological specimen auxiliary diagnosis tasks.

[0055] Embodiment 6: Based on Example 5, this embodiment provides a pathological specimen auxiliary diagnosis system based on multi-thread control and task scheduling, and a scanning unit includes: The task attribute definition subunit is used to obtain the pathological specimen auxiliary diagnosis system, analyze the pathological 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 attribute of each task, and the task attribute of each task is 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.

[0056] In this embodiment, the pathological specimen auxiliary diagnosis system is known in advance and is used to characterize all knowledge and parameters related to the pathological specimen auxiliary diagnosis.

[0057] 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, which are tasks that need to be performed periodically.

[0058] In this embodiment, the delayed task indicator refers to an indicator parameter that can characterize the current task as a delayed task, for example, it may be a processing time parameter. When the processing time parameter exceeds a certain threshold, it is a delayed task.

[0059] In this embodiment, the task attribute refers to parameter information that can characterize each task type or requirement.

[0060] 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.

[0061] Embodiment 7: Based on Example 1, this embodiment provides a pathological specimen auxiliary diagnosis system based on multi-thread control and task scheduling, and a multi-thread task execution module, including: 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 standards and corresponding impact weights, the urgency of each periodic task and delayed task is evaluated respectively, and based on the positive correlation between the urgency and the priority mechanism, the periodic tasks and delayed tasks are prioritized to obtain the execution order; Multithreaded task scheduling and control unit for: Based on the priority sorting results, the periodic tasks are set as main thread tasks, and the delayed tasks are set as background tasks. Threads are allocated to the main thread tasks and background tasks 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 the utilization characteristics, and limit the number of threads in the thread allocation result when the resource utilization is lower than a preset threshold; Based on the qualification result, the resource dependency characteristics of each periodic task and delayed task are determined according to the extraction result of the basic information, and the periodic tasks and 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 the multi-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.

[0062] In this embodiment, the basic information refers to the service type corresponding to the periodic task and the delayed task and the basic parameters included, such as the pathological type.

[0063] In this embodiment, the task factor refers to a parameter that can characterize the specific conditions of the periodic task and the delayed task, such as the task start time and the task deadline.

[0064] In this embodiment, the impact weight refers to the importance of each task factor when determining the urgency, and the larger the value, the more important it is.

[0065] 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.

[0066] In this embodiment, the main thread task refers to a task that needs to be executed in real time, that is, no task blocking can occur.

[0067] In this embodiment, the background task refers to a task that can be executed in the background.

[0068] In this embodiment, the utilization feature refers to the utilization of resources by each thread, and the purpose is to determine whether there is a waste of resources.

[0069] 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.

[0070] In this embodiment, the purpose of limiting the number of threads is to improve resource utilization.

[0071] In this embodiment, the resource dependency feature refers to the type and quantity of resources required when each periodic task and delayed task is executed.

[0072] 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 distinguished and sorted. 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, so as to ensure the reliability and stability of multi-threaded operation.

[0073] 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 the urgency and the 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, and the number of threads is limited when there is resource waste, 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, and greatly improving the efficiency of auxiliary diagnosis of pathological specimens.

[0074] Embodiment 8: Based on Example 7, this embodiment provides a pathological specimen auxiliary diagnosis system based on multi-thread control and task scheduling, and the data processing unit includes: 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 subunits 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 effect of a task does not meet the expected requirements, the abnormal task is locked, and the target resources corresponding to the abnormal task are locked synchronously; Reschedule resources and process threads for abnormal tasks based on the locking results 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.

[0075] In this embodiment, the address information refers to specific address parameters corresponding to each periodic task and delayed task, and the purpose is to track the processing status of each periodic task and delayed task.

[0076] In this embodiment, the execution parameter refers to the specific execution status of each periodic task and delayed task.

[0077] In this embodiment, the expected requirements are set in advance, for example, normal execution and the execution efficiency must meet a certain numerical requirement.

[0078] 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.

[0079] 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 performed 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.

[0080] Embodiment 9: Based on Example 1, this embodiment provides a pathological specimen auxiliary diagnosis system based on multi-thread control and task scheduling, and a cyclic operation management module, including: A 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.

[0081] 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, and 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.

[0082] Embodiment 10: Based on Example 9, this embodiment provides a pathological specimen auxiliary diagnosis system based on multi-thread control and task scheduling, and a release lock control unit includes: The result reading subunit is used to read the target processing results of the periodic task and the delayed task, 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-realized condition, it is determined that the data processing process for 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.

[0083] 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.

[0084] 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.

[0085] 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.

[0086] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A pathological 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 the task of auxiliary diagnosis of pathological specimens, and uses the distributed lock to determine the running status of the resources required for the task based on the task initiation request, and when the required resources are not locked, allocates the lock and starts the task execution; The scheduled task scheduling module is used to periodically scan the task queue based on the startup results, and allocate the periodic tasks and delayed tasks in the task queue to the thread pool based on the scanning results; A multi-threaded task execution module, used for performing multi-threaded task scheduling and control on periodic tasks and delayed tasks according to a priority mechanism based on the allocation result, and performing data processing on 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.

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 the timeout time of the distributed lock based on the allowable task time; The distributed lock configuration unit is used to perform timeout configuration on the distributed lock based on the timeout period, and at the same time, obtain the processing strategy after the timeout based on the management terminal, and configure 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: The request monitoring unit is used to build a monitoring mechanism based on the system operation requirements, and monitor the data status of the request access interface in real time based on the monitoring mechanism to obtain a state sequence of the request access interface, and 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 result; Traverse the access data of the target resource, and determine the current access status of the target resource based on the traversal result, and when no object accesses the target resource, determine that the required resource is not locked; The task initiation unit is used to initiate a request for the current task to allocate a lock based on the determination result, and to lock the required resources, and to 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 calling 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 for: Extracting a time attribute of the task initiation request based on the determination result, and determining a 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 result, 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 result, 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. A pathological specimen auxiliary diagnosis system based on multi-thread control and task scheduling according to claim 1, characterized in that: Scheduled task scheduling module, including: An interval determination unit, used to determine a scanning frequency of the task queue based on management requirements, and to determine a time interval for 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 a result of the time trigger parameter adaptation; Performing a periodic scan on the task queue based on the trigger instruction, and identifying the pending tasks in the task queue at each scan based on the periodic scan result, and obtaining the periodic tasks and the delayed tasks 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 pathological specimen auxiliary diagnosis system based on multi-thread control and task scheduling according to claim 5, characterized in that: Scanning unit, comprising: The task attribute definition subunit is used to obtain the pathological specimen auxiliary diagnosis system, analyze the pathological 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 attribute of each task, and the task attribute of each task is 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. The pathological specimen auxiliary diagnosis system based on multi-thread control and task scheduling according to claim 1 is characterized in that: Multi-threaded task execution module, including: 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 standards and corresponding impact weights, the urgency of each periodic task and delayed task is evaluated respectively, and based on the positive correlation between the urgency and the priority mechanism, the periodic tasks and delayed tasks are prioritized to obtain the execution order; Multithreaded task scheduling and control unit for: Based on the priority sorting results, the periodic tasks are set as main thread tasks, and the delayed tasks are set as background tasks. Threads are allocated to the main thread tasks and background tasks 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 the utilization characteristics, and limit the number of threads in the thread allocation result when the resource utilization is lower than a preset threshold; Based on the qualification result, the resource dependency characteristics of each periodic task and delayed task are determined according to the extraction result of the basic information, and the periodic tasks and 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 the multi-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.

8. A pathological specimen auxiliary diagnosis system based on multi-thread control and task scheduling according to claim 7, 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 subunits 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 effect of a task does not meet the expected requirements, the abnormal task is locked, and the target resources corresponding to the abnormal task are locked synchronously; Reschedule resources and process threads for abnormal tasks based on the locking results 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.

9. 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: A 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.

10. A pathological specimen auxiliary diagnosis system based on multi-thread control and task scheduling according to claim 9, characterized in that: Release lock control unit, including: The result reading subunit is used to read the target processing results of the periodic task and the delayed task, 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-realized condition, it is determined that the data processing process for 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

  • Thread execution method and device based on distributed lock, and storage medium

    CN111259030A

  • Task scheduling system and method, equipment and storage medium

    CN112181621A

  • Market task processing method and device, computer equipment and readable storage medium

    CN115878338A

  • Super-concurrent data real-time processing method

    CN118093137A

  • Business processing method and device, electronic equipment and computer readable storage medium

    CN118277109A

Cited By

  • Scanner control device and scanner

    CN121409137A

  • Partition parallel collaborative labeling method and device for full-section pathological image and storage medium

    CN122387699A

  • Methods, equipment, and storage media for partitioned parallel collaborative annotation of whole-section pathological images

    CN122387699B