Disclosure of Invention
The embodiment of the application provides a monitoring method of communication connection, a medical system and a storage medium, which can monitor whether the communication connection between an upper computer and a lower computer is normal or not in real time when the medical system works, and the technical scheme is as follows:
In a first aspect, a method for monitoring communication connection is provided, where the method is applied to a host computer, and the method includes: after the upper computer and the lower computer are in communication connection, the heartbeat numbers are written into the lower computer periodically, and the heartbeat numbers written into the lower computer each time are different; if the upper computer fails to write the heartbeat number into the lower computer at least once, determining that the communication connection between the upper computer and the lower computer is abnormal; the heartbeat number is used for being periodically read by the lower computer, so that the lower computer can determine that the communication connection between the lower computer and the upper computer is abnormal after the same heartbeat number is continuously read for a plurality of times.
Optionally, the method further comprises: and after the heartbeat number is written into the lower computer each time, receiving a feedback identification sent by the lower computer, wherein the feedback identification is used for indicating whether the upper computer successfully writes the heartbeat number into the lower computer.
Optionally, the method further comprises: if the feedback identification is determined to be an identification for indicating that the upper computer writes the heartbeat number into the lower computer successfully, the upper computer and the lower computer are determined to be normally connected in communication.
Optionally, the method further comprises: if the feedback identification is determined to be an identification for indicating that the upper computer fails to write the heartbeat number into the lower computer, determining that the writing of the heartbeat number into the lower computer fails.
Optionally, the method further comprises: before each writing of heartbeat numbers into the lower computer, checking whether communication connection is successfully established with the lower computer; if the successful establishment of communication connection with the lower computer is detected, executing the operation of writing the heartbeat number into the lower computer; if the fact that communication connection is not established with the lower computer is detected, determining that the writing of the heartbeat number to the lower computer fails.
Optionally, the upper computer is in communication connection with the lower computer through a middleware, and after writing the heartbeat number into the lower computer each time, receives a feedback identifier sent by the lower computer, including: after the upper computer writes the heartbeat number into the lower computer through the middleware each time, receiving a feedback identifier sent by the middleware, wherein the middleware is used for generating the feedback identifier after writing the heartbeat number into the lower computer each time; the checking whether the communication connection with the lower computer is successfully established comprises the following steps: and checking whether communication connection is successfully established with the lower computer through the middleware.
Optionally, if the writing of the heartbeat number to the lower computer by the upper computer at least once fails, determining that the communication connection between the upper computer and the lower computer is abnormal includes: if the upper computer fails to write the heartbeat number into the lower computer for a plurality of times, determining that the communication connection between the upper computer and the lower computer is abnormal.
Optionally, the method further comprises: and outputting prompt information after determining that the communication connection between the upper computer and the lower computer is abnormal.
Optionally, the writing the heartbeat number to the lower computer periodically includes: and periodically writing heartbeat numbers into a controller of the lower computer.
Optionally, the heartbeat digits written into the lower computer by the upper computer periodically are arranged in an arithmetic series or an arithmetic series.
Optionally, the period duration of writing the heartbeat number into the lower computer by the upper computer is smaller than or equal to the period duration of reading the heartbeat number by the lower computer.
In a second aspect, a method for monitoring a communication connection is provided, where the method is applied to a lower computer, and the method includes: after the lower computer and the upper computer are in communication connection, periodically reading the heartbeat numbers written by the upper computer, wherein the heartbeat numbers are periodically written by the upper computer, and the heartbeat numbers written by the upper computer to the lower computer are different each time; if the heartbeat numbers read by the lower computer at least twice continuously are the same, determining that the communication connection between the upper computer and the lower computer is abnormal.
Optionally, the method further comprises: if the current read heartbeat number of the lower computer is different from the last read heartbeat number, the communication connection between the lower computer and the upper computer is determined to be normal.
Optionally, if the heartbeat numbers read by the lower computer at least twice in succession are the same, determining that the communication connection between the upper computer and the lower computer is abnormal includes: if the current read heartbeat number of the lower computer is the same as the last read heartbeat number, continuing to read at least one heartbeat number, and when the read heartbeat number of each time is the same as the last read heartbeat number, determining that the communication connection between the upper computer and the lower computer is abnormal.
Optionally, the periodically reading the heartbeat number written by the upper computer includes: and periodically reading the heartbeat numbers written by the upper computer from the controller of the lower computer.
Optionally, the method further comprises: after the communication connection between the upper computer and the lower computer is abnormal, controlling the radiotherapy equipment to send out an alarm signal, and controlling the radiotherapy equipment to stop working.
In a third aspect, a medical system is provided, the medical system comprising: the upper computer and the lower computer; the upper computer includes: a first processor and a first memory for storing executable instructions of the first processor, wherein the first processor is configured to perform the method of monitoring a communication connection provided in the first aspect above; the lower computer includes: a second processor and a second memory for storing executable instructions of the second processor, wherein the second processor is configured to perform the method of monitoring a communication connection provided in the second aspect described above.
Optionally, the medical system further comprises: the radiotherapy equipment is provided with an alarm buzzer; the lower computer is configured to: and after determining that the communication connection between the upper computer and the lower computer is abnormal, controlling the alarm buzzer to send alarm audio.
Optionally, the radiotherapy device further comprises an operation panel; the lower computer is configured to: and after determining that the communication connection between the upper computer and the lower computer is abnormal, controlling the fault alarm lamp in the operation panel to be lightened.
In a fourth aspect, a computer readable storage medium is provided, characterized in that the computer readable storage medium has instructions stored therein, which when run on a processing component causes the processing component to perform the method of monitoring a communication connection according to any of the first or second aspects.
The technical scheme provided by the embodiment of the application has the beneficial effects that at least:
The upper computer can periodically write the heartbeat number into the lower computer, and after the upper computer fails to write the heartbeat number into the lower computer at least once, the upper computer can determine that the communication connection between the upper computer and the lower computer is abnormal. Because the heartbeat numbers written into the lower computer by the upper computer are different every time, the lower computer can periodically read the heartbeat numbers written into the upper computer, and after the same heartbeat numbers are read at least twice, the lower computer can determine that the communication connection between the lower computer and the upper computer is abnormal. Therefore, the monitoring method of the communication connection can ensure that when the medical system works, the upper computer can monitor whether the communication connection between the upper computer and the lower computer is normal or not in real time, and the lower computer can monitor whether the communication connection between the lower computer and the upper computer is normal or not in real time, so that the safety of diagnosing or treating a patient by adopting the medical system is higher.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the embodiments of the present application will be described in further detail with reference to the accompanying drawings.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a medical system related to a communication connection monitoring method according to an embodiment of the present application. The medical system 100 may include: an upper computer 101 and a lower computer 102. The upper computer 101 and the lower computer 102 may be connected in communication.
In an embodiment of the present application, the medical system 100 may further include: and a radiotherapy device 103 connected with the lower computer 102. Wherein the radiotherapy apparatus 103 may comprise: gamma knife or executive accelerator.
For example, the upper computer 101 may be a computer that directly transmits a control command, and for example, the upper computer 101 may be a desktop computer or a notebook computer. The lower computer 102 generally refers to a computer that directly controls the operation state of the radiotherapy apparatus, and for example, the lower computer 102 may be a motion control component of the radiotherapy apparatus. In this manner, the lower computer 102 may control the movement of the couch and/or the rotating gantry in the radiotherapy apparatus.
The upper computer 101 is provided with upper computer software, and the lower computer 102 is provided with lower computer software. The upper computer 101 may send control commands to the lower computer 102 through the upper computer software. The lower computer 102 can control the operation state of the radiotherapy equipment 103 through the lower computer software after receiving the control command, so that the radiotherapy equipment 103 can diagnose or treat the patient.
In the present application, the upper computer 101 may be communicatively connected to the lower computer 102 through middleware. The middleware refers to software that connects two independent applications (i.e., upper computer software and lower computer software).
Referring to fig. 2, fig. 2 is a flowchart of a method for monitoring communication connection according to an embodiment of the present application. The monitoring method of the communication connection is applied to the upper computer 101 in the treatment system 100 shown in fig. 1. The monitoring method of the communication connection comprises the following steps:
Step 201, after the upper computer is in communication connection with the lower computer, the heartbeat numbers are written into the lower computer periodically, and the heartbeat numbers written into the lower computer each time are different.
Step 202, if the upper computer fails to write the number into the lower computer at least once, determining that the communication connection between the upper computer and the lower computer is abnormal.
The heartbeat number is used for being periodically read by the lower computer, so that the lower computer can determine that the communication connection between the lower computer and the upper computer is abnormal after the same heartbeat number is continuously read for a plurality of times.
In summary, according to the method for monitoring communication connection provided by the embodiment of the application, the upper computer can periodically write the heartbeat number into the lower computer, and after the upper computer fails to write the heartbeat number into the lower computer at least once, the upper computer can determine that the communication connection between the upper computer and the lower computer is abnormal. Because the heartbeat numbers written into the lower computer by the upper computer are different every time, the lower computer can periodically read the heartbeat numbers written into the upper computer, and after the same heartbeat numbers are read at least twice, the lower computer can determine that the communication connection between the lower computer and the upper computer is abnormal. Therefore, the monitoring method of the communication connection can ensure that when the medical system works, the upper computer can monitor whether the communication connection between the upper computer and the lower computer is normal or not in real time, and the lower computer can monitor whether the communication connection between the lower computer and the upper computer is normal or not in real time, so that the safety of diagnosing or treating a patient by adopting the medical system is higher.
Referring to fig. 3, fig. 3 is a flowchart of another method for monitoring communication connection according to an embodiment of the present application. The monitoring method of the communication connection is applied to the lower computer 102 in the treatment system 100 shown in fig. 1. The monitoring method of the communication connection comprises the following steps:
Step 301, after the lower computer and the upper computer are in communication connection, periodically reading the heartbeat numbers written by the upper computer. The heartbeat numbers are written in periodically by the upper computer, and the heartbeat numbers written in by the upper computer to the lower computer are different each time.
Step 302, if the heartbeat numbers read by the lower computer at least twice are the same, determining that the communication connection between the upper computer and the lower computer is abnormal.
In summary, according to the method for monitoring communication connection provided by the embodiment of the application, the upper computer can periodically write the heartbeat number into the lower computer, and after the upper computer fails to write the heartbeat number into the lower computer at least once, the upper computer can determine that the communication connection between the upper computer and the lower computer is abnormal. Because the heartbeat numbers written into the lower computer by the upper computer are different every time, the lower computer can periodically read the heartbeat numbers written into the upper computer, and after the same heartbeat numbers are read at least twice, the lower computer can determine that the communication connection between the lower computer and the upper computer is abnormal. Therefore, the monitoring method of the communication connection can ensure that when the medical system works, the upper computer can monitor whether the communication connection between the upper computer and the lower computer is normal or not in real time, and the lower computer can monitor whether the communication connection between the lower computer and the upper computer is normal or not in real time, so that the safety of diagnosing or treating a patient by adopting the medical system is higher.
Referring to fig. 4, fig. 4 is a flowchart of a method for monitoring a communication connection according to another embodiment of the present application. The monitoring method of the communication connection is applied to the treatment system 100 shown in fig. 1. The monitoring method of the communication connection comprises the following steps:
step 401, after the upper computer and the lower computer are in communication connection, the upper computer periodically writes heartbeat numbers into the lower computer, and each time the heartbeat numbers written into the lower computer are different.
For example, the heartbeat numbers written into the lower computer by the upper computer periodically are arranged in an arithmetic series or an arithmetic series. For example, assuming that the heartbeat numbers written into the lower computer by the upper computer periodically form an arithmetic progression, the heartbeat numbers written into the lower computer by the upper computer periodically may be in turn: n, n+1, n+2, etc. Wherein n may be an integer greater than or equal to 0.
Optionally, the writing of the heartbeat number to the lower computer by the upper computer periodically includes: and the upper computer periodically writes heartbeat numbers into a controller in the lower computer. For example, the controller may be a Central Processing Unit (CPU), a Microprocessor (MPU), a Field Programmable Gate Array (FPGA), or the like.
For example, the controller has a memory address for storing the heartbeat number, and the host computer can write the heartbeat number into the memory address.
It should be noted that, only one heartbeat number is stored in the storage address, when the upper computer writes the heartbeat number into the storage address of the lower computer every time, the storage address erases the heartbeat number written by the upper computer last time, and stores the heartbeat number to be written by the upper computer this time.
In the embodiment of the present application, the method for monitoring communication connection may further include the steps of: after the upper computer writes the heartbeat number into the lower computer each time, the upper computer receives the feedback identification sent by the lower computer. The feedback mark is used for indicating whether the heartbeat number written by the upper computer to the lower computer is successful or not.
By way of example, the upper computer may be communicatively coupled to the lower computer via middleware. Thus, after the upper computer writes the heartbeat number into the lower computer each time, the upper computer receiving the feedback identifier sent by the lower computer may include: and after the upper computer writes the heartbeat number into the lower computer through the middleware each time, receiving a feedback identification sent by the middleware.
The middleware is used for generating a feedback identifier after writing the heartbeat number into the lower computer each time. The feedback mark is used for indicating whether the upper computer writes the heartbeat number into the lower computer successfully or not.
For example, the feedback identification may include: a write success identification or a write failure identification. When the lower computer is abnormal and cannot work, the middleware cannot write the heartbeat number into the lower computer, and at the moment, the middleware can generate a writing failure identifier and send the writing failure identifier to the upper computer so as to inform the upper computer that the writing of the heartbeat number into the lower computer fails; when the lower computer can normally work, the middleware can write the heartbeat number into the lower computer, at the moment, the middleware can generate a successful writing identification and send the successful writing identification to the upper computer so as to inform the upper computer that the heartbeat number is successfully written into the lower computer.
It should be noted that, the phenomenon that the lower computer is abnormal and cannot work generally means that: the lower computer is in abnormal phenomena such as downtime or jamming, at the moment, the upper computer cannot send a control command to the lower computer, and the communication connection between the upper computer and the lower computer is abnormal.
In the embodiment of the present application, the method for monitoring communication connection may further include the following steps:
and step A, before the upper computer writes the heartbeat number into the lower computer each time, the upper computer checks whether the communication connection with the lower computer is successfully established.
For example, the upper computer may check through the middleware whether the communication connection with the lower computer is successfully established. If the upper computer checks that communication connection is established with the lower computer through the middleware, executing the step B; and C, if the upper computer detects that communication connection is not established with the lower computer through the middleware, executing the step C.
And step B, if the upper computer checks that communication connection is established with the lower computer, executing the operation of writing the heartbeat number into the lower computer.
And step C, if the upper computer is not in communication connection with the lower computer, the upper computer determines that the upper computer is not in communication connection with the lower computer, and determines that the writing of the heartbeat number to the lower computer fails.
In the embodiment of the application, before the upper computer writes the heartbeat number into the lower computer each time, the upper computer needs to determine whether communication connection between the upper computer and the lower computer exists by taking the specified function in the middleware.
For example, if the upper computer invokes the specified function from the middleware, the upper computer can determine that the upper computer and the lower computer are successfully connected to establish communication, that is, the upper computer can determine that the upper computer and the lower computer are connected to each other, and then the upper computer can execute the operation of writing the heartbeat number into the lower computer; if the upper computer does not call the appointed function from the middleware, the upper computer can determine that the upper computer does not establish communication connection with the lower computer, that is, the upper computer can determine that the upper computer does not have communication connection with the lower computer, the upper computer does not execute the operation of writing the heartbeat number into the lower computer, and the upper computer can determine that the writing of the heartbeat number into the lower computer fails, and then the upper computer needs to repeatedly execute the operation of calling the appointed function from the middleware.
Step 402, after the upper computer writes the heartbeat number into the lower computer each time, the upper computer determines whether the heartbeat number is successfully written into the lower computer.
In the embodiment of the application, after the upper computer writes the heartbeat number into the lower computer each time, the upper computer can receive the feedback identification sent by the middleware and determine whether the heartbeat number is successfully written into the lower computer based on the feedback identification.
For example, after receiving the feedback identifier sent by the middleware, if the upper computer determines that the feedback identifier is an identifier for indicating that the upper computer writes the heartbeat number to the lower computer successfully, that is, the feedback identifier is a writing success identifier, the upper computer determines that the writing of the heartbeat number to the lower computer is successful, and then the following step 403 is executed; if the upper computer determines that the feedback identifier is an identifier for indicating that the upper computer fails to write the heartbeat number to the lower computer, that is, the feedback identifier is a writing failure identifier, the upper computer determines that the writing of the heartbeat number to the lower computer fails, and the upper computer may be in abnormal communication connection with the lower computer, so as to execute the following step 404.
And step 403, if the upper computer determines that the heartbeat number written into the lower computer is successful, the upper computer determines that the communication connection between the upper computer and the lower computer is normal.
For example, if the upper computer determines that the current writing of the heartbeat number to the lower computer is successful based on the feedback identifier sent by the middleware, for example, when the upper computer receives the writing success identifier sent by the middleware, the upper computer may determine that the current writing of the heartbeat number to the lower computer is successful. And the upper computer can determine that the communication connection between the upper computer and the lower computer is normal.
And 404, if the upper computer determines that the writing of the heartbeat number to the lower computer fails at least once, the upper computer determines that the communication connection between the upper computer and the lower computer is abnormal.
In a first possible implementation manner, as long as the upper computer determines that writing the heartbeat number to the lower computer fails once, the upper computer can determine that the communication connection between the upper computer and the lower computer is abnormal.
For example, if the upper computer determines that writing the heartbeat number to the lower computer fails based on the feedback identifier sent by the middleware, for example, when the upper computer receives the writing failure identifier sent by the middleware, the upper computer may determine that writing the heartbeat number to the lower computer fails. And the upper computer can determine that the communication connection between the upper computer and the lower computer is abnormal.
In a second possible implementation manner, the upper computer needs to determine that writing of the heartbeat number to the lower computer fails a plurality of times continuously, and the upper computer can determine that the communication connection between the upper computer and the lower computer is abnormal.
For example, according to the above embodiment, the upper computer determines that the writing of the heartbeat number to the lower computer fails in the following two cases:
in the first case, before the upper computer writes the heartbeat number into the lower computer every time, when the upper computer determines that the communication connection between the upper computer and the lower computer does not exist in a mode of calling the specified function in the middleware, the upper computer can determine that the writing of the heartbeat number into the lower computer fails.
In the second case, after the upper computer writes the heartbeat number into the lower computer each time, if the upper computer determines that the heartbeat number is failed to be written into the lower computer based on the feedback identifier sent by the middleware, for example, when the upper computer receives the writing failure identifier sent by the middleware, the upper computer can determine that the heartbeat number is failed to be written into the lower computer this time.
And combining the two cases, after determining that the writing of the heartbeat number to the lower computer fails, the upper computer can record the failure once. Therefore, the upper computer can determine whether the heartbeat number written into the lower computer by the upper computer is failed continuously for a plurality of times through the recorded continuous failure times, and determine that the passing connection between the upper computer and the lower computer is abnormal after the upper computer continuously determines that the heartbeat number written into the lower computer is failed for a plurality of times.
For example, if the upper computer determines to write the heartbeat number to the lower computer 3 times in succession, the upper computer may determine that the communication connection between the upper computer and the lower computer is abnormal.
Step 405, the upper computer outputs prompt information.
In the embodiment of the application, after the upper computer determines that the communication connection between the upper computer and the lower computer is abnormal, the upper computer can output prompt information.
For example, the prompt information may be a text message, and the upper computer may display the output prompt information on a display interface of the upper computer, so as to prompt the staff that the communication connection between the upper computer and the lower computer is abnormal.
Step 406, the lower computer periodically reads the heartbeat numbers written by the upper computer.
In the embodiment of the application, after the upper computer periodically writes the heartbeat number into the lower computer, the lower computer can periodically read the heartbeat number stored in the lower computer.
Optionally, because the upper computer can periodically write the heartbeat number into the controller in the lower computer, the lower computer periodically reads the heartbeat number written by the upper computer, including: the lower computer periodically reads the heartbeat numbers written by the upper computer from the controller of the lower computer.
In the application, the period duration of the heartbeat number written into the lower computer by the upper computer is smaller than or equal to the period duration of the heartbeat number read by the lower computer. That is, if the upper computer takes the first duration as the period, the heartbeat number is written into the lower computer periodically, and the lower computer takes the second duration as the period, and the heartbeat number is stored by the periodic reader, the first duration is smaller than or equal to the second duration. For example, the first duration may be 200 milliseconds and the second duration may be 2 seconds.
When the period duration of the heartbeat number written into the lower computer by the upper computer is smaller than or equal to the period duration of the heartbeat number read by the lower computer, the subsequent lower computer can determine whether the communication connection between the lower computer and the upper computer is normal or not through the read heartbeat number.
Step 407, after the lower computer reads the heartbeat number each time, the lower computer compares whether the heartbeat number read currently is the same as the heartbeat number read last time.
For example, if the lower computer determines that the current read heartbeat number is not the same as the last read heartbeat number, then step 408 is performed; if the lower computer determines that the current read heartbeat number is the same as the last read heartbeat number, the communication connection between the lower computer and the upper computer may be abnormal, and step 409 is executed.
Step 408, if the lower computer determines that the current read heartbeat number is different from the last read heartbeat number, the lower computer determines that the communication connection between the lower computer and the upper computer is normal.
In the embodiment of the application, the period duration of the upper computer writing the heartbeat number into the lower computer is smaller than or equal to the period duration of the lower computer reading the heartbeat number, and when the communication connection between the upper computer and the lower computer is normal, the upper computer can normally write the heartbeat number into the lower computer every time. Therefore, when the communication connection between the upper computer and the lower computer is normal, the heartbeat numbers read by the lower computer are different each time. Therefore, if the lower computer determines that the current read heartbeat number is different from the last read heartbeat number, the lower computer can determine that the communication connection between the lower computer and the upper computer is normal.
And 409, if the heartbeat numbers read by the lower computer at least twice continuously are the same, determining that the communication connection between the lower computer and the upper computer is abnormal by the lower computer.
In the first exemplary implementation manner, as long as the heartbeat numbers read by the lower computer are the same in two consecutive times, the lower computer can determine that the communication connection between the lower computer and the upper computer is abnormal.
For example, if the lower computer determines that the current read heartbeat number is the same as the last read heartbeat number, the lower computer determines that the communication connection between the lower computer and the upper computer is abnormal.
In a second exemplary implementation, the lower computer needs to determine that writing the heartbeat number to the lower computer fails multiple times (three times or more) in succession, and the lower computer can determine that the communication connection between the lower computer and the upper computer is abnormal.
If the lower computer determines that the current read heartbeat number is the same as the last read heartbeat number, at least one heartbeat number is continuously read, and when the heartbeat number read each time is the same as the last read heartbeat number, the lower computer determines that the communication connection between the lower computer and the upper computer is abnormal.
In the embodiment of the application, when the communication connection between the upper computer and the lower computer is abnormal, the upper computer can not write the new heartbeat number into the lower computer, and the lower computer always stores the heartbeat number which is written into the upper computer for the last time when the communication connection between the upper computer and the lower computer is normal. Therefore, when the communication connection between the upper computer and the lower computer is abnormal, the heartbeat numbers read by the lower computer are the same each time. Therefore, if the heartbeat numbers read by the lower computer for a plurality of times are the same, the lower computer can determine that the communication connection between the lower computer and the upper computer is abnormal.
For example, if the number of heartbeats read by the lower computer is the same for 3 consecutive times, the lower computer can determine that the communication connection between the lower computer and the upper computer is abnormal.
Step 410, the lower computer controls the radiotherapy equipment to send out an alarm signal and controls the radiotherapy equipment to stop working.
In the embodiment of the application, after the lower computer determines that the communication connection between the lower computer and the upper computer is abnormal, the lower computer can control the radiotherapy equipment to send out an alarm signal and control the radiotherapy equipment to stop working.
The example, radiotherapy equipment has warning buzzer and controls the panel, confirms its and the host computer between communication connection unusual back, this host computer can control the warning buzzer of radiotherapy equipment and send the warning audio frequency to the trouble alarm lamp of controlling the panel of radiotherapy equipment lights, with the communication connection unusual between to patient suggestion host computer and the host computer on staff and the radiotherapy equipment.
After the communication connection between the upper computer and the lower computer is abnormal, the lower computer stops working by controlling the radiotherapy equipment, so that the problem of medical accidents caused by uncontrolled continuous working of the radiotherapy equipment can be avoided.
In the related art, a method for communication connection between a host computer and a lower computer in a medical system is generally: the upper computer periodically transmits a heartbeat packet to the lower computer; and after receiving the heartbeat packet sent by the upper computer, the lower computer generates a heartbeat feedback packet based on the heartbeat packet every time and sends the heartbeat feedback packet to the upper computer. Therefore, after the lower computer does not receive the heartbeat packet sent by the upper computer for a period of time, the lower computer can determine that the communication connection between the lower computer and the upper computer is abnormal; after the upper computer does not receive the heartbeat feedback packet sent by the upper computer for a period of time, the upper computer determines that the communication connection between the upper computer and the lower computer is abnormal. However, by the detection mode of the communication connection, the lower computer needs to be guaranteed to generate the heartbeat feedback packet according to the received heartbeat packet in real time, so that the lower computer can occupy the calculation resources, the calculation resources which can be called when the lower computer controls the radiotherapy equipment are reduced, more data which need to be transmitted between the upper computer and the lower computer can be caused, and the efficiency of the communication connection between the upper computer and the lower computer is reduced.
In the embodiment of the application, the upper computer writes the heartbeat number into the lower computer periodically through the middleware, and the heartbeat number written in each time is different. The upper computer only needs a feedback identifier sent by the middleware and can determine whether the communication connection between the upper computer and the lower computer is normal or not; the lower computer can determine whether the communication connection between the lower computer and the upper computer is normal only by reading the heartbeat number stored in the lower computer. In the process, the upper computer only performs writing operation, the lower computer only performs reading operation, and the lower computer does not need to generate feedback information according to the heartbeat number and feed the feedback information back to the upper computer. Therefore, the communication connection monitoring method provided by the embodiment of the application does not occupy the computing resources of the lower computer, and can ensure higher communication connection efficiency between the upper computer and the lower computer.
It should be noted that, the sequence of the steps of the method for monitoring communication connection provided in the embodiment of the present application may be appropriately adjusted, the steps may also be increased or decreased according to the situation, and any method that is easily conceivable to be changed by those skilled in the art within the technical scope of the present application disclosed in the present application should be covered within the protection scope of the present application, so that the description is omitted.
In summary, according to the method for monitoring communication connection provided by the embodiment of the application, the upper computer can periodically write the heartbeat number into the lower computer, and after the upper computer fails to write the heartbeat number into the lower computer at least once, the upper computer can determine that the communication connection between the upper computer and the lower computer is abnormal. Because the heartbeat numbers written into the lower computer by the upper computer are different every time, the lower computer can periodically read the heartbeat numbers written into the upper computer, and after the same heartbeat numbers are read at least twice, the lower computer can determine that the communication connection between the lower computer and the upper computer is abnormal. Therefore, the monitoring method of the communication connection can ensure that when the medical system works, the upper computer can monitor whether the communication connection between the upper computer and the lower computer is normal or not in real time, and the lower computer can monitor whether the communication connection between the lower computer and the upper computer is normal or not in real time, so that the safety of diagnosing or treating a patient by adopting the medical system is higher.
Referring to fig. 5, fig. 5 is a block diagram of a communication connection monitoring device according to an embodiment of the present application. The communicatively connected monitoring device 500 may be integrated in the host computer 101 in the treatment system 100 shown in fig. 1. The communicatively connected monitoring device 500 may include:
The writing module 501 is configured to periodically write the heartbeat number into the lower computer after the upper computer and the lower computer are in communication connection, where the heartbeat number written into the lower computer is different each time.
The first determining module 502 is configured to determine that the communication connection between the upper computer and the lower computer is abnormal if the upper computer fails to write the heartbeat number to the lower computer at least once.
The heartbeat number is used for being periodically read by the lower computer, so that the lower computer can determine that the communication connection between the lower computer and the upper computer is abnormal after continuously reading the same heartbeat number for a plurality of times.
Optionally, as shown in fig. 5, the monitoring device 500 of the communication connection may further include:
And the receiving module 503 is configured to receive the feedback identifier sent by the lower computer after writing the heartbeat number to the lower computer each time. The feedback mark is used for indicating whether the upper computer writes the heartbeat number into the lower computer successfully or not.
Optionally, as shown in fig. 5, the monitoring device 500 of the communication connection may further include:
and the third determining module 504 is configured to determine that the communication connection between the upper computer and the lower computer is normal if it is determined that the feedback identifier is an identifier for indicating that the upper computer writes the heartbeat number to the lower computer successfully.
Optionally, as shown in fig. 5, the monitoring device 500 of the communication connection may further include:
And the fourth determining module 505 is configured to determine that writing the heartbeat number to the lower computer fails if it is determined that the feedback identifier is an identifier for instructing the upper computer to write the heartbeat number to the lower computer.
Optionally, the detecting device of the communication connection may further include:
the checking module is used for checking whether communication connection is successfully established with the lower computer before the heartbeat number is written into the lower computer each time; if the successful establishment of communication connection with the lower computer is detected, executing the operation of writing the heartbeat number into the lower computer; if the fact that communication connection is not established with the lower computer is detected, the fact that the heartbeat number is written into the lower computer at this time fails is determined.
Optionally, the upper computer is in communication connection with the lower computer through a middleware, and the receiving module 503 is configured to receive a feedback identifier sent by the middleware after the upper computer writes the heartbeat number into the lower computer through the middleware each time, where the middleware is configured to generate the feedback identifier after writing the heartbeat number into the lower computer each time;
optionally, the checking module is configured to check, through the middleware, whether the communication connection is successfully established with the lower computer.
Optionally, the first determining module 502 is configured to determine that the communication connection between the upper computer and the lower computer is abnormal if the upper computer fails to write the heartbeat number to the lower computer multiple times.
Optionally, as shown in fig. 5, the monitoring device 500 of the communication connection may further include:
and the output module 506 is configured to output a prompt message after determining that the communication connection between the upper computer and the lower computer is abnormal.
Optionally, the writing module 501 is configured to write the heartbeat number to the controller of the lower computer periodically.
Optionally, the heartbeat numbers written into the lower computer by the upper computer periodically are arranged in an arithmetic series or an arithmetic series.
Optionally, the period duration of the heartbeat number written into the lower computer by the upper computer is smaller than or equal to the period duration of the heartbeat number read by the lower computer.
In summary, in the monitoring device for communication connection provided in the embodiment of the present application, the upper computer can periodically write the heartbeat number into the lower computer, and after the upper computer fails to write the heartbeat number into the lower computer at least once, the upper computer can determine that the communication connection between the upper computer and the lower computer is abnormal. Because the heartbeat numbers written into the lower computer by the upper computer are different every time, the lower computer can periodically read the heartbeat numbers written into the upper computer, and after the same heartbeat numbers are read at least twice, the lower computer can determine that the communication connection between the lower computer and the upper computer is abnormal. Therefore, the monitoring method of the communication connection can ensure that when the medical system works, the upper computer can monitor whether the communication connection between the upper computer and the lower computer is normal or not in real time, and the lower computer can monitor whether the communication connection between the lower computer and the upper computer is normal or not in real time, so that the safety of diagnosing or treating a patient by adopting the medical system is higher.
Referring to fig. 6, fig. 6 is a block diagram illustrating another communication connection monitoring apparatus according to an embodiment of the present application. The communicatively connected monitoring device 600 may be integrated into the lower computer 102 in the treatment system 100 shown in fig. 1. The communicatively connected monitoring device 500 may include:
The reading module 601 is configured to periodically read the heartbeat number written in the upper computer after the lower computer and the upper computer are connected in a communication manner. The heartbeat numbers are written in periodically by the upper computer, and the heartbeat numbers written in by the upper computer to the lower computer are different each time.
The second determining module 602 is configured to determine that the communication connection between the upper computer and the lower computer is abnormal if the heartbeat numbers read by the lower computer at least twice in succession are the same.
Optionally, as shown in fig. 6, the monitoring device 600 of the communication connection may further include:
And a fifth determining module 603, configured to determine that the communication connection with the upper computer is normal if the current heartbeat number read by the lower computer is different from the last heartbeat number read by the upper computer.
Optionally, the second determining module 602 is configured to continuously read at least one heartbeat number if the current read heartbeat number of the lower computer is the same as the last read heartbeat number, and determine that the communication connection between the upper computer and the lower computer is abnormal when the heartbeat number read each time is the same as the last read heartbeat number.
Optionally, the reading module 601 is configured to periodically read the heartbeat number written by the upper computer from the controller of the lower computer.
Optionally, as shown in fig. 6, the monitoring device 600 of the communication connection may further include:
And the control module 604 is used for controlling the radiotherapy equipment to send out an alarm signal and controlling the radiotherapy equipment to stop working after determining that the communication connection between the upper computer and the lower computer is abnormal.
In summary, in the monitoring device for communication connection provided in the embodiment of the present application, the upper computer can periodically write the heartbeat number into the lower computer, and after the upper computer fails to write the heartbeat number into the lower computer at least once, the upper computer can determine that the communication connection between the upper computer and the lower computer is abnormal. Because the heartbeat numbers written into the lower computer by the upper computer are different every time, the lower computer can periodically read the heartbeat numbers written into the upper computer, and after the same heartbeat numbers are read at least twice, the lower computer can determine that the communication connection between the lower computer and the upper computer is abnormal. Therefore, the monitoring method of the communication connection can ensure that when the medical system works, the upper computer can monitor whether the communication connection between the upper computer and the lower computer is normal or not in real time, and the lower computer can monitor whether the communication connection between the lower computer and the upper computer is normal or not in real time, so that the safety of diagnosing or treating a patient by adopting the medical system is higher.
The embodiment of the application also provides a medical system, and the structure of the medical system can be referred to as fig. 1. The medical system 100 may include: an upper computer 101 and a lower computer 102. The communicatively connected monitoring device 500 shown in fig. 5 may be integrated in the host computer 101, and the communicatively connected monitoring device shown in fig. 6 may be integrated in the lower computer 102.
By way of example, the host computer may include: a first processor, and a first memory for storing executable instructions of the first processor. Wherein the first processor is configured to perform the method of monitoring the communication connection shown in fig. 2 or fig. 4.
The lower computer may include: a second processor, and a second memory for storing executable instructions of the second processor. Wherein the second processor is configured to perform the method of monitoring the communication connection shown in fig. 3 or fig. 4.
Optionally, the medical system further comprises: a radiotherapy apparatus having an alarm buzzer. The lower computer in the medical system is configured to: after the abnormal communication connection between the upper computer and the lower computer is determined, an alarm buzzer of the radiotherapy equipment is controlled to send out alarm audio.
Optionally, the radiotherapy apparatus further has an operation panel. The lower computer in the medical system is configured to: after determining that the communication connection between the upper computer and the lower computer is abnormal, the fault alarm lamp in the operation panel of the radiotherapy equipment is controlled to be lightened.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described system, apparatus and module may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
In practical applications, each module in this embodiment may be implemented by a Central Processing Unit (CPU), a Microprocessor (MPU), a Digital Signal Processor (DSP), or a Field Programmable Gate Array (FPGA), a modem, or other devices on the monitoring device that are in communication connection.
The embodiment of the application also provides a computer readable storage medium. The computer readable storage medium has instructions stored therein which, when executed on a processing component, cause the processing component to perform the method of monitoring a communication connection shown in fig. 2,3 or 4.
In the present disclosure, the terms "first" and "second" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. The term "plurality" refers to two or more, unless explicitly defined otherwise.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program for instructing relevant hardware, where the program may be stored in a computer readable storage medium, and the storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The foregoing description of the preferred embodiments of the present application is not intended to limit the application, but is intended to cover all modifications, equivalents, alternatives, and improvements falling within the spirit and principles of the application.