Microscope system control method and microscope system, computer readable storage medium
By introducing a bus and device service process into the microscope system, using the D-Bus bus for device communication, and dynamically adjusting the device service process through a process modification module, the problems of complexity in the microscope system control program and poor adaptability to equipment changes are solved, thus achieving flexible control and efficient equipment management of the microscope system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SOUTHERN UNIVERSITY OF SCIENCE AND TECHNOLOGY
- Filing Date
- 2024-11-26
- Publication Date
- 2026-08-04
AI Technical Summary
Existing microscope systems require specific control programs to be written for each device, resulting in high complexity of the control programs and poor adaptability and flexibility to device changes.
By introducing a bus and device service process into the microscope system, using the D-Bus bus for device communication, and dynamically adjusting the device service process through a process modification module, the control program is simplified, enabling flexible control of candidate devices.
It reduces the complexity of microscope system control programs, improves the adaptability and flexibility of equipment changes, and simplifies equipment access and maintenance.
Smart Images

Figure CN119689899B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of microscope imaging control technology, and in particular to a microscope system control method, a microscope system, and a computer-readable storage medium. Background Technology
[0002] Microscope systems typically require the control of multiple devices to achieve precise imaging of the target object. However, due to the different control requirements and connection methods of each device, existing microscope systems require the writing of specific control programs for each device in the main control module to control different devices. This increases the complexity of the microscope system's control program and limits the adaptability and flexibility of the microscope system to device changes.
[0003] Therefore, how to reduce the complexity of microscope system control programs and improve the adaptability and flexibility of microscope systems to equipment changes has become an urgent technical problem to be solved. Summary of the Invention
[0004] The main objective of this application is to provide a microscope system control method, a microscope system, and a computer-readable storage medium, which aims to reduce the complexity of the microscope system control program and improve the adaptability and flexibility of the microscope system to equipment changes.
[0005] To achieve the above objectives, a first aspect of this application provides a microscope system control method, the microscope system comprising: a bus and at least two candidate devices connected to the bus, the candidate devices being component devices for constructing the microscope system, the method comprising:
[0006] Obtain the current configuration information of at least two of the candidate devices;
[0007] Based on the current configuration information, control the device service process of each candidate device to perform a startup operation;
[0008] Communication is established with the candidate device through the device service process;
[0009] Receive device control commands;
[0010] At least one target service process is invoked from the device service process according to the device control command;
[0011] The candidate device corresponding to the device control command is manipulated through each of the target service processes.
[0012] In some embodiments, the device control instruction includes at least one candidate sub-instruction, and the step of invoking at least one target service process from the device service process according to the device control instruction includes:
[0013] Obtain the actual execution order and logical execution order of the device control instructions;
[0014] The process invocation mode of the candidate sub-instruction is determined based on the actual execution order and logical execution order of the candidate sub-instruction and the device control instruction;
[0015] The target service process is invoked from the device service process according to the candidate sub-instruction and the process invocation mode.
[0016] In some embodiments, the process invocation mode includes: an asynchronous invocation mode and a synchronous invocation mode; determining the process invocation mode of the candidate sub-instruction based on the actual execution order and logical execution order of the candidate sub-instruction and the device control instruction includes:
[0017] The preceding and following sub-instructions are selected from the candidate sub-instructions according to the actual execution order; wherein the preceding sub-instruction is the candidate sub-instruction preceding the following sub-instruction;
[0018] Select the preceding service process from the target service process according to the preceding sub-instruction;
[0019] Target execution relationships are filtered from the logical execution order based on the preceding sub-instruction and the following sub-instruction;
[0020] If the target execution relationship representation requires the execution of the subsequent sub-instruction based on the instruction execution status information fed back by the preceding service process, then the process invocation mode of the preceding sub-instruction is determined to be the synchronous invocation mode;
[0021] If the target execution relationship representation does not require the execution of the subsequent sub-instruction based on the instruction execution status information fed back by the preceding service process, then the process invocation mode of the preceding sub-instruction is determined to be the asynchronous invocation mode.
[0022] In some embodiments, invoking the target service process from the device service process according to the candidate sub-instruction and the process invocation pattern includes:
[0023] The target service process invoked by the subsequent sub-instruction is selected as the subsequent service process;
[0024] If the process invocation mode of the preceding sub-instruction is the synchronous invocation mode, then the preceding service process is invoked according to the preceding sub-instruction, so as to invoke the following service process according to the instruction execution status information fed back by the preceding service process and the following sub-instruction.
[0025] If the process invocation mode of the preceding sub-instruction is the asynchronous invocation mode, then the preceding service process is invoked according to the preceding sub-instruction, and the following service process is invoked according to the following sub-instruction.
[0026] In some embodiments, the microscope system further includes a display connected to the bus, and after establishing communication with the candidate device via the device service process, the method further includes:
[0027] The information notification mode of the device service process is obtained based on the current configuration information; wherein, the information notification mode is a message publish-subscribe mode;
[0028] According to the message publish-subscribe mode, the device feedback information sent by the device service process is received; wherein, the device feedback information includes the device status information and image acquisition parameters of the candidate device;
[0029] The device status information is visualized and displayed through the display to obtain a device status view;
[0030] The image data acquired by the candidate device is obtained based on the image acquisition parameters to obtain the target image data.
[0031] In some embodiments, the microscope system further includes a shared memory module, the device control process of the candidate device includes an image acquisition control process, the shared memory module is communicatively connected to the image acquisition control process, and the image acquisition parameters include acquired image information and image identification information; obtaining target image data by acquiring image data from the candidate device based on the image acquisition parameters includes:
[0032] The shared memory module is locked based on the acquired image information, and preliminary image data is obtained from the shared memory module based on the image identification information.
[0033] The preliminary image data is subjected to data integrity verification based on the image identification information to obtain data verification information; wherein, the data verification information characterizes the integrity of the preliminary image data;
[0034] If the data verification information indicates that the preliminary image data is complete, the shared memory module is unlocked, and the preliminary image data is used as the target image data.
[0035] In some embodiments, after manipulating the candidate device corresponding to the device control command through the target service process, the method further includes:
[0036] Get the system exit command;
[0037] The device operating status of the candidate device is obtained according to the exit system command;
[0038] The selected service process is invoked from the device service processes according to the device's operating status; wherein, the device operating status of the selected service process is the powered-on state;
[0039] The system exit command is sent to the selected service process so that the candidate device can be shut down through the selected service process;
[0040] Receive operation feedback information sent by the selected service process; wherein, the operation feedback information represents the power on / off status of the candidate device;
[0041] The device operating status of the candidate device is updated based on the operation feedback information to obtain the updated operating status;
[0042] If all candidate devices are in a shutdown state during the update process, control the selected service process to perform a shutdown operation.
[0043] In some embodiments, the microscope control system further includes a process modification module connected to the candidate devices via the bus; after controlling the device service process of each candidate device to perform a startup operation according to the current configuration information, the method further includes:
[0044] Obtain a process change instruction; wherein the process change instruction is used to change the device service process of the selected device, and the current configuration information of the selected device cannot control the device service process to perform a startup operation;
[0045] The system's configuration file is read according to the process change instruction; wherein, the configuration file includes a device list and historical configuration information, and the device list stores the candidate identifier information of the candidate devices;
[0046] Target identifier information is selected from the candidate identifier information according to the process change instruction;
[0047] Target configuration information is filtered from the historical configuration information based on the target identification information;
[0048] Selected service processes are filtered from the device service processes based on the target configuration information;
[0049] The process change instruction calls the process change module to associate the selected device and the selected service process, thereby obtaining the associated service process.
[0050] The selected device is managed through the associated service process.
[0051] To achieve the above objectives, a second aspect of this application provides a microscope system, the system including a main control module, a bus, and at least two candidate devices connected to the bus, the main control module including:
[0052] The configuration information acquisition submodule is used to acquire the current configuration information of at least two of the candidate devices;
[0053] The process startup submodule is used to control the device service process of each candidate device to perform a startup operation based on the current configuration information.
[0054] A communication establishment submodule is used to establish communication with the candidate device through the device service process;
[0055] The instruction receiving submodule is used to receive device control instructions;
[0056] The process invocation submodule is used to invoke the target service process from at least one of the device service processes according to the device control instructions.
[0057] The device control submodule is used to manipulate the candidate device corresponding to the device control command through each of the target service processes.
[0058] To achieve the above objectives, a third aspect of the present application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method of the first aspect described above.
[0059] The microscope system control method, microscope system, and computer-readable storage medium proposed in this application first connect candidate devices to a bus, obtain the current configuration information of at least two candidate devices, control the device service process of each candidate device to perform a startup operation based on the current configuration information, and establish communication with the candidate devices through the device service process. Then, a device control command is received, and at least one target service process is called from the device service process according to the device control command, and the candidate device corresponding to the device control command is controlled through each target service process. Therefore, the microscope system control method shown in the embodiments of this application, after receiving a device control command, only needs to call the target service process to control the candidate device that needs to execute the device control command, simplifying the microscope system control program and reducing its complexity; furthermore, when a candidate device changes, only the device service process of the changed device needs to be modified to control the candidate device, without needing to modify the microscope system control program or other device service processes, thus improving the adaptability and flexibility of the microscope system to device changes. Attached Figure Description
[0060] Figure 1 This is a schematic diagram of the microscope system provided in the embodiments of this application;
[0061] Figure 2 This is a schematic diagram of the main control module provided in an embodiment of this application;
[0062] Figure 3 This is an optional flowchart of the microscope system control method provided in the embodiments of this application;
[0063] Figure 4 This is another optional flowchart of the microscope system control method provided in the embodiments of this application;
[0064] Figure 5 This is another optional flowchart of the microscope system control method provided in the embodiments of this application;
[0065] Figure 6 yes Figure 5 The flowchart of step S504 in the process;
[0066] Figure 7 yes Figure 3 The flowchart of step S305 in the text;
[0067] Figure 8 yes Figure 7 The flowchart of step S702 in the process;
[0068] Figure 9 yes Figure 7 The flowchart of step S703 in the process;
[0069] Figure 10 This is another optional flowchart of the microscope system control method provided in the embodiments of this application. Detailed Implementation
[0070] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0071] It should be noted that although functional modules are divided in the system diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the system or the order in the flowchart. The terms "first," "second," etc., in the specification, claims, and the aforementioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0072] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0073] Modern microscope systems have become indispensable tools in scientific research, with a wide range of applications covering fields such as biology, materials science, and physics. With advancements in microscopy technology, the variety of devices requiring control within microscope systems has increased, including lasers, cameras, stages, filter wheels, and other accessories. These devices have diverse control requirements and are typically supplied by different manufacturers, with varying interfaces and communication protocols. This necessitates the development of specific control programs for each device within the main control module to achieve control over different components. This increases the complexity of the microscope system's control programming and limits its adaptability and flexibility in the face of device changes.
[0074] Therefore, how to reduce the complexity of microscope system control programs and improve the adaptability and flexibility of microscope systems to equipment changes has become an urgent technical problem to be solved.
[0075] Based on this, embodiments of this application provide a microscope system control method, a microscope system, and a computer-readable storage medium, aiming to reduce the complexity of the microscope system control program and improve the adaptability and flexibility of the microscope system to equipment changes.
[0076] The microscope system control method, microscope system, and computer-readable storage medium provided in this application are specifically described through the following embodiments. First, the microscope system in the embodiments of this application is described.
[0077] Figure 1 This is an optional structural schematic diagram of the microscope system provided in the embodiments of this application. Figure 1The system may include, but is not limited to, a main control module 110, a bus 120, at least two candidate devices 130, a shared memory module 140, a display (not shown), and a process modification module 150. The main control module 110, each candidate device 130, and the process modification module 150 are connected to the bus 120 to transmit information. The candidate devices 130 are components of the microscope system. Each candidate device 130 stores current configuration information. The main control module 110 stores the microscope system control program and configuration file, used to call the device service process according to device control instructions, thereby controlling the candidate devices 130 through the device service process. The process modification module 150 is used to modify the device service process of the candidate devices 130 so that the main control module 110 can call the device service process of the candidate devices 130, and thus control the candidate devices 130 through the device service process. The microscope system illustrated in this application embodiment, by setting independent device service processes and control programs, can construct a distributed system architecture, thereby simplifying the microscope system control program and reducing its complexity. Furthermore, when adding, replacing, or deleting candidate devices, or updating the program version of candidate devices, control of the candidate devices can be achieved simply by modifying the device service process of the candidate device through the process modification module, without needing to modify the microscope system control program. This reduces the difficulty of connecting devices to the microscope system and the maintenance difficulty of the microscope system, and improves the scalability of the microscope system control program as well as its adaptability and flexibility to changes in candidate devices.
[0078] For example, when adding a new device, simply configure the interface of the new device according to its current configuration information and create a device service process for the new device through the process modification module 150 to control the new device. When replacing or updating the program version of a candidate device, simply select the replaced or updated candidate device as the selected device and its device service process as the selected service process. Then, call the process modification module 150 according to the process modification instruction and associate the selected device and the selected service process through the process modification module 150. This allows the selected device to be managed through the selected service process, enabling the microscope system control program to control the selected device. When deleting a device, simply disable the device service process of the device to be deleted through the process modification module 150.
[0079] In some embodiments, the process modification module 150 may also update or modify the microscope system control program stored in the main control module 110 separately to optimize the performance of the microscope control system, so that the microscope system control program can better control the candidate device 130 according to the device control instructions.
[0080] In some embodiments, candidate device 130 includes, but is not limited to, a laser 131, a camera 132, a stage 133, and a filter wheel 134. The device service process for laser 131 is a laser control process, the device service process for camera 132 is an image acquisition control process, the device service process for stage 133 is a stage control process, and the device service process for filter wheel 134 is a filter wheel control process. The microscope system control program can be a graphical user interface (GUI) application.
[0081] In some embodiments, bus 120 is a D-Bus bus, an inter-process communication (IPC) mechanism widely used in Linux environments. D-Bus supports cross-language communication, allowing applications written in different programming languages to interact through a unified interface. Furthermore, D-Bus supports Remote Procedure Call (RPC), enabling one application to call another application as if it were a local function; simultaneously, D-Bus also supports asynchronous signal transmission, allowing applications to pass event or state change information without direct interaction. Based on this, the microscope system illustrated in this application embodiment can decompose the original control program of the microscope system into multiple independent device service processes and pre-define the device interfaces of candidate devices. This allows the D-Bus bus and device interfaces to call device service processes written in different programming languages to control the devices. Therefore, it overcomes the disadvantage of traditional microscope systems requiring a unified programming language to write control programs for each device, improving the microscope system's adaptability and compatibility with candidate devices.
[0082] For example, the microscope control program can be developed using Python, the image acquisition control process can be developed using C / C++ or other programming languages, and the interface of camera 132 can be a software development kit (SDK). When the model of camera 132 changes, only the image acquisition control process needs to be redeveloped and tested. After the test is passed, the microscope control program can call the updated image acquisition control process through the SDK interface to control the camera 132 with the changed model.
[0083] In some embodiments, the shared memory module 140 is communicatively connected to the main control module 110 and the camera 132. Therefore, the microscope system illustrated in this application embodiment can, after the camera completes the image data acquisition operation, transmit preliminary image data to the shared memory module 140 through the image acquisition control process, and send the acquired image information and image identification information to the main control module 110 through the image acquisition control process, so that the main control module 110 can obtain the target image data from the shared memory module 140 based on the acquired image information and image identification information. It should be noted that the transmission of preliminary image data and target image data between the image acquisition control process, the shared memory module 140, and the main control module 110 is not performed through the D-Bus bus; the image acquisition control process sends the acquired image information and image identification information to the main control module 110 through the message publish-subscribe mode of the D-Bus bus, with the image acquisition control process acting as the publisher and the main control module 110 as the subscriber. Therefore, the image acquisition control process shown in this embodiment of the application quickly transmits the acquired image information and image identification information to the main control module through the D-Bus bus, so as to notify the main control module to obtain the image data uploaded by the image acquisition control process from the shared memory module. This realizes the transmission of image data between the image acquisition control process and the main control module, solves the image transmission delay problem caused by the small amount of data transmitted by the D-Bus bus, and thus improves the real-time performance of image data transmission in the microscope system.
[0084] In some embodiments, the display is electrically or communicatively connected to the main control module 110, so that after the device service process of the candidate device 130 transmits device status information to the main control module 110 via the message publish-subscribe mode of the D-Bus bus, the display can obtain and update the device status information of the candidate device 130 from the main control module 110 to ensure status monitoring of each candidate device.
[0085] Please see Figure 2 The main control module 110 shown in this application embodiment includes:
[0086] The configuration information acquisition submodule 111 is used to acquire the current configuration information of at least two candidate devices;
[0087] The process startup submodule 112 is used to control the device service process of each candidate device to perform a startup operation based on the current configuration information.
[0088] The communication establishment submodule 113 is used to establish communication with candidate devices through the device service process;
[0089] Instruction receiving submodule 114 is used to receive device control instructions;
[0090] The process call submodule 115 is used to call at least one target service process from the device service process according to the device control instructions;
[0091] The device control submodule 116 is used to manipulate the candidate device corresponding to the device control command through each target service process.
[0092] The microscope system illustrated in this application embodiment includes a main control module 110 whose configuration information acquisition submodule 111 acquires the current configuration information of at least two candidate devices, and a process startup submodule 112 controls the device service process of each candidate device to perform a startup operation based on the current configuration information. A communication establishment submodule 113 establishes communication with the candidate devices through the device service processes. Then, an instruction receiving submodule 114 receives device control instructions, and a process invocation submodule 115 calls at least one target service process from the device service processes according to the device control instructions. Finally, a device control submodule 116 manipulates the candidate device corresponding to the device control instruction through each target service process. Therefore, the microscope system shown in this embodiment only needs to call the target service process to control the candidate device that needs to execute the device control command after receiving the device control command. This simplifies the microscope system control program and reduces its complexity. Furthermore, when the candidate device changes, only the device service process of the changed device needs to be modified to control the candidate device. This does not require modification of the microscope system control program or other device service processes, thus improving the microscope system's adaptability and flexibility to device changes.
[0093] The specific implementation of this microscope system is basically the same as the specific embodiment of the microscope system control method described below. Therefore, the specific embodiments of the microscope system control method applied to the various modules, devices, device service processes or control programs of the microscope system can all refer to the specific implementation of the microscope system, and will not be repeated below.
[0094] Please see Figure 3 This application also provides a microscope system control method, which can be applied to the microscope system described above. The method may include, but is not limited to, steps S301 to S306.
[0095] Step S301: Obtain the current configuration information of at least two candidate devices;
[0096] Step S302: Control the device service process of each candidate device to perform the startup operation according to the current configuration information;
[0097] Step S303: Establish communication with the candidate device through the device service process;
[0098] Step S304: Receive device control command;
[0099] Step S305: Invoke at least one target service process from the device service process according to the device control instruction;
[0100] Step S306: Control the candidate device corresponding to the device control command of each target service process.
[0101] Steps S301 to S306 of the embodiments of this application first connect the candidate device to the bus, obtain the current configuration information of at least two candidate devices, control the device service process of each candidate device to perform a startup operation according to the current configuration information, and establish communication with the candidate device through the device service process. Then, a device control command is received, and at least one target service process is called from the device service process according to the device control command, and the candidate device corresponding to the device control command is controlled through each target service process. Therefore, the microscope system control method shown in the embodiments of this application, after receiving the device control command, the microscope system control program only needs to call the target service process to control the candidate device that needs to execute the device control command, which simplifies the microscope system control program and reduces the complexity of the microscope system control program; and when the candidate device changes, only the device service process of the changed device needs to be modified to control the candidate device through the modified device service process, without modifying the microscope system control program and other device service processes, which improves the adaptability and flexibility of the microscope system to device changes.
[0102] In step S301 of some embodiments, the current configuration information may include, but is not limited to, at least one of the following: device identification information, device model information, interface type information, communication protocol information, or functional parameters. Device identification information is used to uniquely identify each candidate device, enabling the microscope system to distinguish between multiple candidate devices and select a specific device from among them. Device model information provides information such as the device's manufacturer and model, facilitating the microscope system to load the driver corresponding to the device model. Interface type information facilitates the microscope system's physical or logical connection to the candidate device, such as a serial port or SDK. Communication protocol information characterizes the rules for exchanging data between the system and the device, such as TCP / IP, serial communication, or other proprietary protocols. Functional parameters describe the types of functions and operational limitations of the candidate device; for example, for a camera device, functional parameters may include, but are not limited to, at least one of the following: resolution, exposure range, or frame rate.
[0103] It should be noted that both the current configuration information and the historical configuration information mentioned below are device configuration information for candidate devices. The only difference is that the current configuration information is the device configuration information obtained in step S301, while the historical configuration information is the device configuration information pre-stored in the system configuration file. Therefore, the specific implementation of the historical configuration information can refer to the specific implementation of the current configuration information, and will not be repeated below.
[0104] Following step S301 in some embodiments, the method illustrated in this application further includes activating the D-Bus daemon and connecting the microscope system control program to the D-Bus bus to register, activate, and manage device service processes during microscope system operation, ensuring that the microscope system control program can locate and connect to target service processes. Furthermore, the D-Bus daemon can handle access permissions, restricting access to specific device service processes through access control lists (ACLs), thereby ensuring the security of the microscope system.
[0105] In step S302 of some embodiments, the microscope system control program controls the device service process of each candidate device to perform a startup operation based on the current configuration information, to ensure that all candidate devices are ready to receive device control commands from the microscope system. After the device service process completes the startup operation, the device service process automatically connects to the D-Bus bus.
[0106] Please see Figure 4 In some embodiments, after step S302, the microscope system control method may also include, but is not limited to, steps S401 to S407:
[0107] Step S401: Obtain process change instruction; wherein, process change instruction is used to change the device service process of the selected device, and the current configuration information of the selected device cannot control the device service process to perform the startup operation;
[0108] Step S402: Read the system configuration file according to the process change instruction; wherein, the configuration file includes a device list and historical configuration information, and the device list stores candidate identification information of candidate devices;
[0109] Step S403: Filter out the target identifier information from the candidate identifier information according to the process change instruction;
[0110] Step S404: Filter out the target configuration information from the historical configuration information based on the target identification information;
[0111] Step S405: Select the chosen service process from the device service processes based on the target configuration information;
[0112] Step S406: The process change module is invoked through the process change instruction to associate the selected device and the selected service process to obtain the associated service process.
[0113] Step S407: Manage the selected device through the associated service process.
[0114] In step S401 of some embodiments, the process change instruction includes: the current configuration information of the selected device and startup error feedback information. The startup error feedback information indicates that the current configuration information of the selected device cannot control the device service process to perform the startup operation. The process change instruction is used to change the device service process of the selected device, which can be specifically set by the user or automatically generated by an automation script.
[0115] In step S403 of some embodiments, the device identifier information of the selected device is selected from the current configuration information of the selected device as the current device identifier information, and the current device identifier information is matched one by one with the candidate identifier information in the device list to filter out the target identifier information in order to check whether the device service process of the selected device has been created in advance. If the target identifier information can be filtered out, it means that the process modification module has created the device service process of the selected device in advance, and the device service process of the selected device can be modified; if the target identifier information cannot be filtered out, it means that the process modification module has not created the device service process of the selected device, and the device service process of the selected device needs to be created.
[0116] In step S406 of some embodiments, after the process change module is called by the process change instruction, the process change module replaces the historical configuration information with the current configuration information of the selected device to obtain the updated configuration information, and associates the updated configuration information with the selected service process. Therefore, the selected device can be managed through the selected service process.
[0117] Steps S401 to S407 of this embodiment first obtain a process change instruction including the current configuration information and startup error feedback information of the selected device. The process change instruction then reads the device list and historical configuration information to filter target identifier information from candidate identifier information stored in the device list. Next, target configuration information is filtered from historical configuration information based on the target identifier information, and a selected service process is selected from device service processes based on the target configuration information. Finally, the process change instruction calls the process change module to associate the selected device and the selected service process, obtaining the associated service process, and managing the selected device through the associated service process. Therefore, the microscope system control method shown in this embodiment can re-control the device through the device service process after device replacement or configuration information changes, without modifying the microscope system's control program. This allows the microscope system to quickly control devices after replacement or configuration information changes, improving the microscope system's adaptability to device changes.
[0118] Please see Figure 5 In some embodiments, after step S303, the microscope system control method may also include, but is not limited to, steps S501 to S504:
[0119] Step S501: Obtain the information notification mode of the device service process based on the current configuration information; wherein, the information notification mode is a message publish-subscribe mode;
[0120] Step S502: Receive device feedback information sent by the device service process according to the message publish-subscribe mode; wherein, the device feedback information includes the device status information and image acquisition parameters of the candidate device;
[0121] Step S503: Visualize the device status information on the display to obtain a device status view;
[0122] Step S504: Obtain image data acquired by candidate devices according to image acquisition parameters to obtain target image data.
[0123] In step S501 of some embodiments, the information notification mode of the device service process is a message publish-subscribe mode. Therefore, the device service process can actively send information to the main control module, where the publisher is the device service process and the subscriber is the main control module. Sending messages to the main control module through the message publish-subscribe mode avoids polling each device service process by the main control module, thus saving processor (CPU) resources. It also improves the response speed of the microscope system to sudden events and reduces the risk of missing important events due to polling delays.
[0124] Before step S502 in some embodiments, the method further acquires images through a camera to obtain preliminary image data, image identification information, and data acquisition information; the image acquisition control process locks the shared memory according to the data acquisition information and uploads the preliminary image data according to the image identification information; after the preliminary image data is uploaded, the image acquisition control process unlocks the shared memory.
[0125] In step S502 of some embodiments, the device status information is used to send the current status information of the candidate device to the main control module. The device status information may include, but is not limited to, at least one of the following: abnormal status information, current parameter information, and threshold prompt information. Abnormal status information indicates that the candidate device has encountered an anomaly, requiring processing by the main controller. Current parameter information describes the current status of each functional parameter of the candidate device, allowing the user or the main control module to adjust the functional parameters of the candidate device. Threshold prompt information provides a prompt for functional parameters that are approaching or have reached a threshold. For example, when the displacement stage moves to its maximum moving distance, the movement threshold information is sent to the main control module through the displacement stage control process. Image acquisition parameters may include, but are not limited to, at least one of the following: aperture parameters, field of view parameters, exposure time parameters, and imaging mode parameters.
[0126] In step S503 of some embodiments, the form of the device status view may include, but is not limited to, at least one of the following dynamic charts, trend graphs or lists, and this application does not impose specific limitations.
[0127] In step S504 of some embodiments, the target image data can be displayed on the display interface of the main control module or on an external display. This application does not impose any specific limitations.
[0128] Steps S501 to S504 of this embodiment first obtain the information notification mode of the device service process based on the current configuration information; wherein, the information notification mode is a message publish-subscribe mode. Then, according to the message publish-subscribe mode, the device feedback information sent by the device service process is received; wherein, the device feedback information includes the device status information and image acquisition parameters of the candidate device. Finally, the device status information is visualized on the display to obtain a device status view, and the image data acquired by the candidate device is obtained according to the image acquisition parameters to obtain the target image data. Therefore, the microscope system control method shown in this embodiment can actively send device status information and image acquisition data to the main control module through the device service process of the candidate device, enabling effective communication between the system and the candidate device, so that the main control module can quickly identify and solve potential problems of the candidate device, thereby improving the operating efficiency of the microscope system.
[0129] Please see Figure 6 In some embodiments, the image acquisition parameters include acquired image information and image identification information; step S504 may also include, but is not limited to, steps S601 to S603:
[0130] Step S601: Lock the shared memory module based on the acquired image information, and obtain preliminary image data from the shared memory module based on the image identification information;
[0131] Step S602: Perform data integrity verification on the preliminary image data based on the image identification information to obtain data verification information; wherein, the data verification information represents the integrity of the preliminary image data.
[0132] Step S603: If the data verification information indicates that the preliminary image data is complete, unlock the shared memory module and use the preliminary image data as the target image data.
[0133] In step S602 of some embodiments, the specific operation of performing data integrity verification on the preliminary image data based on the image identification information may include, but is not limited to, checking the cyclic redundancy check (CRC) value, hash value, or other checksum of the data; this application does not impose specific limitations. By performing data integrity verification on the preliminary image data, it can be verified whether the data has been damaged or altered during transmission.
[0134] In step S603 of some embodiments, if the data verification information indicates that the preliminary image data is incomplete, the main control module will reacquire the preliminary image data according to the image identification information; if the data verification information indicates that the preliminary image data is complete, the main control module will unlock the shared memory module and use the preliminary image data as the target image data to ensure that the preliminary image data is completely transmitted to the main control module.
[0135] After step S603 in some embodiments, the target image data needs to be rendered according to the rendering requirement information to obtain rendered image data. The rendering requirement information is set according to the user's needs and may include, but is not limited to, at least one of the following: brightness adjustment information, contrast adjustment information, saturation adjustment information, size adjustment information, resolution adjustment information, or format conversion information; this application does not impose any limitations on this.
[0136] Steps S601 to S603 of this embodiment first lock the shared memory module based on the acquired image information, and then obtain preliminary image data from the shared memory module based on image identification information. Next, the preliminary image data is checked for data integrity based on the image identification information to obtain data verification information. This data verification information indicates the integrity of the preliminary image data. If the data verification information indicates that the preliminary image data is complete, the shared memory module is unlocked, and the preliminary image data is used as the target image data. Therefore, the microscope system control method shown in this embodiment, by locking and unlocking the shared memory module, can prevent other programs or device service processes from modifying the preliminary image data in the shared memory module when the main control module obtains the preliminary image data, ensuring the consistency of the preliminary image data. Furthermore, by performing data integrity verification on the preliminary image data, problems such as missing preliminary image data can be avoided, thereby improving the reliability of image data acquisition by the microscope system.
[0137] In step S304 of some embodiments, the device control instruction may include, but is not limited to, at least one of the following candidate sub-instructions: device start sub-instruction, device initialization sub-instruction, device movement sub-instruction, device parameter adjustment sub-instruction, or device shutdown sub-instruction. The specific device control instruction can be set according to the actual needs of those skilled in the art.
[0138] Please see Figure 7 In some embodiments, step S305 may include, but is not limited to, steps S701 to S703:
[0139] Step S701: Obtain the actual execution order and logical execution order of the device control instructions;
[0140] Step S702: Determine the process call mode of the candidate sub-instruction based on the actual execution order and logical execution order of the candidate sub-instruction and the device control instruction;
[0141] Step S703: Invoke the target service process from the device service process according to the candidate sub-instruction and process call mode.
[0142] In step S701 of some embodiments, the logical execution order of the device control instructions is used to describe the logical sequence in which the main control module executes candidate sub-instructions. The logical execution order determines the basic execution relationship between each candidate sub-instruction and other candidate sub-instructions. The basic execution relationship between any two candidate sub-instructions includes, but is not limited to, any of the following: execution first, execution last, or parallel execution. The actual execution order is determined according to the logical execution order. For candidate sub-instructions with logical execution orders of execution first and execution last, their actual execution order is determined according to the logical execution order. For candidate sub-instructions with logical execution orders of parallel execution, their actual execution order may include any of the following: random allocation of the order or execution according to a preset order, or other methods that can be directly obtained by those skilled in the art to determine the actual execution order.
[0143] In step S703 of some embodiments, the process call mode may include, but is not limited to, the following two modes: asynchronous call mode and synchronous call mode. When the microscope system control program calls a device service process to control a candidate device through asynchronous call mode, after initiating a call request and candidate sub-instruction to a device service process, the main control module does not need to wait for the device service process to return information indicating completion of the candidate sub-instruction before executing the next candidate sub-instruction. This saves the microscope system control program the time spent waiting for the device service process to respond to the candidate sub-instruction, improving the working efficiency of the microscope system. When the microscope system control program calls a device service process to control a candidate device through synchronous call mode, after initiating a call request and candidate sub-instruction to a device service process, it needs to wait for the device service process to return information indicating completion of the candidate sub-instruction before the main control module can execute the next candidate sub-instruction. This ensures that the device control instructions are executed sequentially and protects the device service process from interference during the execution of device control instructions, guaranteeing the integrity and reliability of the device service process's execution of device control instructions.
[0144] Steps S701 to S703 as shown in the embodiments of this application first obtain the actual execution order and logical execution order of the device control instructions, then determine the process call mode of the candidate sub-instructions based on the candidate sub-instructions, the actual execution order and logical execution order of the device control instructions, and finally call the target service process from the device service process based on the candidate sub-instructions and the process call mode. This can select different process call modes for each candidate sub-instruction of the device control instructions, thereby improving the control efficiency of the microscope system for candidate devices.
[0145] Please see Figure 8 In some embodiments, step S702 may include, but is not limited to, steps S801 to S805:
[0146] Step S801: Select the preceding sub-instruction and the following sub-instruction from the candidate sub-instructions according to the actual execution order; wherein, the preceding sub-instruction is the candidate sub-instruction preceding the following sub-instruction;
[0147] Step S802: Select the preceding service process from the target service processes according to the preceding sub-instruction;
[0148] Step S803: Filter the target execution relationship from the logical execution order based on the preceding and following sub-instructions;
[0149] Step S804: If the target execution relationship representation requires the execution of the subsequent sub-instruction based on the instruction execution status information fed back by the preceding service process, then the process call mode of the preceding sub-instruction is determined to be synchronous call mode.
[0150] Step S805: If the target execution relationship representation does not require the execution of the subsequent sub-instruction based on the instruction execution status information fed back by the preceding service process, then the process call mode of the preceding sub-instruction is determined to be the asynchronous call mode.
[0151] In step S803 of some embodiments, the target execution relationship is the basic execution relationship between the preceding sub-instruction and the following sub-instruction, which describes whether it is necessary to wait for the preceding sub-instruction to finish executing before the following sub-instruction can be executed.
[0152] In step S804 of some embodiments, when the target execution relationship indicates that the subsequent sub-instruction needs to be executed based on the instruction execution status information fed back by the preceding service process, the process call mode of the preceding sub-instruction can be determined to be synchronous call mode. The preceding service process sends instruction execution status information to the main control module according to a specific feedback cycle. The instruction execution status information indicates that the preceding sub-instruction has been completed or is being executed. If the instruction execution status fed back by the preceding service process indicates that the preceding sub-instruction has been completed, the subsequent sub-instruction is executed; if the instruction execution status fed back by the preceding service process indicates that the preceding sub-instruction is being executed, the subsequent sub-instruction cannot be executed. For example, a device control instruction includes a power-on sub-instruction and an aperture parameter setting sub-instruction. The power-on sub-instruction is the preceding sub-instruction, and the aperture parameter setting sub-instruction is the subsequent sub-instruction. The target execution relationship is to execute the power-on sub-instruction first, and then execute the aperture parameter setting sub-instruction. In this case, the process call mode of the power-on sub-instruction needs to be set to synchronous call mode.
[0153] In step S805 of some embodiments, when the target execution relationship does not require the execution of the subsequent sub-instruction based on the instruction execution status information fed back by the preceding service process, the process invocation mode of the preceding sub-instruction can be determined to be an asynchronous invocation mode. For example, if a device control instruction includes a first laser energy setting sub-instruction and a second laser energy setting sub-instruction, wherein the first laser energy setting sub-instruction is the preceding sub-instruction and the second laser energy setting sub-instruction is the following sub-instruction, and the target execution relationship involves the parallel execution of the first laser energy setting sub-instruction and the second laser energy setting sub-instruction, then the process invocation mode of the first laser energy setting sub-instruction is set to an asynchronous invocation mode.
[0154] In other embodiments, if the device control instruction contains only one sub-instruction, then one of the synchronous call mode and the asynchronous call mode can be selected as the process call mode.
[0155] Steps S801 to S805, as illustrated in this embodiment, firstly, a preceding sub-instruction and a following sub-instruction are selected from candidate sub-instructions according to the actual execution order of the device control instructions; wherein, the preceding sub-instruction is the candidate sub-instruction preceding the following sub-instruction. Then, a preceding service process is selected from target service processes based on the preceding sub-instruction, and a target execution relationship is filtered from the logical execution order of the device control instructions based on the preceding and following sub-instructions. If the target execution relationship indicates that the following sub-instruction needs to be executed based on the instruction execution status information fed back by the preceding service process, then the process call mode of the preceding sub-instruction is determined to be a synchronous call mode; if the target execution relationship indicates that the following sub-instruction does not need to be executed based on the instruction execution status information fed back by the preceding service process, then the process call mode of the preceding sub-instruction is determined to be an asynchronous call mode. Therefore, the microscope system control method shown in the embodiments of this application enables the microscope system to intelligently select the most suitable process call mode for each candidate sub-instruction according to the actual execution order and logical execution order of the device control instructions. This intelligent process call mode selection mechanism enables the microscope system to adapt to different device control requirements, optimize the utilization efficiency of processor resources, and ensure the accuracy of control instructions and the stability of the device.
[0156] Please see Figure 9 In some embodiments, step S703 may also include, but is not limited to, steps S901 to S903:
[0157] Step S901: Select the target service process called by the subsequent sub-instruction as the subsequent service process;
[0158] Step S902: If the process call mode of the preceding sub-instruction is synchronous call mode, then the preceding service process is called according to the preceding sub-instruction, so as to call the following service process according to the instruction execution status information fed back by the preceding service process and the following sub-instruction.
[0159] Step S903: If the process call mode of the preceding sub-instruction is asynchronous call mode, then the preceding service process is called according to the preceding sub-instruction, and the following service process is called according to the following sub-instruction.
[0160] In step S902 of some embodiments, if the preceding sub-instruction process call mode is synchronous call mode, the preceding service process can be called according to the preceding sub-instruction, so as to control the candidate device corresponding to the preceding sub-instruction through the preceding service process. After the preceding service process completes the execution of the preceding sub-instruction, it will feed back instruction execution status information to the main control module. Therefore, the subsequent sub-instruction can be executed according to the instruction execution status information fed back by the preceding service process, so as to call the subsequent service process according to the subsequent sub-instruction, and then control the candidate device corresponding to the subsequent sub-instruction through the subsequent service process. For example: If the device control command includes an image acquisition sub-command and a power off sub-command, where the image acquisition sub-command comes first and the power off sub-command comes later, and the process call mode of the image acquisition sub-command is synchronous call mode, with the image acquisition control process as the first service process and the power control process as the second service process, then the GUI application first calls the image acquisition control process according to the image acquisition sub-command to control the camera to acquire image data, and receives the command execution status information fed back by the image acquisition control process. If the command execution status information indicates that image acquisition has been completed, then the power off sub-command calls the power control process to turn off the power.
[0161] In step S903 of some embodiments, if the process call mode of the preceding sub-instruction is asynchronous call mode, the preceding service process can be called according to the preceding sub-instruction, and then the candidate device corresponding to the preceding sub-instruction can be controlled through the preceding service process. At the same time, the following service process can be called according to the following sub-instruction, and then the candidate device corresponding to the following sub-instruction can be controlled through the following service process, without waiting for the instruction execution status information fed back by the preceding service process before the following sub-instruction can be executed. For example: If the device control instructions include a first laser energy setting sub-instruction and a second laser energy setting sub-instruction, where the first laser energy setting sub-instruction `asyncCall("set_power", 100, laser_1)` is the first sub-instruction and the second laser energy setting sub-instruction `asyncCall("set_power", 110, laser_2)` is the second sub-instruction, the process call mode of the first laser energy setting sub-instruction is asynchronous, the first laser control process `laser_1` is the first service process, and the second laser control process `laser_2` is the first service process, then the GUI application executes the first laser energy setting sub-instruction and the second laser energy setting sub-instruction respectively. This is done by calling the instruction `asyncCall("set_power", 100, laser_1)` to call the first laser control process `laser_1`, and by calling the instruction `asyncCall("set_power", 110, laser_2)` to use the second laser control process `laser_2`, thus setting the energy of the two lasers respectively.
[0162] Steps S901 to S903 of the embodiments of this application involve selecting the target service process to be called by the subsequent sub-instruction as the subsequent service process, and determining how to call the target service process based on the candidate sub-instructions and the process call mode. If the process call mode of the preceding sub-instruction is a synchronous call mode, then the preceding service process is called according to the preceding sub-instruction, and the subsequent service process is called based on the instruction execution information fed back by the preceding service process and the subsequent sub-instruction; if the process call mode of the preceding sub-instruction is an asynchronous call mode, then the preceding service process is called according to the preceding sub-instruction, and the subsequent service process is called according to the subsequent sub-instruction. Therefore, the microscope system control method shown in the embodiments of this application enables the microscope system to flexibly call the device service process according to the candidate sub-instructions and the process call mode of the candidate sub-instructions, so as to achieve efficient and accurate device control and improve the response speed and processing capability of the microscope system.
[0163] Please see Figure 10 In some embodiments, after step S306, the microscope system control method further includes, but is not limited to, steps S1001 to S1007:
[0164] Step S1001: Obtain the system exit command;
[0165] Step S1002: Obtain the device operating status of the candidate device according to the exit system command;
[0166] Step S1003: Select the selected service process from the device service processes according to the device operating status; wherein, the device operating status of the selected service process is the powered-on state;
[0167] Step S1004: Send the exit system command to the selected service process so that the candidate device can be shut down through the selected service process;
[0168] Step S1005: Receive operation feedback information sent by the selected service process; wherein, the operation feedback information represents the power on / off status of the candidate device;
[0169] Step S1006: Update the device operating status of the candidate device based on the operation feedback information to obtain the updated operating status;
[0170] Step S1007: If the update running status of all candidate devices is in the shutdown state, control the selected service process to perform a shutdown operation.
[0171] In some embodiments, the system exit command in step S1001 can also be generated by user input. Furthermore, the system exit command can be generated by an automated script when a candidate device stops responding or malfunctions, so as to shut down the malfunctioning candidate device via the system exit command, thereby preventing the problem from spreading to the microscope system control program or other candidate devices, and protecting the safety of the entire microscope system.
[0172] In step S1002 of some embodiments, the device operating state is any one of the following: power-on state or power-off state.
[0173] In step S1004 of some embodiments, the shutdown operation may include, but is not limited to, at least one of the following: saving current configuration information, data backup, ending the current task, turning off the device power, or releasing occupied resources. The specific shutdown operation can be set by those skilled in the art according to actual needs, and this application does not impose any restrictions.
[0174] In step S1005 of some embodiments, after the selected service process completes the shutdown operation, the device operating status is changed from the power-on state to the power-off state, and the device operating status is sent to the main control module in the form of operation feedback information. Therefore, the main control module can determine the power-on / off status of the candidate device through the operation feedback information.
[0175] In step S1006 of some embodiments, the main control module can also obtain the device operating status of all candidate devices according to a specific inspection cycle, update the device operating status of the candidate devices to obtain the updated operating status, and then update the selected service process according to the updated operating status to obtain the updated service process, and send the exit system command to the updated service process so as to control the candidate devices to perform a shutdown operation through the updated service process.
[0176] After step S1006 in some embodiments, the microscope system control method further includes shutting down the D-Bus daemon and exiting the microscope system.
[0177] Steps S1001 to S1007 of this embodiment first obtain the device operating status of the candidate devices through an exit system command, and then call a selected service process from the device service processes according to the device operating status; wherein the device operating status of the selected service process is in the power-on state. Then, an exit system command is sent to the selected service process to perform a shutdown operation on the candidate devices through the selected service process, and operation feedback information sent by the selected service process is received; wherein the operation feedback information represents the power-on / off status of the candidate devices. Finally, the device operating status of the candidate devices is updated according to the operation feedback information to obtain the updated operating status. If the updated operating status of all candidate devices is in the power-off state, the selected service process is controlled to perform the shutdown operation. Therefore, the microscope system control method shown in this embodiment can ensure that all devices are safely shut down before shutdown, avoiding device damage or data loss, and ensuring that all devices can be safely and orderly shut down and exit the microscope system, thereby protecting the entire microscope system from unexpected influences.
[0178] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the microscope system control method described above.
[0179] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0180] The microscope system control method, microscope system, and computer-readable storage medium provided in this application first connect candidate devices to the bus, obtain the current configuration information of at least two candidate devices, and control the device service process of each candidate device to perform a startup operation based on the current configuration information. Then, a device control command is received. Using a message publish-subscribe model, at least one target service process is called from the device service process according to the device control command. Each target service process controls the candidate device corresponding to the device control command, and communication is established between the device service process and the candidate device. Therefore, the microscope system control method shown in this application, upon receiving a device control command, only requires the microscope system control program to call the target service process to control the candidate device that needs to execute the device control command, simplifying the microscope system control program and reducing its complexity. Furthermore, when a candidate device changes, only the device service process of the changed device needs to be modified to control the candidate device, without requiring modification of the microscope system control program or other device service processes, thus improving the adaptability and flexibility of the microscope system to device changes.
[0181] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0182] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0183] The system embodiments described above are merely illustrative. The modules and sub-modules described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules and sub-modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0184] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules and sub-modules in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0185] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion, for example, a process, method, system, product, or apparatus that includes a series of steps, modules, or submodules is not necessarily limited to those explicitly listed, but may include other steps, modules, or submodules not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0186] It should be understood that in this application, "at least one" means one or more, and "more" means two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or multiple items. For example, at least one of a, b, or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0187] In the embodiments provided in this application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For instance, the division of modules and sub-modules described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between systems, modules, or sub-modules may be electrical, mechanical, or other forms.
[0188] The modules and sub-modules described above as separate components may or may not be physically separate. The components shown as modules or sub-modules may or may not be physical modules or physical sub-modules; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules and sub-modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0189] Furthermore, the functional modules and sub-modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules and sub-modules can be integrated into one module. The integrated module can be implemented in hardware or as a software functional module.
[0190] If the integrated module is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0191] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.
Claims
1. A microscope system control method, characterized in that, The microscope system includes: a bus and at least two candidate devices connected to the bus, the candidate devices being component devices for constructing the microscope system; the method includes: Obtain the current configuration information of at least two of the candidate devices; According to the current configuration information, the device service process of each candidate device is controlled to perform a startup operation, and the device service processes of the at least two candidate devices are written in different programming languages; Communication is established with the candidate device through the device service process; Receive device control commands; At least one target service process is invoked from the device service process according to the device control command; The candidate device corresponding to the device control command is manipulated through each of the target service processes; The candidate device includes a camera, and the microscope system further includes a shared memory module. The device control process of the candidate device includes an image acquisition control process, and the shared memory module is communicatively connected to the image acquisition control process. The method further includes: acquiring images through the camera to obtain preliminary image data and image acquisition parameters, wherein the image acquisition parameters include acquired image information and image identification information; the image acquisition control process locks the shared memory module according to the acquired data information and uploads the preliminary image data according to the image identification information; after the preliminary image data is uploaded, the image acquisition control process unlocks the shared memory module. The method further includes: locking the shared memory module based on the acquired image information; obtaining the preliminary image data from the shared memory module based on the image identification information as the target image data; and unlocking the shared memory module. The bus is used to transmit information, and the bus is a D-BUS bus. The transmission of the preliminary image data and the target image data is not carried out through the D-BUS bus. The microscope control system further includes a process modification module, which is connected to the candidate devices via the bus. After controlling the device service process of each candidate device to perform a startup operation according to the current configuration information, the method further includes: obtaining a process modification instruction; wherein the process modification instruction is used to modify the device service process of the selected device, and the current configuration information of the selected device cannot control the device service process to perform a startup operation; reading the system's configuration file according to the process modification instruction; wherein the configuration file includes a device list and historical configuration information, and the device list stores candidate identifier information of the candidate devices; filtering target identifier information from the candidate identifier information according to the process modification instruction; filtering target configuration information from the historical configuration information according to the target identifier information; filtering a selected service process from the device service processes according to the target configuration information; calling the process modification module through the process modification instruction to associate the selected device and the selected service process through the process modification module to obtain an associated service process; and managing the selected device through the associated service process.
2. The method according to claim 1, characterized in that, The device control instruction includes at least one candidate sub-instruction, and the step of invoking at least one target service process from the device service process according to the device control instruction includes: Obtain the actual execution order and logical execution order of the device control instructions; The process invocation mode of the candidate sub-instruction is determined based on the actual execution order and logical execution order of the candidate sub-instruction and the device control instruction; The target service process is invoked from the device service process according to the candidate sub-instruction and the process invocation mode.
3. The method according to claim 2, characterized in that, The process invocation modes include: asynchronous invocation mode and synchronous invocation mode; determining the process invocation mode of the candidate sub-instruction based on the actual execution order and logical execution order of the candidate sub-instruction and the device control instruction includes: The preceding and following sub-instructions are selected from the candidate sub-instructions according to the actual execution order; wherein the preceding sub-instruction is the candidate sub-instruction preceding the following sub-instruction; Select the preceding service process from the target service process according to the preceding sub-instruction; Target execution relationships are filtered from the logical execution order based on the preceding sub-instruction and the following sub-instruction; If the target execution relationship representation requires the execution of the subsequent sub-instruction based on the instruction execution status information fed back by the preceding service process, then the process invocation mode of the preceding sub-instruction is determined to be the synchronous invocation mode; If the target execution relationship representation does not require the execution of the subsequent sub-instruction based on the instruction execution status information fed back by the preceding service process, then the process invocation mode of the preceding sub-instruction is determined to be the asynchronous invocation mode.
4. The method according to claim 3, characterized in that, The step of invoking the target service process from the device service process according to the candidate sub-instruction and the process invocation pattern includes: The target service process invoked by the subsequent sub-instruction is selected as the subsequent service process; If the process invocation mode of the preceding sub-instruction is the synchronous invocation mode, then the preceding service process is invoked according to the preceding sub-instruction, so as to invoke the following service process according to the instruction execution status information fed back by the preceding service process and the following sub-instruction. If the process invocation mode of the preceding sub-instruction is the asynchronous invocation mode, then the preceding service process is invoked according to the preceding sub-instruction, and the following service process is invoked according to the following sub-instruction.
5. The method according to claim 4, characterized in that, The microscope system further includes a display connected to the bus, and after establishing communication with the candidate device via the device service process, the method further includes: The information notification mode of the device service process is obtained based on the current configuration information; wherein, the information notification mode is a message publish-subscribe mode; According to the message publish-subscribe pattern, the device feedback information sent by the device service process is received; wherein, the device feedback information includes the device status information of the candidate device; The device status information is visualized and displayed on the monitor to obtain a device status view.
6. The method according to claim 5, characterized in that, The step of obtaining the preliminary image data from the shared memory module based on the image identification information, as the target image data, includes: The preliminary image data is subjected to data integrity verification based on the image identification information to obtain data verification information; wherein, the data verification information characterizes the integrity of the preliminary image data; If the data verification information indicates that the preliminary image data is complete, the preliminary image data is used as the target image data.
7. The method according to claim 5, characterized in that, After manipulating the candidate device corresponding to the device control command through the target service process, the method further includes: Get the system exit command; The device operating status of the candidate device is obtained according to the exit system command; The selected service process is invoked from the device service processes according to the device's operating status; wherein, the device operating status of the selected service process is the powered-on state; The system exit command is sent to the selected service process so that the candidate device can be shut down through the selected service process; Receive operation feedback information sent by the selected service process; wherein, the operation feedback information represents the power on / off status of the candidate device; The device operating status of the candidate device is updated based on the operation feedback information to obtain the updated operating status; If all candidate devices are in a shutdown state during the update process, control the selected service process to perform a shutdown operation.
8. A microscope system, characterized in that, The system is used to implement the microscope system control method according to any one of claims 1 to 7, the system comprising a main control module, a bus, and at least two candidate devices connected to the bus, the main control module comprising: The configuration information acquisition submodule is used to acquire the current configuration information of at least two of the candidate devices; The process startup submodule is used to control the device service process of each candidate device to perform a startup operation according to the current configuration information, wherein the device service processes of the at least two candidate devices are written in different programming languages. A communication establishment submodule is used to establish communication with the candidate device through the device service process; The instruction receiving submodule is used to receive device control instructions; The process invocation submodule is used to invoke at least one target service process from the device service process according to the device control instructions; The device control submodule is used to manipulate the candidate device corresponding to the device control command through each of the target service processes; The candidate device includes a camera, and the microscope system further includes a shared memory module. The device control process of the candidate device includes an image acquisition control process, and the shared memory module is communicatively connected to the image acquisition control process. The method further includes: acquiring images through the camera to obtain preliminary image data and image acquisition parameters, wherein the image acquisition parameters include acquired image information and image identification information; the image acquisition control process locks the shared memory module according to the acquired data information and uploads the preliminary image data according to the image identification information; after the preliminary image data is uploaded, the image acquisition control process unlocks the shared memory module. The method further includes: locking the shared memory module based on the acquired image information; obtaining the preliminary image data from the shared memory module based on the image identification information as the target image data; and unlocking the shared memory module. The bus is used to transmit information, and the bus is a D-BUS bus. The transmission of the preliminary image data and the target image data is not carried out through the D-BUS bus. The microscope control system further includes a process modification module, which is connected to the candidate devices via the bus. After controlling the device service process of each candidate device to perform a startup operation according to the current configuration information, the method further includes: obtaining a process modification instruction; wherein the process modification instruction is used to modify the device service process of the selected device, and the current configuration information of the selected device cannot control the device service process to perform a startup operation; reading the system's configuration file according to the process modification instruction; wherein the configuration file includes a device list and historical configuration information, and the device list stores candidate identifier information of the candidate devices; filtering target identifier information from the candidate identifier information according to the process modification instruction; filtering target configuration information from the historical configuration information according to the target identifier information; filtering a selected service process from the device service processes according to the target configuration information; calling the process modification module through the process modification instruction to associate the selected device and the selected service process through the process modification module to obtain an associated service process; and managing the selected device through the associated service process.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the microscope system control method according to any one of claims 1 to 7.