Control method of blood purification apparatus, blood purification apparatus, and storage medium
Patent Information
- Application Number
- CN202310175839.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-24
- Publication Date
- 2026-09-08
- Estimated Expiration
- 2043-02-24
AI Technical Summary
一旦数据处理性能超出CPU的正常数据处理范围,CPU对数据处理不过来而导致CPU出现死锁现象,导致血液净化治疗参数无法写入数据库中,从而降低患者的血液净化治疗安全性
[0010] This application provides a control method for a blood purification device, the blood purification device itself, and a storage medium. A processor integrates a first thread and a second thread pool, and a database is stored in the memory. The first thread is controlled to collect blood purification treatment parameters from the blood purification device according to a first instruction and send these parameters to the second thread pool. The second thread in the second thread pool, when active, is controlled to write the blood purification treatment parameters into the database according to a second instruction. When it is detected that the time taken for the active second thread to execute the second instruction exceeds a preset maximum blocking time, the number of first instructions executed by the first thread per unit time is set to a preset minimum. Since the detection that the time taken for the active second thread to execute the second instruction exceeds the preset maximum blocking time indicates a significant decrease in the processor's data processing performance, the processor is unable to handle the workload, which could lead to the loss of blood purification treatment parameters. Quickly and reasonably setting the number of first instructions executed by the first thread per unit time to the preset minimum can prevent severe congestion of blood purification treatment parameters in the second thread pool, ensuring that the second thread can continuously write the blood purification treatment parameters into the database, ensuring the normal progress of the patient's blood purification treatment process, reducing the failure rate during blood purification treatment, and improving the safety of the patient's blood purification treatment.
Smart Images

Figure CN116360938B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of blood purification technology, and in particular to a purification method, blood purification equipment, and storage medium for a blood purification device. Background Technology
[0002] Blood purification equipment generates treatment parameters during operation. These parameters are crucial for ensuring the safety of the equipment and the proper functioning of the patient's treatment. It is essential to write as many parameters as possible into the database. However, the CPU (Central Processing Unit) of the blood purification equipment integrates numerous running programs, consuming significant data processing resources. If the data processing capacity exceeds the CPU's normal processing range, a deadlock may occur, preventing the treatment parameters from being written to the database and thus reducing the safety of the patient's treatment. Summary of the Invention
[0003] Based on this, this application provides a control method for a blood purification device, a blood purification device, and a storage medium, which can prevent the processor from becoming overwhelmed by data processing and thus prevent blood purification treatment parameters from being written into the database, thereby improving the safety of blood purification treatment for patients.
[0004] In a first aspect, this application provides a control method for a blood purification device, the blood purification device comprising: a processor and a memory, wherein the processor integrates a first thread and a second thread pool, and the memory stores a database; the method includes:
[0005] The first thread is controlled to collect the blood purification treatment parameters of the blood purification device according to the first instruction, and the blood purification treatment parameters are sent to the second thread pool;
[0006] The second thread in the second thread pool, which is in an active state, is controlled to write the blood purification treatment parameters into the database according to the second instruction.
[0007] When it is detected that the time taken for the second thread in the active state to execute the second instruction is greater than the preset maximum blocking time, the number of first instructions executed by the first thread per unit time is set to the preset minimum number.
[0008] Secondly, this application provides a blood purification device, which includes a processor and a memory. The processor integrates a first thread and a second thread pool, and the memory stores a database. The memory is also used to store a computer program, and the processor is used to execute the computer program and, when executing the computer program, implement the control method of the blood purification device as described above.
[0009] Thirdly, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to implement the control method for the blood purification device as described above.
[0010] This application provides a control method for a blood purification device, the blood purification device itself, and a storage medium. A processor integrates a first thread and a second thread pool, and a database is stored in the memory. The first thread is controlled to collect blood purification treatment parameters from the blood purification device according to a first instruction and send these parameters to the second thread pool. The second thread in the second thread pool, when active, is controlled to write the blood purification treatment parameters into the database according to a second instruction. When it is detected that the time taken for the active second thread to execute the second instruction exceeds a preset maximum blocking time, the number of first instructions executed by the first thread per unit time is set to a preset minimum. Since the detection that the time taken for the active second thread to execute the second instruction exceeds the preset maximum blocking time indicates a significant decrease in the processor's data processing performance, the processor is unable to handle the workload, which could lead to the loss of blood purification treatment parameters. Quickly and reasonably setting the number of first instructions executed by the first thread per unit time to the preset minimum can prevent severe congestion of blood purification treatment parameters in the second thread pool, ensuring that the second thread can continuously write the blood purification treatment parameters into the database, ensuring the normal progress of the patient's blood purification treatment process, reducing the failure rate during blood purification treatment, and improving the safety of the patient's blood purification treatment.
[0011] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0012] Figure 1 This is a schematic diagram of the overall structure of an embodiment of a blood purification device;
[0013] Figure 2 This is a schematic flowchart of an embodiment of the control method for the blood purification device of this application;
[0014] Figure 3This is a schematic diagram showing the change curve of the number of first instructions executed by the first thread per unit time in one embodiment of the control method of the blood purification device of this application;
[0015] Figure 4 This is a schematic diagram of the fluctuation curve of the blood pump speed in one embodiment of the control method of the blood purification device of this application;
[0016] Figure 5 This is a schematic diagram of the pipeline principle corresponding to the hemodialysis treatment mode in one embodiment of the control method of the blood purification equipment of this application;
[0017] Figure 6 This is a schematic diagram of the structure of an embodiment of the blood purification device of this application. Detailed Implementation
[0018] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0019] The flowchart shown in the attached diagram is for illustrative purposes only and does not necessarily include all content and operations / steps, nor does it necessarily have to be performed in the order described. For example, some operations / steps can be broken down, combined, or partially merged, so the actual execution order may change depending on the actual situation.
[0020] Blood purification equipment is a type of embedded medical device. Its working principle is as follows: blood is drawn from the patient's body and passed through a blood purifier to remove certain pathogenic substances. The purified blood is then returned to the patient to achieve the goal of purifying the blood and treating diseases. Blood purification equipment can implement various blood purification treatment modes, such as hemodialysis, hemofiltration, hemoperfusion, plasma exchange, and immunoadsorption. After years of clinical validation, the blood purification treatments provided by this equipment are widely used in the treatment of critical illnesses such as kidney failure, liver failure, multiple organ failure, severe trauma, pancreatitis, infection, and poisoning. Currently, blood purification equipment has become an essential medical device in large and medium-sized hospitals.
[0021] To illustrate blood purification equipment more intuitively, Figure 1The diagram illustrates the overall structure of a blood purification device, which enables real-time control of the patient's blood purification treatment status. The device includes modules such as a CPU (Central Processing Unit) and memory, each performing different functions; the CPU acts as the "brain" of the device. During operation, the blood purification device generates various treatment parameters. These parameters are crucial for ensuring the safe operation of the device and the proper functioning of the patient's treatment. Therefore, it is essential to store as many blood purification parameters as possible in a database to maintain operational safety.
[0022] Since blood purification equipment is also an electronic device, its internal CPU runs various programs and needs to process various types of blood purification treatment parameters in real time to monitor the patient's blood purification treatment status and provide feedback and adjustments to the equipment's operation. Current CPUs use multi-threaded programming, which allows the CPU to process multiple instructions in parallel, with multiple threads containing multiple instructions. This multi-threaded approach requires the CPU to execute more instructions per unit time, increasing CPU utilization and the amount of data occupied. When the CPU's data processing performance exceeds its normal range, it becomes overwhelmed and shuts down, resulting in the loss of processed blood purification treatment parameters and a deadlock. Unlike ordinary office electronic devices, which can be restarted without significant damage, blood purification equipment is a medical device with higher safety standards. A deadlock during blood purification treatment can interrupt the patient's process, jeopardizing the safety of the treatment.
[0023] It should be noted that some technical terms mentioned in this article are explained here:
[0024] A thread is the smallest unit of computation that an operating system can schedule. It is a single, sequential flow of control. Threads can run concurrently, and different threads have different priorities. At any given time, a thread can only send one instruction.
[0025] CPU utilization: The CPU resources used by instructions running on all threads. Threads are also divided into running and non-running states. Only threads in the running state will use CPU resources. Generally, the more threads that run, and the more instructions each thread runs, the longer it takes for a thread to execute a single instruction task, the higher the CPU utilization will be.
[0026] To address the aforementioned issues, this application provides a control method for a blood purification device, the blood purification device itself, and a storage medium. The processor integrates a first thread and a second thread pool, and the memory stores a database. The method involves controlling the first thread to collect blood purification treatment parameters from the blood purification device according to a first instruction and sending these parameters to the second thread pool. The method also involves controlling the second thread in the second thread pool, which is in an active state, to write the blood purification treatment parameters into the database according to a second instruction. When it is detected that the time taken for the active second thread to execute the second instruction exceeds a preset maximum blocking time, the number of first instructions executed by the first thread per unit time is set to a preset minimum number. When the execution time of the second instruction by the active second thread exceeds the preset maximum blocking time, it indicates a significant decrease in the processor's data processing performance, meaning the processor cannot keep up. This situation will likely lead to the loss of blood purification treatment parameters. Therefore, quickly and appropriately setting the number of first instructions executed by the first thread per unit time to the preset minimum number can prevent severe blocking of blood purification treatment parameters in the second thread pool. This ensures that the second thread can continuously write blood purification treatment parameters into the database, ensuring the normal progress of the patient's blood purification treatment process, reducing the failure rate during blood purification treatment, and improving the safety of the patient's blood purification treatment.
[0027] The control method of the blood purification device according to the embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0028] See Figure 2 , Figure 2 This is a flowchart illustrating an embodiment of the control method for a blood purification device according to this application. The blood purification device includes a processor and a memory, wherein the processor may be a microcontroller unit, a central processing unit (CPU), or a digital signal processor, etc. The processor integrates a first thread and a second thread pool. The second thread pool stores multiple second threads, some of which are active and some are inactive. When a second thread is active, it executes relevant instructions. The memory stores a database. The method includes:
[0029] Step S101: Control the first thread to collect the blood purification treatment parameters of the blood purification device according to the first instruction, and send the blood purification treatment parameters to the second thread pool.
[0030] When a blood purification device performs blood purification treatment on a patient, it generates different types of blood purification treatment parameters, such as the speed of the blood pump, the speed of the dialysis pump, the speed of the infusion pump, and the fluid level in the venous chamber. The first thread can collect the blood purification treatment parameters generated during the blood purification treatment and send them to the second thread pool so that the second thread in the second thread pool can process the blood purification treatment parameters.
[0031] Step S102: Control the second thread in the second thread pool that is in an active state to write the blood purification treatment parameters into the database according to the second instruction.
[0032] The second thread pool accumulates various blood purification treatment parameters. The more frequently the first thread sends blood purification treatment parameters to the second thread pool, the greater the number of various blood purification treatment parameters accumulated in the second thread pool. This results in the second thread in the second thread pool executing more second instructions. The second thread writes the blood purification treatment parameters into the database, which stores various blood purification treatment parameters generated by the blood purification device.
[0033] Step S103: When it is detected that the time taken for the second thread in the active state to execute the second instruction is greater than the preset maximum blocking time, the number of first instructions executed by the first thread per unit time is set to the preset minimum number.
[0034] The preset maximum blocking time can refer to the maximum time taken for the second thread to execute the second instruction. When the time taken for the second thread to execute the second instruction in the active state is equal to the preset maximum blocking time, the blood purification device will not stop or crash. When the time taken for the second thread to execute the second instruction in the active state is greater than the preset maximum blocking time, the blood purification device will stop or crash. The preset maximum blocking time can be a value obtained after multiple technical experiments. For example, in one embodiment, the preset maximum blocking time can be 500ms.
[0035] The time taken for the second thread to execute the second instruction can refer to the time consumed by the second thread to execute a single second instruction, such as the time it takes for the second thread to write one byte of blood purification treatment parameters into the database. The time taken for the active second thread to execute the second instruction can refer to the time taken for an active second thread to execute a single second instruction; for example, the time taken for an active second thread to execute the second instruction is 300ms. If the time taken for an active second thread to execute the second instruction is greater than 300ms, it indicates that the second thread's execution time is too long, the processor's data processing performance is too low, and too many processor resources are being consumed. In this case, data loss may occur when the processor writes the blood purification treatment parameters into the database, or even a processor deadlock may occur, forcing the blood purification equipment to stop operating.
[0036] When it is detected that the execution time of the second instruction by the active second thread exceeds the preset maximum blocking time, the number of first instructions executed by the first thread per unit time is forcibly set to the preset minimum number, such as 1, 2, etc. At this time, the amount of data transmitted by the second thread for blood purification treatment parameters will also decrease, which can alleviate the blocking queue of blood purification treatment parameters in the second thread pool. The active second thread in the second thread pool can write blood purification treatment parameters to the database at a normal rate, and the processor's data processing performance can remain within the normal data processing range. Although the processor's program processing speed will be slower, this ensures that the processor will not deadlock, and the patient's blood purification treatment status can be maintained in a normal state.
[0037] It's important to note that since a thread can only send one instruction at a time, a shorter interval between instructions sent by a thread means that the thread sends more instructions. For example, if the first thread sends instructions at an interval of only 10ms, the second thread in the second thread pool will send more instructions per unit time, consuming more processor resources. When the time taken for the active second thread to execute the second instruction exceeds the preset maximum blocking time, the number of first instructions sent by the first thread per unit time needs to be forcibly set to the preset minimum (e.g., 1). This reduces the efficiency of the first thread in executing the first instruction per unit time, gradually decreasing the blood purification treatment parameters in the second thread pool. This reduces the number of second instructions executed by the second thread, thus reducing the execution time and freeing up processor resources, preventing processor deadlock.
[0038] In this embodiment of the application, when it is detected that the time taken for the second thread in the active state to execute the second instruction is greater than the preset maximum blocking time, it indicates that the processor's data processing performance has exceeded its limit. At this time, the number of first instructions executed by the first thread per unit time is immediately reduced to the preset minimum number (e.g., 1 instruction). This ensures that the time taken for the second thread to execute the second instruction is within a safe range, preventing the processor from being unable to process the blood purification treatment parameters and preventing the processor from deadlocking. This ensures the continuity of blood purification treatment in the blood purification device, avoids abnormal shutdown of the blood purification device due to deadlock, and improves the operational safety of the blood purification device.
[0039] In some embodiments, the method further includes steps S104, S105, and S106.
[0040] Step S104: When it is detected that the time taken for the second thread in the active state to execute the second instruction is less than or equal to the first preset value, the first thread is controlled to increase the number of first instructions executed per unit time according to the exponential function law.
[0041] Step S105: When it is detected that the time taken for the second thread in the active state to execute the second instruction is greater than the first preset value and less than or equal to the second preset value, the first thread is controlled to increase the number of first instructions executed per unit time according to a linear function.
[0042] Step S106: When it is detected that the time taken for the second thread in the active state to execute the second instruction is greater than the second preset value and less than or equal to the preset maximum blocking time, the first thread is controlled to keep the number of first instructions executed per unit time constant.
[0043] In this embodiment of the application, the maximum blocking time is preset > the second preset value > the first preset value.
[0044] The execution time of the second thread for the second instruction reflects the processor's data processing performance. When the execution time of the second thread for the second instruction is very short, the processor has many idle resources, and the program processing speed on the processor is very fast. In this case, it is necessary to increase the number of threads executing the second instruction in the second thread pool to avoid wasting the processor's idle resources; for example... Figure 3As shown, when the execution time of the second instruction by the second thread in the active state is less than or equal to the first preset value (the height of the left vertical line in the figure represents the size of the first preset value), the execution rate of the second instruction by the second thread is very high, and the processor still has a lot of idle resources. At this time, it is necessary to control the number of first instructions executed by the first thread per unit time to increase exponentially, so as to increase the number of blood purification treatment parameters in the second thread pool, increase the number of second instructions executed by the second thread, and improve the database write efficiency. For example, the exponential function is: the number of first instructions executed by the first thread per unit time = 2^x (where x is the time of blood purification treatment). The reason for choosing the exponential function is that the exponential function increases rapidly, which allows the number of first instructions executed by the first thread per unit time to increase quickly.
[0045] When the time taken for the second thread in the active state to execute the second instruction is greater than the first preset value and less than or equal to the second preset value (the height of the right vertical line in the diagram represents the size of the second preset value), it indicates that the processor still has remaining idle resources. Therefore, the number of first instructions executed by the first thread per unit time is increased according to a linear function. The number of second instructions executed by the active thread in the second thread pool will also increase slowly, and the data write rate in the database will also increase slowly. For example, the linear function can be: the number of first instructions executed by the first thread per unit time = x + m (where x represents the time of blood purification treatment, and m can represent "the number of first instructions executed by the first thread per unit time when the time taken for the active thread to execute the second instruction is equal to the first preset value"). The reason for choosing a linear function is that the degree of change of a linear function is relatively stable, and the number of second instructions executed by the active thread in the second thread pool will not increase too quickly or too slowly.
[0046] When the time taken for the second thread in the active state to execute the second instruction is greater than the second preset value, and less than or equal to the preset maximum blocking time (the distance between the dashed line and the horizontal axis in the figure represents the size of the preset maximum blocking time), the optimal number of second threads in the active state in the second thread pool to execute the second instruction is reached. This keeps the number of first instructions executed by the first thread per unit time constant, and keeps the time taken for the second thread in the active state in the second thread pool to execute the second instruction stable. This ensures that the blood purification device can write data efficiently, without device deadlock or wasting processor resources.
[0047] It should be noted that in S106, the number of first instructions executed by the first thread per unit time is kept constant. Under normal circumstances and without interference, the time taken for the second thread to execute the second instruction in the active state will not exceed the preset maximum blocking time. However, because the blood purification device may perform other operations (such as copying data from inside the blood purification device), these suddenly added operations will consume processor resources, and the time taken for the second thread to execute the second instruction will suddenly increase. At this time, the situation will occur where "the time taken for the second thread to execute the second instruction is greater than the preset maximum blocking time". In this case, in order to ensure that the database read and write operations can be carried out smoothly, the number of first instructions executed by the first thread per unit time must be reduced to the preset minimum number.
[0048] In some embodiments, the method further includes steps S107, S108, and S109.
[0049] Step S107: When it is detected that the time taken for the second thread in the active state to execute the second instruction is less than or equal to the first preset value, the blood purification device is controlled to issue a first prompt message.
[0050] Step S108: When it is detected that the time taken for the second thread in the active state to execute the second instruction is greater than the first preset value and less than or equal to the second preset value, the blood purification device is controlled to issue a second prompt message.
[0051] Step S109: When it is detected that the time taken for the second thread in the active state to execute the second instruction is greater than the second preset value and less than or equal to the preset maximum blocking time, the blood purification device is controlled to issue a third prompt message.
[0052] Specifically, the first prompt can be a first audio-visual prompt (e.g., a red light source), the second prompt can be a second audio-visual prompt (e.g., a blue light source), and the third prompt can be a third audio-visual prompt (e.g., a yellow light source). When users see different prompts, they can know the processor's resource utilization stage and whether the database write efficiency of the blood purification device is in a normal state, which facilitates safer control of the blood purification device.
[0053] In some embodiments, the processor further integrates a third thread, and the method further includes steps S110 and S111.
[0054] Step S110: When the blood purification device issues a first prompt message, the third thread is activated.
[0055] Step S111: When the third thread is activated, it reads the blood purification treatment parameters stored in the database and sends the blood purification treatment parameters to the cloud server.
[0056] Specifically, when the blood purification device issues the first prompt message, the second thread executes the second instruction very efficiently, and the writing efficiency of blood purification treatment parameters to the database is also very high. This indicates that there is a relatively large amount of idle processor resources. In this case, activating the third thread would consume processor resources. Therefore, the third thread is only activated when the processor has relatively idle resources. In this case, it will not cause a sharp drop in the processor's data processing performance. However, if the third thread is activated when the blood purification device issues the second or third prompt message, it will occupy the remaining idle resources of the processor. This may exceed the processor's safe data processing range, thereby causing a delay in the execution of the second instruction by the second thread. The execution of the second instruction by the second thread may be severely blocked, and conflicts may occur between database writing and reading. In this embodiment, activating the third thread when the blood purification device issues the first prompt message can precisely avoid this conflict phenomenon.
[0057] When the third thread is active, it sends the blood purification treatment parameters to the cloud server. The cloud server can store the blood purification treatment parameters in real time. Users can remotely call the blood purification treatment parameters stored on the cloud server, and then perform in-depth processing and analysis on the blood purification treatment parameters, which can improve the ease of control and the scope of application of the blood purification equipment.
[0058] In some embodiments, the method further includes steps S112, S113, and S114.
[0059] Step S112: When the blood purification device enters the operating state, the utilization rate of the processor is detected.
[0060] Step S113: Calculate the preset number of threads based on the processor utilization rate.
[0061] Specifically, when a blood purification device is in operation, it performs blood purification treatment on the patient. This requires the processor to process the blood purification treatment parameters in real time to ensure the safety of the treatment. The processor's utilization rate can be detected using various methods, such as through the operating system interface on the processor. Processor utilization is a readily available value; for example, computers have built-in processor utilization calculation tools. Therefore, detecting processor utilization is a very common method, and will not be discussed in detail here.
[0062] Because it is difficult to accurately calculate the instruction execution time and waiting time of each thread during actual program execution, the relationship between thread and processor utilization is difficult to represent with a specific formula.
[0063] In some embodiments, the relationship between thread and processor utilization can be referenced using the following formula, expressed as follows:
[0064] Processor utilization = Number of threads / (Number of processor cores * (1 + (wait time / computation time)))
[0065] The formula for calculating the relationship between threads and processor utilization shown here is only a theoretical formula, representing the maximum ideal state of the number of threads under processor utilization. Using this formula as a preset formula for calculating the number of threads is also only an ideal calculation formula.
[0066] The formula for calculating the preset number of threads was derived after numerous technical experiments. In some embodiments, the formula for calculating the preset number of threads can be: Preset number of threads = [(100 - utilization rate * 100) / 10]. Wherein, [(100 - utilization rate * 100) / 10] represents rounding (100 - utilization rate * 100) / 10 to the nearest integer.
[0067] For example, if the processor utilization rate is 60%, the preset number of threads is calculated as follows:
[0068] Preset number of threads = [(100 - utilization rate * 100) / 10] = [(100 - 0.6 * 100) / 10] = 4.
[0069] The preset number of threads represents the maximum safe number of active second threads in the second thread pool under a specific processor utilization rate. Only when the number of active second threads in the second thread pool is less than the preset number of threads will the time taken for the active second threads in the second thread pool to execute the second instruction not be too long, and the execution rate of the second instruction will be in a normal running state.
[0070] Step S114: When the number of second threads in the active state is less than the preset number of threads, and the time taken for the second threads in the active state to execute the second instruction is greater than the preset maximum blocking time, the number of second threads in the active state in the second thread pool is increased.
[0071] At this time, step S103, when it is detected that the time taken for the second thread in the active state to execute the second instruction is greater than the preset maximum blocking time, setting the number of first instructions executed by the first thread in a unit time to a preset minimum number, may further include: when it is detected that the number of second threads in the active state is greater than or equal to the preset number of threads, and when it is detected that the time taken for the second thread in the active state to execute the second instruction is greater than the preset maximum blocking time, setting the number of first instructions executed by the first thread in a unit time to a preset minimum number.
[0072] The number of active second threads and the number of inactive second threads in the second thread pool are counted. When the number of active second threads is greater than or equal to the preset number of threads, the execution time of the active second threads executing the second instruction is measured. Only when the execution time of the active second threads executing the second instruction is greater than the preset maximum blocking time is the number of first instructions executed by the first thread per unit time set to a preset minimum number (e.g., 1 instruction). When the number of active second threads is less than the preset number of threads, the execution time of the active second threads executing the second instruction is measured. Only when the execution time of the active second threads executing the second instruction is greater than the preset maximum blocking time is the number of active second threads in the second thread pool increased.
[0073] The second threads in the second thread pool are divided into active and inactive states. Only when a second thread is active will it write the blood purification treatment parameters to the database. For example, if there are 4 second threads in the second thread pool, 2 of them are active and the other 2 are inactive. Furthermore, each active second thread can execute multiple second instructions.
[0074] If the number of active second threads is less than the preset number of threads, it means that the number of active second threads in the second thread pool can be increased. By increasing the number of active second threads, the execution time of the active second threads for executing the second instruction will be less than the preset maximum blocking time, and the processor's data processing performance will be maintained in a normal state.
[0075] If the number of active second threads is greater than or equal to the preset number of threads, it means that the number of active second threads in the second thread pool is already greater than or equal to the maximum safe number. At this point, the number of active second threads cannot be increased to maintain the execution time of the second instructions. If the execution time of the active second threads is detected to be greater than the preset maximum blocking time, the number of active second threads cannot be increased. Instead, the number of first instructions executed by the first thread per unit time is set to the preset minimum number (e.g., 1 instruction). This reduces the number of second instructions executed by active second threads per unit time, thereby reducing the execution time of active second threads in the second thread pool. The processor's data processing performance can be maintained within a normal range, preventing too much blocked data (i.e., blood purification treatment parameters) in the second thread pool, which could overwhelm the processor.
[0076] Therefore, when it is detected that the time taken for the second thread in the active state to execute the second instruction is greater than the preset maximum blocking time, the first step is to increase the number of second threads in the active state in the second thread pool. Only when the number of second threads in the active state in the second thread pool can no longer be increased will the number of first instructions executed by the first thread per unit time be forcibly set to the preset minimum number (e.g., 1). This ensures that the time taken for the second thread in the active state to execute the second instruction is not too long and also improves the database write efficiency of the blood purification device.
[0077] In some embodiments, the method further includes step S115.
[0078] Step S115: When it is detected that the time taken for the second thread in the active state to execute the second instruction is greater than the preset maximum blocking time, and when it is detected that the number of first instructions executed by the first thread in a unit time is less than the first preset number, a processor fault indication message is issued, wherein the first preset number is less than or equal to the preset minimum number of instructions.
[0079] Since the first preset quantity is less than or equal to the preset minimum number of instructions, when the number of first instructions executed in the first thread per unit time is less than the first preset quantity, it indicates that the number of blood purification treatment parameters sent by the first thread per unit time is too small, and the number of blood purification treatment parameters received by the second thread pool is too small. In this case, if the time taken for the second thread in the active state to execute the second instruction is greater than the preset maximum blocking time, it indicates that the efficiency of the second thread in executing the second instruction is too low, the data processing performance of the processor is too low, and the processor itself is faulty. For example, damage to the internal circuit structure of the processor can lead to low data processing performance. At this time, by issuing a fault indication message to the processor, relevant prompts can be sent to the user. The user can see / hear the fault indication message and know that the processor is faulty, so that the processor can be dealt with in time to prevent the processor from being in a faulty running state for a long time.
[0080] It should be noted that "in the first thread within a unit time period..." and "in the second thread within a unit time period...", the "unit time period" mentioned here can refer to 1ms, 10ms, 100ms, 1s, or 10s, etc. Those skilled in the art can set the unit time period according to actual needs, and there is no limitation on it.
[0081] For example, fault indication information can be light or sound. Fault indication information can clearly prompt users and improve the operational safety of the processor.
[0082] It should be noted that the first preset quantity can be an empirical value obtained by those skilled in the art through multiple technical experiments, such as the first preset quantity being 1.
[0083] In some embodiments, the method further includes steps S116, S117, S118, and S119.
[0084] Step S116: When a fault is detected in the blood purification device, the blood purification device is controlled to enter a fault maintenance state, so that each drive module on the blood purification device is in a stopped state.
[0085] Specifically, blood purification equipment has an automatic fault detection function. For example, when the blood purification equipment detects abnormal blood flow rate or air bubbles in the blood in the tubing, it indicates that the blood purification equipment has a fault and will issue relevant fault indication information, such as processor fault indication information.
[0086] When a blood purification device enters a maintenance / troubleshooting state, blood purification treatment must be stopped, and each drive module is in a stopped state to facilitate user maintenance of the device. It should be noted that drive modules on a blood purification device refer to components that provide driving force, components with detection functions, or various catheters, such as blood pumps, heparin pumps, dialysis pumps, leak detectors, air bubble detectors, arterial tubing, and venous tubing.
[0087] Step S117: Extract the blood purification treatment parameters stored in the database.
[0088] Step S118: After analyzing the blood purification treatment parameters, a test parameter set for each drive module is obtained.
[0089] Step S119: Debug the corresponding driver module individually according to the test parameter set to obtain the debugging result of the driver module.
[0090] The test parameter set is used to perform performance tests on the corresponding driver modules. The driver modules are controlled to operate according to the test parameter set to obtain their actual operating performance, thereby yielding the debugging results. For example, the debugging results include whether the driver module has malfunctioned, and if so, the specific cause of the malfunction. Therefore, this embodiment utilizes blood purification treatment parameters stored in a database to debug and repair the fault status of blood purification equipment. Users can quickly identify which driver module is malfunctioning and debug it, simplifying the troubleshooting steps for blood purification equipment and improving the efficiency of fault detection and repair.
[0091] Further, step S119, after individually debugging the corresponding drive module according to the test parameter set to obtain the debugging result of the drive module, may also include: controlling the blood purification device to display the debugging result of the drive module. Users can view the debugging result of the drive module at any time, providing practical reference for troubleshooting the blood purification device.
[0092] It should be noted that in S116, each drive module is in a stopped state during fault repair. In S118 and S119, each drive module needs to be started individually and controlled to operate according to the corresponding test parameter set in order to test the performance of each drive module individually.
[0093] In some embodiments, step S118, which involves analyzing the blood purification treatment parameters to obtain a set of test parameters for each drive module, may further include sub-steps S1181, S1182, and S1183.
[0094] Sub-step S1181: Divide the blood purification treatment parameters into attributes to obtain the functional dataset of each driving module.
[0095] Sub-step S1182: Determine several feature points between the maximum and minimum values in the functional dataset of each driving module.
[0096] Sub-step S1183: Form a test parameter set for each driver module by combining all feature points of each driver module.
[0097] Specifically, blood purification treatment parameters can reflect the operational characteristics of different drive modules. Based on the functional information of these parameters, their attributes can be categorized, and data of the same type reflecting the drive module can be grouped into a functional dataset. For example, some blood purification treatment parameters can reflect the blood pump's rotational speed; therefore, all such data needs to be assigned to the blood pump rotational speed functional dataset. Then, several feature points are identified between the maximum and minimum values of the blood pump rotational speed data, and these feature points are all assigned to the blood pump rotational speed test parameter set. The blood pump is then individually debugged according to the test parameter set to obtain the blood pump rotational speed debugging result. The functional dataset can reflect all operational information of the drive module. By selecting several feature points on the functional dataset and controlling the drive module to operate sequentially according to these feature points, the drive module can be individually debugged, simplifying the individual debugging steps.
[0098] In some embodiments, step S119, which involves individually debugging the corresponding driver module according to the test parameter set, may further include sub-steps S1191 and S1192.
[0099] Sub-step S1191: Generate test driver ciphertext based on the test parameter set of the driver module.
[0100] Sub-step S1192: Activate the driver module according to the test driver ciphertext, drive the corresponding driver module according to the test parameter set, and detect the operating status fed back by the corresponding driver module.
[0101] Specifically, the test driver ciphertext is the startup instruction of the driver module. Since all driver modules are in a stopped state during fault repair, the test parameter set needs to be analyzed to obtain the test driver ciphertext. The driver modules are then activated according to the test driver ciphertext, enabling them to operate according to the test parameter set. The operating status feedback from the corresponding driver module is used to determine whether the driver module has a running fault, thereby completing the individual debugging process of the driver module.
[0102] It should be noted that there is a one-to-one correspondence between the test driver ciphertext and the driver module. Only one driver module can be activated through a test driver ciphertext. This helps to debug the driver module individually, ensures the accuracy of the debugging results, and avoids the accidental activation of other driver modules. The test driver ciphertext is equivalent to a specific start command for the driver module in a fault repair state. The start command allows the blood purification device to enter the driver module's debugging interface from a stopped state, and the individual debugging function of the driver module can be completed without restarting the blood purification device.
[0103] For example, test driver ciphertext is generated based on the test parameter set of the driver module. There are multiple methods for generating this ciphertext; only one is listed here. For instance, the test parameter set of the driver module includes: btnliqiudlevelup, 10r / min, 5ml / h, check. All strings in the test parameter set are concatenated to obtain ciphertext A, which is: btnliqiudlevelup10r / min5ml / hcheck. Ciphertext A is then processed using a character scrambling algorithm (e.g., adding invalid characters for character obfuscation to prevent brute-force attacks) to generate ciphertext B, for example: btn / hh5#mqli$iul / lvee! 1luprmd^inc(ce0k; The ciphertext B is padded with the authorization expiration date character to generate ciphertext C. For example, if the authorization expiration date is January 3, 2025, then ciphertext C is: 20250103btn / hh5#mqli$iul / lvee!1luprmd^inc(ce0k). Ciphertext C is the test driver ciphertext for one of the driver modules. The test driver ciphertext is only used to start the corresponding driver module in a fault repair state and to debug the driver module individually. This allows each driver module to be debugged individually without starting the blood purification equipment, making the individual debugging process of the driver module safer and more convenient.
[0104] In some embodiments, the method further includes steps S120 and S121.
[0105] Step S120: After extracting the blood purification treatment parameters stored in the database, plot the curves of the blood purification treatment parameters over time.
[0106] Step S121: Perform data prediction on the change curve of the blood purification treatment parameters over time to obtain the future blood purification treatment parameters of the blood purification device.
[0107] Specifically, after the blood purification equipment has been running for a period of time, a certain amount of blood purification treatment parameters will be stored in the database. These stored blood purification treatment parameters can reflect the historical operating information of the blood purification equipment. By plotting the change curves of blood purification treatment parameters over time, the historical operating status of the blood purification equipment can be obtained. Based on the change curves of blood purification treatment parameters over time, the operating fluctuation status of the blood purification equipment in the past period can be determined. Furthermore, intelligent algorithms can be used to predict the data of the change curves of blood purification treatment parameters over time to predict the future blood purification treatment parameters of the blood purification equipment. Based on the future blood purification treatment parameters, the operating status of the blood purification equipment in the future period can be obtained, and it can be determined whether the blood purification equipment will experience operational failures in the future period.
[0108] For example, blood purification treatment parameters include: the blood pump speed; the blood pump speed is written to a database within the previous hour; after retrieving the blood pump speed stored in the database, a curve showing the change of blood pump speed over time is plotted, such as... Figure 4 As shown, according to Figure 4 It can detect the fluctuations in the blood pump's rotation speed over the past hour; and using a neural network model in related technologies, the blood pump's rotation speed is used as the input value. After multiple training and learning cycles, the output value of the neural network model is used as the future rotation speed of the blood pump in the blood purification equipment. Based on the future rotation speed of the blood pump, the future operating trend of the blood pump can be determined, and it can be determined whether the blood pump's rotation speed is likely to be too fast or too slow in the future.
[0109] To better illustrate the specific implementation methods of the above-mentioned debugging in the embodiments of this application, the relevant content is explained below through a specific application scenario; various blood purification treatment modes can be realized through blood purification equipment. Taking the hemodialysis treatment mode realized by blood purification equipment as an example, Figure 5The diagram illustrates the tubing principle corresponding to the hemodialysis treatment mode. The blood purification equipment includes components such as a blood pump, a level detector, a dialysis pump, a blood leak detector, a heparin pump, and a bubble detector. When the blood purification equipment runs continuously for one hour, it provides blood purification treatment to the patient. If the equipment suddenly issues a fault indication, it indicates a malfunction. The driving module of the blood purification equipment includes: a blood pump, a level detector for the venous reservoir (used to detect the fluid level in the venous reservoir), a dialysis pump, a blood leak detector, a heparin pump, and a bubble detector (used to detect the presence of air bubbles in the blood within the venous tubing). The blood purification treatment parameters stored in the database are shown in Table 1 below.
[0110] Table 1
[0111]
[0112] As shown in Table 1 above, blood purification treatment parameters can be divided into 6 attributes. Among them, the blood pump speed reflects the operating status of the blood pump, and the blood flow status of the blood circuit can be obtained based on the blood pump speed; the fluid level of the venous reservoir is used to determine whether the blood level stored in the venous reservoir is in a faulty state; the dialysis pump speed reflects the operating status of the dialysis pump, and the dialysate flow status of the dialysis tubing can be obtained based on the dialysis pump speed; the detection value of the blood leakage detector reflects the blood volume in the dialysis tubing; the anticoagulant flow rate output by the heparin pump reflects the flow rate of anticoagulant connected to the blood circuit; and the detection value of the bubble detector reflects the bubble content of the blood in the venous tubing.
[0113] By dividing the data in Table 1 into attribute categories, we can obtain the functional dataset for each drive module. For example, the functional dataset for the blood pump's rotational speed is: 9.0, 9.3, 9.2, 9.6, 9.2, 9.8, 9.9, 10.0, 10.1, 10.3. In this dataset, the maximum value is 10.3, and the minimum value is 9.2. Several feature points are identified between the maximum and minimum values. These feature points typically reflect the actual operating state of the blood pump. For example, the selected feature points are: 9.2 (minimum value), 9.475 (1 / 4 node value), 9.75 (midpoint), 10.025 (3 / 4 node value), and 10.3 (maximum value). These five feature points constitute the measurement data for the blood pump's rotational speed. The system generates a test driver ciphertext for the blood pump based on a set of test parameters for the pump's rotational speed. This ciphertext activates the blood pump, controlling it to operate according to each data point in the test parameter set. The system then monitors the pump's operational status, which includes blood flow in the arterial tubing controlled by the pump and its output voltage. This feedback helps determine if the blood pump is malfunctioning. For example, if abnormal speed control is detected, the system indicates an abnormality. The blood purification equipment displays this result, allowing users to immediately understand and address any abnormalities, preventing prolonged malfunctions.
[0114] Similarly, following the above method, the liquid level detector, dialysis pump, blood leakage detector, heparin pump, and bubble detector of the venous chamber were individually debugged in sequence, and the debugging results of each drive module were obtained and displayed.
[0115] See Figure 6 , Figure 6 This is a schematic diagram of a blood purification device according to an embodiment of the present application. It should be noted that the blood purification device of the present application embodiment can realize the control method of the above-mentioned blood purification device. For detailed description of the relevant content, please refer to the above-mentioned method section, which will not be repeated here.
[0116] The blood purification device 100 includes a processor 2 and a memory 1. The processor 2 integrates a first thread and a second thread pool, and the memory 1 stores a database. The memory 1 is also used to store a computer program. The processor 2 is used to execute the computer program and, when executing the computer program, implements the control method of the blood purification device as described above.
[0117] The processor 2 can be a microcontroller unit, a central processing unit, or a digital signal processor, etc. The memory 1 can be a flash chip, a read-only memory, a hard disk, an optical disk, a USB flash drive, or a portable hard drive, etc.
[0118] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to implement the control method for the blood purification device as described above. For detailed descriptions of the related content, please refer to the relevant content regarding the control method for the blood purification device described above; further details will not be repeated here.
[0119] The computer-readable storage medium can be an internal storage unit of the aforementioned blood purification device, such as a hard drive or memory. Alternatively, it can be an external storage device, such as an external hard drive, smart memory card, secure digital card, flash memory card, etc.
[0120] It should be understood that the terminology used in this application specification is for the purpose of describing particular embodiments only and is not intended to limit the application.
[0121] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0122] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and such modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A control method for a blood purification device, characterized in that, The blood purification device includes a processor and a memory, wherein the processor integrates a first thread and a second thread pool, and the memory stores a database; the method includes: When the blood purification device is in operation, the utilization rate of the processor is detected; The preset number of threads is calculated based on the processor utilization rate. The first thread is controlled to collect the blood purification treatment parameters of the blood purification device according to the first instruction, and the blood purification treatment parameters are sent to the second thread pool; The second thread in the second thread pool, which is in an active state, is controlled to write the blood purification treatment parameters into the database according to the second instruction. When the number of active second threads is greater than or equal to the preset number of threads, and the time taken for the active second thread to execute the second instruction is greater than the preset maximum blocking time, the number of first instructions executed by the first thread per unit time is set to the preset minimum number.
2. The method according to claim 1, characterized in that, The method further includes: When it is detected that the time taken for the second thread in the active state to execute the second instruction is less than or equal to the first preset value, the first thread is controlled to increase the number of first instructions executed per unit time according to an exponential function. When it is detected that the time taken for the second thread in the active state to execute the second instruction is greater than the first preset value and less than or equal to the second preset value, the first thread is controlled to increase the number of first instructions executed per unit time according to a linear function. When it is detected that the time taken for the second thread in the active state to execute the second instruction is greater than the second preset value, but less than or equal to the preset maximum blocking time, the first thread is controlled to keep the number of first instructions executed per unit time constant.
3. The method according to claim 1, characterized in that, The processor also integrates a third thread, and the method further includes: When the time taken for the second thread in the active state to execute the second instruction is less than or equal to the first preset value, the blood purification device is controlled to issue a first prompt message. When it is detected that the time taken for the second thread in the active state to execute the second instruction is greater than the first preset value and less than or equal to the second preset value, the blood purification device is controlled to issue a second prompt message. When it is detected that the time taken for the second thread in the active state to execute the second instruction is greater than the second preset value, but less than or equal to the preset maximum blocking time, the blood purification device is controlled to issue a third prompt message; The method further includes: When the blood purification device issues a first prompt message, the third thread is activated; When the third thread is activated, it reads the blood purification treatment parameters stored in the database and sends the blood purification treatment parameters to the cloud server.
4. The method according to claim 1, characterized in that, The method further includes: When the number of active second threads is less than the preset number of threads, and the time taken for an active second thread to execute the second instruction is greater than the preset maximum blocking time, the number of active second threads in the second thread pool is increased.
5. The method according to claim 1, characterized in that, The method further includes: When it is detected that the time taken for the second thread in the active state to execute the second instruction is greater than the preset maximum blocking time, and when it is detected that the number of first instructions executed by the first thread per unit time is less than the first preset number, a processor fault indication message is issued, wherein the first preset number is less than or equal to the preset minimum number of instructions.
6. The method according to claim 1, characterized in that, The method further includes: When a fault is detected in the blood purification equipment, the blood purification equipment is controlled to enter a fault maintenance state, so that each drive module on the blood purification equipment is in a stopped state. Extract the blood purification treatment parameters stored in the database; After analyzing the blood purification treatment parameters, a set of test parameters for each drive module is obtained; The corresponding driver module is individually debugged according to the test parameter set to obtain the debugging result of the driver module.
7. The method according to claim 6, characterized in that, After analyzing the blood purification treatment parameters, a set of test parameters for each drive module is obtained, including: The blood purification treatment parameters are divided by attributes to obtain the functional dataset of each driver module; Several feature points are determined between the maximum and minimum values in the functional dataset of each driving module; All feature points of each driver module are used to form the test parameter set for each driver module.
8. The method according to claim 6, characterized in that, The step of individually debugging the corresponding driver module according to the test parameter set includes: Generate test driver ciphertext based on the test parameter set of the driver module; The driver module is activated according to the test driver ciphertext, and the corresponding driver module is driven according to the test parameter set to detect the operating status fed back by the corresponding driver module.
9. A blood purification device, characterized in that, The blood purification device includes a processor and a memory. The processor integrates a first thread and a second thread pool, and the memory stores a database. The memory is also used to store a computer program. The processor is used to execute the computer program and, when executing the computer program, implement the control method of the blood purification device as described in any one of claims 1-8.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, causes the processor to implement the control method of the blood purification device as described in any one of claims 1-8.
Citation Information
Patent Citations
Batch processing method and device for business data and computer equipment
CN114237505A