Intraocular and extraocular mode switching method and device for ophthalmologic operation, electronic equipment and storage medium

By adopting a multi-process method in the ophthalmic surgical control system, the hardware device control function is encapsulated into the kernel process, and the coupling problem between the UI interface and the hardware device in the existing technology is solved, seamless switching between the inside and outside of the eye mode is achieved, and the simplicity and maintenance of the code is improved.

CN119576462APending Publication Date: 2025-03-07GUANGZHOU WEIMOU MEDICAL INSTR CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411689385.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-25
Publication Date
2025-03-07

AI Technical Summary

Technical Problem

In the prior art, the UI interface class is mixed with the control hardware device class, resulting in high coupling and large code repetition rate, making it difficult to achieve seamless switching between the inside and outside of the eye modes of ophthalmic surgery.

Method used

The multi-process approach is adopted to encapsulate the functions that control the operation of hardware devices into the kernel process. There is no need to instantiate related classes in the front-end interface, reducing the number of classes that the front-end process depends on, thereby achieving seamless switching between inside and outside the eye modes.

Benefits of technology

By reducing the code complexity of the front-end UI interface, seamless switching between inside and outside the eye mode is achieved, improving the simplicity and maintenance of the code.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119576462A_ABST
    Figure CN119576462A_ABST
Patent Text Reader

Abstract

The invention provides an intraocular and extraocular mode switching method and device for an ophthalmologic operation, electronic equipment and a storage medium. The method comprises the steps that a kernel process obtains an event control command sent by a front-end process; switching a motion mode of the 3D mouse based on a control parameter corresponding to the event control command, performing real-time polling processing on a switched 3D mouse working thread, and determining a motion direction of a motor corresponding to the 3D mouse; wherein the motion mode comprises an intraocular mode or an extraocular mode; after the motion direction of the motor is determined, the target position of the motor is determined based on a kinematics algorithm corresponding to the event control command, the motor is controlled to move to the target position, and information that the motor completes motion is sent to a front-end process to be displayed. The number of classes on which the front-end process depends is reduced, so that codes of a front-end UI interface are simpler and clearer, and seamless switching between intra-ocular and extra-ocular modes is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of medical robot control technology, and in particular to a method, device, electronic device and storage medium for switching intraocular and extraocular modes of ophthalmic surgery. Background Art

[0002] The class that controls the UI interface directly depends on the class that controls the related hardware devices. When implementing related functions, it is necessary to first instantiate the related classes, and then call the methods of the related classes as required to execute. For example, in the implementation of this function, it is necessary to instantiate the task management queue, surgical function control, and drive motor classes. The classes of the UI interface are mixed with the classes that control the hardware devices, resulting in high coupling and high code duplication. If the movement mode needs to be changed or the related methods are changed, the code of all calling locations must be changed, making it difficult to perform subsequent maintenance and optimization of the code. Therefore, how to achieve seamless switching between intraocular and extraocular modes of ophthalmic surgery has become a technical issue that cannot be underestimated. Summary of the invention

[0003] In view of this, the purpose of the present application is to provide a method, device, electronic device and storage medium for switching between intraocular and extraocular modes of ophthalmic surgery, which uses a multi-process approach to encapsulate the functions of controlling the operation of hardware devices into the kernel process, and does not need to instantiate related classes in the front-end interface, thereby reducing the number of classes that the front-end process depends on and making the code of the front-end UI interface more concise and clear, thereby achieving seamless switching between intraocular and extraocular modes.

[0004] The present application embodiment provides a method for switching between intraocular and extraocular modes of ophthalmic surgery, the method comprising:

[0005] The kernel process obtains the event control command sent by the front-end process;

[0006] The motion mode of the 3D mouse is switched based on the control parameter corresponding to the event control command, so as to realize the switching motion of the needle tube between the intraocular and extraocular modes, and the 3D mouse working thread after the switching is subjected to real-time polling processing to determine the motion direction of the motor; wherein the motion mode includes an intraocular mode or an extraocular mode;

[0007] After determining the movement direction of the motor, the target position of the motor is determined based on the kinematic algorithm corresponding to the event control command, and the motor is controlled to move to the target position.

[0008] In a possible implementation manner, the motion mode of the 3D mouse is switched based on the control parameter corresponding to the event control command so as to realize the switching motion of the needle tube between the intraocular and extraocular modes, and the switched 3D mouse working thread is polled in real time to determine the motion direction of the motor, including:

[0009] Detect whether there is a class for the movement of the 3D mouse in the kernel process;

[0010] If yes, then modifying the parameters corresponding to the motion mode of the 3D mouse based on the control parameters corresponding to the event control command to determine the motion mode of the 3D mouse after switching;

[0011] If not, constructing the motion mode of the switched 3D mouse based on the control parameters corresponding to the event control command;

[0012] The state value of the 3D mouse in the working thread of the switched 3D mouse is polled, and the moving direction of the motor is determined based on the state value of the 3D mouse.

[0013] In a possible implementation manner, the changing the parameter corresponding to the motion mode of the 3D mouse based on the control parameter corresponding to the event control command to determine the motion mode of the 3D mouse after switching includes:

[0014] The control parameters include command parameters for turning on the intraocular joystick control and the movement speed;

[0015] When the command parameter for turning on the intraocular joystick control is 1, the movement mode of the 3D mouse is switched to the intraocular mode; when the command parameter for turning on the intraocular joystick control is 0, the movement mode of the 3D mouse is switched to the extraocular mode, and the movement parameters of the 3D mouse are switched based on the movement speed.

[0016] In a possible implementation manner, controlling the motor to move to the target position includes:

[0017] In the process of the motor moving based on the moving direction and the target position, detecting in real time whether the motor moves to a physical boundary position;

[0018] If so, the motor is controlled to stop moving, and the information that the motor moves to the physical boundary position is sent to the front-end process for display, so as to warn the operator.

[0019] In a possible implementation manner, after determining the movement direction of the motor and determining the target position of the motor based on the kinematic algorithm corresponding to the event control command, the intraocular and extraocular mode switching method further includes:

[0020] After receiving the 3D mouse stop control instruction sent by the front-end process, the working thread of the 3D mouse is terminated and the class controlling the movement of the 3D mouse is released.

[0021] In a possible implementation manner, after determining the movement direction of the motor and determining the target position of the motor based on the kinematic algorithm corresponding to the event control command, the intraocular and extraocular mode switching method further includes:

[0022] If the kernel process receives a request from the front-end process to change the execution order of the motor, the automation script file of the motor is changed based on the change request, and the motor is controlled to execute based on the changed automation script file.

[0023] The embodiment of the present application also provides an intraocular and extraocular mode switching device for ophthalmic surgery, the intraocular and extraocular mode switching device comprising:

[0024] The acquisition module is used by the kernel process to obtain the event control commands sent by the front-end process;

[0025] A switching module is used to switch the motion mode of the 3D mouse based on the control parameters corresponding to the event control command, so as to realize the switching motion of the needle tube between the intraocular and extraocular modes, and to perform real-time polling processing on the switched 3D mouse working thread to determine the motion direction of the motor; wherein the motion mode includes an intraocular mode or an extraocular mode;

[0026] The motion module is used to determine the motion direction of the motor and then determine the target position of the motor based on the kinematic algorithm corresponding to the event control command, and control the motor to move to the target position.

[0027] An embodiment of the present application also provides an electronic device, including: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate through the bus, and when the machine-readable instructions are executed by the processor, the steps of the method for switching between intraocular and extraocular modes of ophthalmic surgery are performed as described above.

[0028] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the method for switching between intraocular and extraocular modes of ophthalmic surgery are executed as described above.

[0029] The embodiment of the present application provides a method, device, electronic device and storage medium for switching intraocular and extraocular modes of ophthalmic surgery, wherein the method comprises: the kernel process obtains an event control command sent by the front-end process; based on the control parameters corresponding to the event control command, the motion mode of the 3D mouse is switched to realize the switching movement of the needle tube between the intraocular and extraocular modes, and the 3D mouse working thread after switching is polled in real time to determine the movement direction of the motor; wherein the motion mode includes an intraocular mode or an extraocular mode; after determining the movement direction of the motor, the target position of the motor is determined based on the kinematic algorithm corresponding to the event control command, and the motor is controlled to move to the target position. The functions of controlling the operation of the hardware device are encapsulated into the kernel process in a multi-process manner, and there is no need to instantiate related classes in the front-end interface, which reduces the number of classes that the front-end process depends on, making the code of the front-end UI interface more concise and clear, thereby realizing seamless switching between intraocular and extraocular modes.

[0030] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0032] Figure 1 A flow chart of a method for switching between intraocular and extraocular modes of ophthalmic surgery provided in an embodiment of the present application;

[0033] Figure 2 A schematic diagram of a method for switching between intraocular and extraocular modes of ophthalmic surgery provided in an embodiment of the present application;

[0034] Figure 3 This is one of the structural schematic diagrams of an intraocular and extraocular mode switching device for ophthalmic surgery provided in an embodiment of the present application;

[0035] Figure 4 The second structural schematic diagram of an intraocular and extraocular mode switching device for ophthalmic surgery provided in an embodiment of the present application;

[0036] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0037] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art, under the guidance of the content of the present application, can add one or more other operations to the flowchart, or remove one or more operations from the flowchart.

[0038] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0039] In order to enable those skilled in the art to use the contents of this application, the following implementation method is given in combination with the specific application scenario of "switching between intraocular and extraocular modes during ophthalmic surgery". For those skilled in the art, the general principles defined here can be applied to other embodiments and application scenarios without departing from the spirit and scope of this application.

[0040] The following methods, devices, electronic devices or computer-readable storage media of the embodiments of the present application can be applied to any scenario where it is necessary to switch the intraocular and extraocular modes during ophthalmic surgery. The embodiments of the present application are not limited to specific application scenarios. Any scheme using the intraocular and extraocular mode switching method, device, electronic device and storage medium provided in the embodiments of the present application for ophthalmic surgery is within the scope of protection of the present application.

[0041] First, the application scenarios to which the present application is applicable are introduced. The present application can be applied in the field of medical robot control technology.

[0042] After research, it was found that the class that controls the UI interface directly depends on the class that controls the related hardware devices. When implementing related functions, it is necessary to first instantiate the related classes, and then call the methods of the related classes as required to execute. For example, in the implementation of this function, it is necessary to instantiate the task management queue, surgical function control, and drive motor classes. The classes of the UI interface and the classes that control the hardware devices are mixed, resulting in high coupling and high code duplication. If the movement mode needs to be changed or the related methods are changed, the code of all calling locations must be changed, making it difficult to perform subsequent maintenance and optimization of the code. Therefore, how to achieve seamless switching between intraocular and extraocular modes of ophthalmic surgery has become a technical issue that cannot be underestimated.

[0043] Based on this, an embodiment of the present application provides a method for switching between intraocular and extraocular modes of ophthalmic surgery, which uses a multi-process approach to encapsulate the functions of controlling the operation of hardware devices into the kernel process. There is no need to instantiate related classes in the front-end interface, which reduces the number of classes that the front-end process depends on and makes the code of the front-end UI interface more concise and clear, thereby achieving seamless switching between intraocular and extraocular modes.

[0044] See also Figure 1 , Figure 1 This is a flow chart of a method for switching between intraocular and extraocular modes of ophthalmic surgery provided in an embodiment of the present application. Figure 1 As shown in, the xx method provided in the embodiment of the present application includes:

[0045] S101: The kernel process obtains the event control command sent by the front-end process.

[0046] In this step, the kernel process receives the event control command sent by the front-end process.

[0047] Here, the kernel process is used to control the movement and position reading of various hardware devices (such as motors, 3D mice, and auxiliary arms), and the front-end process is used to realize the conversion and display of various functional states of the UI interface. The front-end process and the kernel process transmit commands and return running results through pipelines.

[0048] Among them, the event control commands include intraocular joystick control instructions and extraocular joystick control instructions. The movement mode of the 3D mouse corresponding to the intraocular remote sensing control instructions is the intraocular mode, and the movement mode of the 3D mouse corresponding to the extraocular remote sensing control instructions is the extraocular mode.

[0049] S102: Switching the movement mode of the 3D mouse based on the control parameters corresponding to the event control command to enable the needle tube to switch between the intraocular and extraocular modes, performing real-time polling processing on the switched 3D mouse working thread to determine the movement direction of the motor; wherein the movement mode includes an intraocular mode or an extraocular mode.

[0050] In this step, the motion mode of the 3D mouse is switched using the control parameters corresponding to the event control command, and the switched 3D mouse working thread is polled in real time to determine the motion direction of the motor.

[0051] The movement mode includes an intraocular mode or an extraocular mode.

[0052] Here, the basic functions of a 3D mouse include: controlling movement in space, such as moving an object or adjusting the position of a device in a three-dimensional coordinate system, capturing user operation actions such as flicking and rotating through sensors, and converting these actions into corresponding control signals.

[0053] Among them, in the extraocular mode, the 3D mouse mainly controls the translation and plane deflection of the needle outside the eyeball, such as the movement of the needle along the x-axis or y-axis, and the deflection movement of the needle in a certain axis direction, such as positive deflection of the x-axis, negative deflection of the x-axis, etc. Through different operations of the 3D mouse, the position change of the needle in the three-dimensional coordinate system can be controlled. In the intraocular mode, the 3D mouse mainly controls the RCM (Reference Circle Method) movement of the needle inside the eyeball. The main feature of RCM movement is to keep the position of the needle tip in the three-dimensional coordinate system unchanged, but change the angle between the needle tip and the x-axis or y-axis. For example, when the x-axis is in positive RCM movement, the positions of motors 1 and 2 increase, and motor 5 controls the needle tip to move in the negative direction of the z-axis to keep the position of the needle tip unchanged.

[0054] In a possible implementation manner, the motion mode of the 3D mouse is switched based on the control parameter corresponding to the event control command so as to realize the switching motion of the needle tube between the intraocular and extraocular modes, and the switched 3D mouse working thread is polled in real time to determine the motion direction of the motor, including:

[0055] A: A class for detecting whether there is movement of the 3D mouse in the kernel process.

[0056] Here, a class is used to detect whether there is 3D mouse movement in the kernel process.

[0057] Among them, the class that controls the movement of the 3D mouse is (Task_Surgery3dcontrol).

[0058] B: If so, the parameters corresponding to the motion mode of the 3D mouse are changed based on the control parameters corresponding to the event control command, and the motion mode of the 3D mouse after switching is determined.

[0059] Here, if yes, the control parameters corresponding to the event control command are used to change the parameters corresponding to the motion mode of the 3D mouse, and the motion mode of the 3D mouse after switching is determined.

[0060] Among them, when the extraocular / intraocular joystick control is clicked, the front-end process sends a command (3dmousectl) to turn on the joystick control and parameters of the movement mode (mode) and speed (speed) to the kernel process, for example: 3dmousectl 1 5, 3dmousectl means turning on 3D mouse movement; the first parameter determines whether the movement mode is intraocular or extraocular, "1" means intraocular, "0" means extraocular, and the second parameter indicates the speed of the motor movement.

[0061] In a possible implementation manner, the changing the parameter corresponding to the motion mode of the 3D mouse based on the control parameter corresponding to the event control command to determine the motion mode of the 3D mouse after switching includes:

[0062] The control parameters include a command parameter for turning on the intraocular joystick control and a movement speed; when the command parameter for turning on the intraocular joystick control is 1, the movement mode of the 3D mouse is switched to the intraocular mode; when the command parameter for turning on the intraocular joystick control is 0, the movement mode of the 3D mouse is switched to the extraocular mode, and the movement parameters of the 3D mouse are switched based on the movement speed.

[0063] C: If not, constructing the motion mode of the switched 3D mouse based on the control parameters corresponding to the event control command.

[0064] Here, if no, it is to turn on the control function of the 3D mouse, instantiate the class and set the movement mode and movement speed according to the provided parameters mode and speed. If it exists, it is to modify the mode or speed of the control function of the 3D mouse, and modify the values ​​of the movement mode mode and speed speed according to the parameters in the command.

[0065] D: polling the state value of the 3D mouse in the working thread of the switched 3D mouse, and determining the movement direction of the motor based on the state value of the 3D mouse.

[0066] Here, in the working thread of 3D mouse control, the state value of the 3D mouse is polled. When the operator moves the 3D mouse in a certain direction, the state value changes accordingly. The 3D mouse working thread responds to the change in state and controls the motor to move in the same direction as the 3D mouse movement.

[0067] After receiving the command, the kernel process decides how to control the motor according to the parameters in the instruction (such as mode, speed, etc.). If the movement mode or speed needs to be changed, the kernel process will instantiate or modify the relevant class (such as the `Task_Surgery3dcontrol` class).

[0068] S103: After determining the movement direction of the motor, determining the target position of the motor based on the kinematic algorithm corresponding to the event control command, and controlling the motor to move to the target position.

[0069] In this step, after the movement direction of the motor is determined, the target position of the motor is determined according to the kinematic algorithm corresponding to the event control command, and the motor is controlled to move to the target position.

[0070] When intraocular and extraocular conversion is required, the event control command is sent again, for example, 3dmousectl 03, which is used to switch the 3D mouse control to extraocular movement and switch the speed to 3.

[0071] Here, the steps to determine the target position are as follows: a total of 5 motors control the position of the injection needle in the three-dimensional coordinate system, motors 1 and 2 jointly control the x-axis direction, motors 3 and 4 jointly control the y-axis movement, and motor 5 alone controls the z-axis movement; extraocular movements are mainly divided into translational movements and deflection movements (the two movements are triggered by pushing the 3D mouse in different ways), and translational movements are divided into x-axis translation and y-axis translation. When performing x-axis translation, the positions of the motors of other axes remain unchanged, and only the positions of motors 1 and 2 are increased or decreased by the same amount; when performing x-axis deflection movement, its main function is to change the deflection angle of the needle. From the implementation of the motor, the positions of the two motors in one axis direction increase and decrease, for example, when performing positive deflection on the x-axis, the position of motor 1 increases and the position of motor 2 decreases; when performing reverse deflection on the x-axis, the position of motor 1 decreases and the position of motor 2 increases. Intraocular movement is mainly RCM movement, which is achieved by keeping the position of the needle tip in the three-dimensional coordinate system unchanged while changing the angle between the needle tube and the x or y axis. From the perspective of motor implementation, when performing positive RCM movement on the x-axis, the positions of motors 1 and 2 increase and motor 5 controls the needle tip to move in the negative z direction to keep the needle tip position unchanged. The value of the motor position change is related to the size of the deflection angle. The specific value refers to the kinematic coordinate calculation.

[0072] In a specific embodiment, for extraocular movement, when the user moves the 3D mouse along the x-axis, the 3D mouse generates an electrical signal, which is analyzed by the front-end process and transmitted to the kernel process, and the kernel process controls the corresponding motors (such as motors 1 and 2) to move the needle tube along the x-axis. For intraocular movement, when the user moves the 3D mouse to perform positive RCM movement along the x-axis, the 3D mouse generates an electrical signal, which is analyzed by the front-end process and transmitted to the kernel process, and the kernel process controls the corresponding motors (such as motors 1 and 2) to deflect the needle tube along the positive x-axis, and at the same time, motor 5 controls the needle tip to move in the negative z-axis direction to keep the needle tip position unchanged.

[0073] In a possible implementation, controlling the motor to move to the target position so as to switch the needle tube between the intraocular and extraocular modes includes:

[0074] During the movement of the motor based on the movement direction and the target position, it is detected in real time whether the motor moves to the physical boundary position. If so, the motor is controlled to stop moving, and the information that the motor moves to the physical boundary position is sent to the front-end process for display, so as to warn the operator.

[0075] Here, after obtaining the target position, the motion target position and motion speed are sent to the motor through the communication protocol, and the motor completes the movement; when the motor moves to the physical boundary (that is, continuing to move will exceed the motor stroke), it stops moving and sends a signal to the front-end thread, and the front-end process displays it on the interface to notify the operator of the information.

[0076] In a possible implementation manner, after determining the movement direction of the motor and determining the target position of the motor based on the kinematic algorithm corresponding to the event control command, the intraocular and extraocular mode switching method further includes:

[0077] After receiving the 3D mouse stop control instruction sent by the front-end process, the working thread of the 3D mouse is terminated and the class controlling the movement of the 3D mouse is released.

[0078] Here, when the 3D mouse control needs to be ended, the front-end process sends a stop control instruction (stop) to the kernel process. After receiving the instruction, the kernel process stops the movement, ends the 3D mouse working thread, and releases the class that controls the 3D mouse movement.

[0079] In a possible implementation manner, after determining the movement direction of the motor and determining the target position of the motor based on the kinematic algorithm corresponding to the event control command, the intraocular and extraocular mode switching method further includes:

[0080] When the save button of the front-end process is triggered, the kernel process sends the current position information of the motor to the front-end process, so that the front-end process saves the current position information of the motor.

[0081] Here, when the Save button is clicked, the front-end process sends the query_motor_pos command to the kernel process to obtain the current position of the motor (that is, the readings of the five motors). The kernel process reads the position of the motor through the serial port and returns it to the front-end process. After the front-end process successfully reads the returned data, it converts the data into a json object for saving.

[0082] In a possible implementation manner, after determining the movement direction of the motor and determining the target position of the motor based on the kinematic algorithm corresponding to the event control command, the intraocular and extraocular mode switching method further includes:

[0083] If the kernel process receives a request from the front-end process to change the execution order of the motor, the automation script file of the motor is changed based on the change request, and the motor is controlled to execute based on the changed automation script file.

[0084] Here, if the kernel process receives a request from the front-end process to change the execution order of the motor, the automation script file of the motor is changed according to the change request, and the changed automation script file is used to control the execution of the motor.

[0085] In a specific embodiment, when the execute button is clicked, the motor will move to the specified position (i.e., the position at the time of saving). The specific steps are to read the position information obtained when saving previously from the specified path in the disk. If not found, it means that the relevant data has not been saved. At this time, it will directly exit and display that the relevant data is not found; if the data is read successfully, the autoseq command and the automation script file to be executed are sent. Taking the execution of motors 1, 2, 3, and 4 first and then motor 5 as an example, the 5 values ​​in position correspond to the target positions of the 5 motors, the 5 values ​​in speed correspond to the movement speeds of the 5 motors, delta indicates whether the movement is a relative position or an absolute displacement. If it is a relative position, the data will be processed to obtain an absolute position by adding the current position to the data in position. torlerance indicates the allowable error value of the motor movement. When the absolute values ​​of the differences between the current positions of the five motors and the target positions are all less than this value, it is considered that the target position has been reached. The kernel process replaces the key-value pairs formed by the script-specified parameters and the target position (i.e., the data just read) or speed (saved by a member variable). After the command is sent successfully, the kernel process creates a task thread and reads the corresponding script file and replaces the corresponding parameters in the script file according to the above key-value pairs to generate the target position and speed of each motor. Finally, the command is sent to the motor through the communication protocol, and the motor completes the movement. When the motor moves to the target position or within the allowable error range, the kernel process sends a signal to the front-end process, indicating that the execution has been completed; after receiving the relevant signal, the front-end process executes the relevant actions when it is completed.

[0086] This application is executed in an automated script format. The kernel process reads the commands in the script and executes them sequentially. Compared with the original solution of calling related methods according to steps, there is no need to instantiate related classes in the front-end process, which reduces the coupling of the code. When you want to change the execution order and method, you only need to change the content in the script. For example, the above example executes motors 1, 2, 3, and 4 first and then motor 5. If you want to change it to execute motor 5 first and then motors 1, 2, 3, and 4, you only need to replace the order of these two commands in the script.

[0087] For further information, see Figure 2 , Figure 2 This is a schematic diagram of a method for switching between intraocular and extraocular modes of ophthalmic surgery provided in an embodiment of the present application. Figure 2As shown, the front-end process sends an event control command to the kernel process. After receiving the event control command, the kernel process determines the task type, sets the intraocular / extraocular movement according to the 3D mouse, reads the movement status of the 3D mouse, controls the movement of the motor, and detects whether the motor reaches the physical boundary position. If so, an error signal of reaching the boundary is sent to the front-end process. If not, it detects whether the motor moves to the target position. If so, a successful end signal is sent to the front-end process. If not, the movement status of the 3D mouse continues to be read.

[0088] The embodiment of the present application provides a method for switching between intraocular and extraocular modes of ophthalmic surgery, the method comprising: a kernel process acquires an event control command sent by a front-end process; based on the control parameters corresponding to the event control command, the motion mode of the 3D mouse is switched to realize the switching motion of the needle tube between the intraocular and extraocular modes, and the switched 3D mouse working thread is polled in real time to determine the motion direction of the motor; wherein the motion mode includes an intraocular mode or an extraocular mode; after determining the motion direction of the motor, the target position of the motor is determined based on the kinematic algorithm corresponding to the event control command, the motor is controlled to move to the target position to realize the switching motion of the needle tube between the intraocular and extraocular modes, and the information of the motor completing the motion is sent to the front-end process for display. The functions of controlling the operation of the hardware device are encapsulated into the kernel process in a multi-process manner, and the related classes do not need to be instantiated in the front-end interface, which reduces the number of classes that the front-end process depends on, making the code of the front-end UI interface more concise and clear, thereby realizing seamless switching between intraocular and extraocular modes.

[0089] See also Figure 3 , Figure 4 , Figure 3 This is one of the structural schematic diagrams of an intraocular and extraocular mode switching device for ophthalmic surgery provided in an embodiment of the present application; Figure 4 This is a second structural diagram of an intraocular and extraocular mode switching device for ophthalmic surgery provided in an embodiment of the present application. Figure 3 As shown in , the intraocular and extraocular mode switching device 300 includes:

[0090] An acquisition module 310 is used for the kernel process to acquire the event control command sent by the front-end process;

[0091] The switching module 320 is used to switch the motion mode of the 3D mouse based on the control parameters corresponding to the event control command, so as to realize the switching motion of the needle tube between the intraocular and extraocular modes, and to perform real-time polling processing on the switched 3D mouse working thread to determine the motion direction of the motor; wherein the motion mode includes an intraocular mode or an extraocular mode;

[0092] The motion module 330 is used to determine the motion direction of the motor and then determine the target position of the motor based on the kinematic algorithm corresponding to the event control command, and control the motor to move to the target position.

[0093] Further, the switching module 320 is used to switch the motion mode of the 3D mouse based on the control parameters corresponding to the event control command so as to realize the switching motion of the needle tube between the intraocular and extraocular modes, and to perform real-time polling processing on the switched 3D mouse working thread to determine the motion direction of the motor. The switching module 320 is specifically used to:

[0094] Detect whether there is a class for the movement of the 3D mouse in the kernel process;

[0095] If yes, then modifying the parameters corresponding to the motion mode of the 3D mouse based on the control parameters corresponding to the event control command to determine the motion mode of the 3D mouse after switching;

[0096] If not, constructing the motion mode of the switched 3D mouse based on the control parameters corresponding to the event control command;

[0097] The state value of the 3D mouse in the working thread of the switched 3D mouse is polled, and the moving direction of the motor is determined based on the state value of the 3D mouse.

[0098] Further, when the switching module 320 is used to change the parameters corresponding to the motion mode of the 3D mouse based on the control parameters corresponding to the event control command and determine the motion mode of the 3D mouse after switching, the switching module 320 is specifically used to:

[0099] The control parameters include command parameters for turning on the intraocular joystick control and the movement speed;

[0100] When the command parameter for turning on the intraocular joystick control is 1, the movement mode of the 3D mouse is switched to the intraocular mode; when the command parameter for turning on the intraocular joystick control is 0, the movement mode of the 3D mouse is switched to the extraocular mode, and the movement parameters of the 3D mouse are switched based on the movement speed.

[0101] Further, such as Figure 4 As shown, the intraocular and extraocular mode switching device 300 further includes a detection module 340, which is used to:

[0102] In the process of the motor moving based on the moving direction and the target position, detecting in real time whether the motor moves to a physical boundary position;

[0103] If so, the motor is controlled to stop moving, and the information that the motor moves to the physical boundary position is sent to the front-end process for display, so as to warn the operator.

[0104] Further, such as Figure 4 As shown, the intraocular and extraocular mode switching device 300 further includes a stop control module 350, which is used to:

[0105] After receiving the 3D mouse stop control instruction sent by the front-end process, the working thread of the 3D mouse is terminated and the class controlling the movement of the 3D mouse is released.

[0106] Further, such as Figure 4 As shown, the intraocular and extraocular mode switching device 300 further includes a storage module 360, which is used to:

[0107] When the save button of the front-end process is triggered, the kernel process sends the current position information of the motor to the front-end process, so that the front-end process saves the current position information of the motor.

[0108] Further, such as Figure 4 As shown, the intraocular and extraocular mode switching device 300 further includes a modification module 370, and the modification module 370 is used to:

[0109] If the kernel process receives a request from the front-end process to change the execution order of the motor, the automation script file of the motor is changed based on the change request, and the motor is controlled to execute based on the changed automation script file.

[0110] The embodiment of the present application provides an intraocular and extraocular mode switching device for ophthalmic surgery, the intraocular and extraocular mode switching device comprising: an acquisition module, which is used for the kernel process to acquire the event control command sent by the front-end process; a switching module, which is used to switch the motion mode of the 3D mouse based on the control parameters corresponding to the event control command, so as to realize the switching motion of the needle tube between the intraocular and extraocular modes, and to perform real-time polling processing on the switched 3D mouse working thread to determine the motion direction of the motor; wherein the motion mode includes an intraocular mode or an extraocular mode; a motion module, which is used to determine the target position of the motor based on the kinematic algorithm corresponding to the event control command after determining the motion direction of the motor, and control the motor to move to the target position. The multi-process method is used to encapsulate the functions of controlling the operation of the hardware device into the kernel process, and there is no need to instantiate the relevant classes in the front-end interface, which reduces the number of classes that the front-end process depends on, making the code of the front-end UI interface more concise and clear, thereby realizing seamless switching between intraocular and extraocular modes.

[0111] See also Figure 5, Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 5 As shown in , the electronic device 500 includes a processor 510 , a memory 520 and a bus 530 .

[0112] The memory 520 stores machine-readable instructions executable by the processor 510. When the electronic device 500 is running, the processor 510 communicates with the memory 520 via the bus 530. When the machine-readable instructions are executed by the processor 510, the above-mentioned Figure 1 as well as Figure 2 The specific implementation of the steps of the method for switching the intraocular and extraocular modes of ophthalmic surgery in the method embodiment shown can be found in the method embodiment, which will not be repeated here.

[0113] The present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the computer program can execute the above-mentioned Figure 1 as well as Figure 2 The specific implementation of the steps of the method for switching the intraocular and extraocular modes of ophthalmic surgery in the method embodiment shown can be found in the method embodiment, which will not be repeated here.

[0114] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0115] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0116] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0117] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0118] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application can essentially be embodied in the form of a software product, or in other words, the part that contributes to the prior art or the part of the technical solution. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0119] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A method for switching between intraocular and extraocular modes in ophthalmic surgery, characterized in that: The method for switching between intraocular and extraocular modes comprises: The kernel process obtains the event control command sent by the front-end process; The motion mode of the 3D mouse is switched based on the control parameter corresponding to the event control command, so as to realize the switching motion of the needle tube between the intraocular and extraocular modes, and the 3D mouse working thread after the switching is subjected to real-time polling processing to determine the motion direction of the motor; wherein the motion mode includes an intraocular mode or an extraocular mode; After determining the movement direction of the motor, the target position of the motor is determined based on the kinematic algorithm corresponding to the event control command, and the motor is controlled to move to the target position.

2. The method for switching between intraocular and extraocular modes according to claim 1, characterized in that: The control parameters corresponding to the event control command are used to switch the motion mode of the 3D mouse so as to switch the needle tube between the intraocular and extraocular modes, and the 3D mouse work thread after the switching is polled in real time to determine the motion direction of the motor, including: Detect whether there is a class for the movement of the 3D mouse in the kernel process; If yes, then modifying the parameters corresponding to the motion mode of the 3D mouse based on the control parameters corresponding to the event control command to determine the motion mode of the 3D mouse after switching; If not, constructing the motion mode of the switched 3D mouse based on the control parameters corresponding to the event control command; The state value of the 3D mouse in the working thread of the switched 3D mouse is polled, and the moving direction of the motor is determined based on the state value of the 3D mouse.

3. The method for switching between intraocular and extraocular modes according to claim 2, characterized in that: The step of changing the parameters corresponding to the motion mode of the 3D mouse based on the control parameters corresponding to the event control command to determine the motion mode of the 3D mouse after switching includes: The control parameters include command parameters for turning on the intraocular joystick control and the movement speed; When the command parameter for turning on the intraocular joystick control is 1, the movement mode of the 3D mouse is switched to the intraocular mode; when the command parameter for turning on the intraocular joystick control is 0, the movement mode of the 3D mouse is switched to the extraocular mode, and the movement parameters of the 3D mouse are switched based on the movement speed.

4. The method for switching between intraocular and extraocular modes according to claim 1, characterized in that: The controlling the motor to move to the target position comprises: In the process of the motor moving based on the moving direction and the target position, detecting in real time whether the motor moves to a physical boundary position; If so, the motor is controlled to stop moving, and the information that the motor moves to the physical boundary position is sent to the front-end process for display, so as to warn the operator.

5. The method for switching between intraocular and extraocular modes according to claim 1, characterized in that: After determining the movement direction of the motor and determining the target position of the motor based on the kinematic algorithm corresponding to the event control command, the intraocular and extraocular mode switching method further includes: After receiving the 3D mouse stop control instruction sent by the front-end process, the working thread of the 3D mouse is terminated and the class controlling the movement of the 3D mouse is released.

6. The method for switching between intraocular and extraocular modes according to claim 1, characterized in that: After determining the movement direction of the motor and determining the target position of the motor based on the kinematic algorithm corresponding to the event control command, the intraocular and extraocular mode switching method further includes: When the save button of the front-end process is triggered, the kernel process sends the current position information of the motor to the front-end process, so that the front-end process saves the current position information of the motor.

7. The method for switching between intraocular and extraocular modes according to claim 1, characterized in that: After determining the movement direction of the motor and determining the target position of the motor based on the kinematic algorithm corresponding to the event control command, the intraocular and extraocular mode switching method further includes: If the kernel process receives a request from the front-end process to change the execution order of the motor, the automation script file of the motor is changed based on the change request, and the motor is controlled to execute based on the changed automation script file.

8. An intraocular and extraocular mode switching device for ophthalmic surgery, characterized in that: The intraocular and extraocular mode switching device comprises: The acquisition module is used by the kernel process to obtain the event control commands sent by the front-end process; A switching module is used to switch the motion mode of the 3D mouse based on the control parameters corresponding to the event control command, so as to realize the switching motion of the needle tube between the intraocular and extraocular modes, and to perform real-time polling processing on the switched 3D mouse working thread to determine the motion direction of the motor; wherein the motion mode includes an intraocular mode or an extraocular mode; A motion module is used to determine the motion direction of the motor and then determine the target position of the motor based on the kinematic algorithm corresponding to the event control command, and control the motor to move to the target position.

9. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are run by the processor, the steps of the method for switching between intraocular and extraocular modes of ophthalmic surgery as described in any one of claims 1 to 7 are executed.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for switching the intraocular and extraocular modes of ophthalmic surgery as described in any one of claims 1 to 7 are executed.