Experiment script generation method and device based on configuration driving
By building the basic function library and visual configuration templates to generate experimental directed graphs, the problems of high technical threshold and low writing efficiency in the traditional experimental script development model are solved, and high-quality automated experimental script generation is achieved.
Patent Information
- Application Number
- CN202510511695.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-23
- Publication Date
- 2025-07-29
AI Technical Summary
The traditional experimental script development model requires professional background, high technical threshold, low writing efficiency, difficult to guarantee quality, and difficult to avoid syntax errors and logical vulnerabilities.
A basic function library is built based on experimental scenarios, providing a visual experimental task configuration template, and an experimental directed graph is generated through device connection and task flow configuration, and an experimental script is automatically generated.
It lowers the technical threshold for script writing, improves generation efficiency, reduces error rate, and improves script quality.
Smart Images

Figure CN120386735A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and particularly to a method and device for generating an experimental script based on configuration driving. Background Art
[0002] In the field of automated experiments, the traditional experimental script development mode has the following problems: 1) directly calling the underlying hardware drivers for script development requires the staff to have professional backgrounds in electronic engineering, computer science, etc., and the technical threshold is relatively high; 2) experimental personnel cannot complete script writing without fully mastering the instrument connection status, which makes it difficult to improve the script writing efficiency; 3) the script writing quality is related to manual experience, and it is difficult to systematically avoid problems such as syntax errors and logical loopholes. Summary of the Invention
[0003] The purpose of the present invention is to provide a method, device, electronic device and computer-readable storage medium for generating an experimental script based on configuration driving in view of the defects of the prior art. The present invention pre-constructs a basic function library based on the device drivers of all operating devices in the experimental scenario, and customizes visual experimental task configuration templates (device connection configuration template, task flow configuration template) for the current experimental scenario; users can quickly generate device connection configuration and task flow configuration through interactive template operations without script development experience; after obtaining the device connection configuration, an experimental directed graph is automatically generated based on the configuration, and the device connection relationship and device initial state in the current scenario are recorded through the directed graph; then, an experimental script corresponding to the task flow configuration is automatically generated according to the experimental directed graph and the basic function library. Through the present invention, on the one hand, the technical threshold of script writing can be reduced, on the other hand, the script generation efficiency can be improved, and on the other hand, the error rate can be reduced and the script quality can be improved.
[0004] To achieve the above object, a first aspect of an embodiment of the present invention provides a method for generating an experimental script based on configuration driving, the method comprising:
[0005] Constructing a basic function library based on the device drivers of all operating devices in a specified experimental scenario; and giving corresponding call interfaces for each function of the basic function library;
[0006] Designing an experimental task configuration template for the specified experimental scenario; the experimental task configuration template includes a device connection configuration template and a task flow configuration template;
[0007] Extracting the corresponding device connection configuration and task flow configuration from the experimental task configuration generated by the user based on the experimental task configuration template;
[0008] Constructing a directed graph based on the device connection configuration to obtain a corresponding experimental directed graph;
[0009] Generate a task-by-task script based on the experimental directed graph, the task flow configuration, and all function call interfaces of the basic function library to obtain the corresponding experimental script;
[0010] Compose a corresponding script execution configuration from the experimental directed graph and the experimental script and save it.
[0011] Preferably, the device names of each experimental device in the specified experimental scenario are unique;
[0012] The types of experimental devices in the specified experimental scenario include containers, syringe pumps, one-way solenoid valves, vacuum pumps, and gas source devices;
[0013] The container includes four inlet and outlet ports, namely the liquid inlet, liquid outlet, vacuum extraction, and gas injection ports;
[0014] The syringe pump includes a liquid inlet, a liquid outlet valve port, and a moving piston; the on / off states of the liquid inlet and outlet valve ports are each controlled by an automatic control device, and the up / down displacement movement state of the moving piston is controlled by another automatic control device; the movement range of the moving piston is the piston position range [0, p max , p max is the corresponding maximum piston position, and the unit of the piston position corresponds to the unit of the liquid volume;
[0015] The one-way solenoid valve includes an air inlet and an air outlet, and the on / off state of the connecting air passage between the air inlet and the air outlet is controlled by an automatic control device;
[0016] The vacuum pump includes an air extraction port, and the start / stop state of the vacuum pump is controlled by an automatic control device;
[0017] The gas source device includes a gas release port, and the gas source device is used to store a type of inert gas and the start / stop state of the device is controlled by an automatic control device;
[0018] The syringe pump, the one-way solenoid valve, the vacuum pump, and the gas source device belong to the operating devices; the device drivers of each operating device are used to perform single-step operation drives on the respective automatic control devices of the current device;
[0019] The basic function library includes a first valve control function, a piston control function, a second valve control function, a vacuum pump control function, a gas source control function, and a system wait function; the call interfaces of each function are the corresponding first valve control interface, piston control interface, second valve control interface, vacuum pump control interface, gas source control interface, and system wait interface;
[0020] The execution environment of the experimental script is consistent with the operating environment of the basic function library; the execution environment of the experimental script is used to load the script execution configuration for automated experimental processing; and during the processing, first initialize the device state of the specified experimental scenario according to the current experimental directed graph, and then complete the current round of experimental operation process by executing the current experimental script; and when executing the current experimental script, regard it as a sub-task script sequence, and sequentially execute the sub-task scripts arranged in sequence in the current sequence; and when executing each sub-task script, regard it as a script sequence, and sequentially execute the synchronous script blocks and single-step operation scripts arranged in sequence in the current sequence; and when executing each synchronous script block, synchronously execute all the single-step operation scripts within the current block; and when executing each single-step operation script, perform single-step control on the specified device through the device driver corresponding to the current script function call interface, obtain the feedback state of this single-step control through the current device driver, and continue to execute the next synchronous script block or the next single-step operation script when the current feedback state is not an abnormal state.
[0021] Preferably, the interface parameters of the first valve control interface include a first device identification parameter, a valve port parameter, and a first valve control parameter; the first device identification parameter is the device name of one of the syringe pumps; the valve port parameter includes port identifiers PT B,1 , PT B,2 ; the port identifiers PT B,1 , PT B,2 are the preset port identifiers of the inlet and outlet liquid valve ports of the syringe pump respectively; the first valve control parameter includes connection and shutdown.
[0022] The first valve control function is used to control the on / off state of the inlet or outlet liquid valve port of the syringe pump corresponding to the first device identification parameter and the valve port parameter according to the first valve control parameter.
[0023] The interface parameters of the piston control interface include a second device identification parameter, a target position parameter, and a maximum flow rate parameter; the second device identification parameter is the device name of one of the syringe pumps; the target position parameter is a piston position within the piston position range [0, p max ; the maximum flow rate parameter is the maximum flow rate of the liquid entering or leaving the pump when the moving piston draws or pushes the liquid.
[0024] The piston control function is used to perform a one-way displacement control on the moving piston of the syringe pump corresponding to the second device identification parameter with the maximum flow rate parameter as the upper speed constraint, the current piston position as the starting position, and the target position parameter as the ending position.
[0025] The interface parameters of the second valve control interface include a third device identification parameter and a second valve control parameter; the third device identification parameter is the device name of one of the one-way solenoid valves; the second valve control parameter includes connection and shutdown;
[0026] The second valve control function is used to control the on / off state of the one-way solenoid valve corresponding to the third device identification parameter according to the second valve control parameter;
[0027] The interface parameters of the vacuum pump control interface include a fourth device identification parameter and a first state control parameter; the fourth device identification parameter is the device name of one of the vacuum pumps; the first state control parameter includes start and stop;
[0028] The vacuum pump control function is used to control the start / stop of the vacuum pump corresponding to the fourth device identification parameter according to the first state control parameter;
[0029] The interface parameters of the gas source device control interface include a fifth device identification parameter and a second state control parameter; the fifth device identification parameter is the device name of one of the gas source devices; the second state control parameter includes start and stop;
[0030] The gas source device control function is used to control the start / stop of the gas source device corresponding to the fifth device identification parameter according to the second state control parameter;
[0031] The interface parameters of the system waiting interface include a waiting duration parameter; the time unit of the waiting duration parameter is seconds;
[0032] The system waiting function is used to pause the script processing flow currently being executed in the experimental script execution environment and continue executing the current script processing flow after the pause duration exceeds the waiting duration parameter.
[0033] Preferably, the basic configuration element of the device connection configuration template is a device configuration element; the device connection configuration template provides functions of element addition, element deletion, element setting / modification, and element set storage / export for the basic configuration element;
[0034] The device configuration element provides at least four configuration interfaces, namely the previous device name configuration interface, the current device name configuration interface, the next device name configuration interface, and the current device parameter configuration interface. The previous, current, and next device name configuration interfaces respectively provide a list of available devices in the specified experimental scenario for the user to select the device name. The current device parameter configuration interface provides a list of device types in the specified experimental scenario for the user to set the current device type and further provides a maximum piston position parameter setting interface for the syringe pump when the current device type is set to the syringe pump, and further provides a list of available inert gases for the user to set the gas type parameter when the current device type is set to the gas source device.
[0035] The basic configuration elements of the task flow configuration template at least include a vacuum-pumping and reinjection task configuration element, a basic pipetting task configuration element, and a system waiting task configuration element. The task flow configuration template provides functions of element addition, element deletion, element setting / modification, element sorting, and element sequence storage / export for the basic configuration elements.
[0036] The vacuum-pumping and reinjection task configuration element provides a first container configuration interface, a first injection gas configuration interface, and a first repetition number configuration interface. The first container configuration interface provides a list of available containers in the specified experimental scenario for the user to select the device name. The first injection gas configuration interface provides a list of available inert gases for the user to select the injection gas type. The first repetition number configuration interface provides a repetition number setting interface for the user.
[0037] The basic pipetting task configuration element provides a first source container configuration interface, a first target container configuration interface, and a first pipetting volume and flow rate configuration interface. The first source container configuration interface and the first target container configuration interface provide a list of available containers in the specified experimental scenario for the user to select the device name. The first pipetting volume and flow rate configuration interface provides a data setting interface for the pipetting volume and pipetting flow rate for the user.
[0038] The system waiting task configuration element provides a waiting duration configuration interface. The waiting duration configuration interface provides a waiting duration setting interface for the user.
[0039] Preferably, the device connection configuration is generated by the device connection configuration template, specifically as a device configuration set composed of multiple first device configurations. Each first device configuration is generated by the device configuration element of the device connection configuration template and corresponds to an experimental device in the specified experimental scenario.
[0040] The first device configuration includes the name of the previous device, the name of the current device, the name of the next device, and the current device parameters; the name of the current device is the name of the current experimental device; when the name of the previous device is not empty, it is the name of the previous experimental device connected to the current experimental device in the specified experimental scenario; when the name of the next device is not empty, it is the name of the next experimental device connected to the current experimental device in the specified experimental scenario; the current device parameters include the current device type; the current device type includes the container, the syringe pump, the one-way solenoid valve, the vacuum pump, and the gas source device; when the current device type is the syringe pump, the current device parameters further include the maximum piston position parameter; when the current device type is the gas source device, the current device parameters further include the gas type parameter;
[0041] The task flow configuration is generated from the task flow configuration template, specifically a sequence of task declarations sorted by multiple task declarations; the types of task declarations at least include the vacuuming - reinjection task declaration, the basic pipetting task declaration, and the system waiting task declaration; each type of task declaration is generated by the corresponding vacuum - reinjection task configuration element, basic pipetting task configuration element, or system waiting task configuration element in the task flow configuration template;
[0042] The vacuuming - reinjection task declaration includes the first container name, the first gas type, and the first repetition number; the first container name is the name of a container; the first gas type is a type of inert gas; the first repetition number is a positive integer;
[0043] The basic pipetting task declaration includes the first source container name, the first target container name, the first pipetting volume, and the first pipetting flow rate; the first source container name and the first target container name are each the name of a container;
[0044] The system waiting task declaration includes the first waiting duration.
[0045] Preferably, the experimental directed graph includes a first node set and a first edge set;
[0046] The first node set includes multiple first nodes n i , 2 ≤ index i ≤ N node , N node is the total number of nodes; each first node n i corresponds to an experimental device in the specified experimental scenario; the node attributes of the first node n i include the device name, device type, device port identifier, and device status;
[0047] The device types include the container, the syringe pump, the one-way solenoid valve, the vacuum pump, and the gas source device;
[0048] When the device type is the container, the device port identifier is a set of identifiers, consisting of four preset port identifiers PT A,1 , PT A,2 , PT A,3 , PT A,4 . The four preset port identifiers respectively correspond one-to-one to the liquid inlet, liquid outlet, vacuum extraction, and gas injection ports of the container; the device status consists of four corresponding port statuses s A,1 , s A,2 , s A,3 , s A,4 . The port statuses s A,1 , s A,2 , s A,3 , s A,4 are all binary states of 0 or 1. A value of 0 indicates that the port corresponding to the current state is in a closed and unused state, and a value of 1 indicates that the port corresponding to the current state is in an open and used state;
[0049] When the device type is the syringe pump, the node attributes further include the maximum piston position p max and the current piston position p; the device port identifier is a set of identifiers, consisting of two preset port identifiers PT B,1 , PT B,2 . The preset port identifiers PT B,1 , PT B,2 respectively correspond one-to-one to the liquid inlet and outlet valve ports of the syringe pump; the device status consists of two corresponding port statuses s B,1 , s B,2 . The port statuses s B,1 , s B,2 are all binary states of 0 or 1. A value of 0 indicates that the port corresponding to the current state is in a shut-off state, and a value of 1 indicates that the port corresponding to the current state is in a connected state;
[0050] When the device type is the one-way solenoid valve, the device port identifier is a set of identifiers, consisting of two preset port identifiers PT C,1 , PT C,2 . The preset port identifiers PT C,1 , PT C,2 respectively correspond one-to-one to the gas inlet and outlet ports of the one-way solenoid valve; the device status is a binary state of 0 or 1. A value of 0 indicates that the current solenoid valve is in a shut-off state, and a value of 1 indicates that the current solenoid valve is in a connected state;
[0051] When the device type is the vacuum pump, the device port identifier is the preset port identifier PT D , corresponding to the air extraction port of the vacuum pump; the device state is a binary state of 0 or 1, where 0 indicates that the current vacuum pump is in a shutdown state and 1 indicates that the current vacuum pump is in a startup state;
[0052] When the device type is the gas source device, the node attribute further includes the gas type, and the gas type is a type of inert gas; the device port identifier is the preset port identifier PT E , corresponding to the air release port of the gas source device; the device state is a binary state of 0 or 1, where 0 indicates that the current gas source device is in a shutdown state and 1 indicates that the current gas source device is in a startup state;
[0053] The first edge set includes a plurality of first edges e j , 1 ≤ index j ≤ N edge , N edge is the total number of edges; the edge attribute of the first edge e j includes the start node and the end node; each of the start and end nodes corresponds to a first node; the start / end node includes the front / rear point device name and the front / rear point port identifier, the front / rear point device name is the device name of the corresponding node, and the front / rear point port identifier is a device port identifier of the corresponding node.
[0054] Preferably, constructing a directed graph based on the device connection configuration to obtain a corresponding experimental directed graph specifically includes:
[0055] Initializing the corresponding first node set with the device parameters of all the first device configurations in the device connection configuration; and initializing the corresponding first edge set according to the front and rear device connection relationships of all the first device configurations and the first node set; and forming an initialized experimental directed graph from the latest first node set and the first edge set.
[0056] Further, initializing the corresponding first node set with the device parameters of all the first device configurations in the device connection configuration specifically includes:
[0057] Regarding each of the first device configurations in the device connection configuration as the corresponding current device configuration; and regarding the current device name and the current device parameters of the current device configuration as the corresponding first name and first device parameters; and regarding the current device type of the current first device parameters as the corresponding first type;
[0058] And creating a corresponding first node n for the current device configuration iAs the corresponding current node;
[0059] And set the device name and device type of the current node to the corresponding first name and first type;
[0060] And identify the current first type;
[0061] If the first type is the container, set the device port identifier of the current node to the identifier set composed of the preset port identifiers PT A,1 、PT A,2 、PT A,3 、PT A,4 ; And set the device status of the current node to the status set composed of the port statuses s A,1 、s A,2 、s A,3 、s A,4 ; And initialize all four port statuses in the current status set to 0;
[0062] If the first type is the syringe pump, extract the maximum piston position parameter from the current first device parameters as the corresponding first position parameter; And set the device port identifier of the current node to the identifier set composed of the preset port identifiers PT B,1 、PT B,2 ; And set the device status of the current node to the status set composed of the port statuses s B,1 、s B,2 ; And initialize both port statuses in the current status set to 0; And set the maximum piston position p max of the current node to the corresponding first position parameter; And set the current piston position p of the current node to 0;
[0063] If the first type is the one-way solenoid valve, set the device port identifier of the current node to the identifier set composed of the preset port identifiers PT C,1 、PT C,2 ; And initialize the device status of the current node to 0;
[0064] If the first type is the vacuum pump, set the device port identifier of the current node to the preset port identifier PT D ; And initialize the device status of the current node to 0;
[0065] If the first type is the gas source device, extract the gas type parameter from the current first device parameters as the corresponding first gas parameter; and set the device port identifier of the current node to the preset port identifier PT E ; and initialize the device status of the current node to 0; and set the gas type of the current node to the corresponding first gas parameter;
[0066] Identify the total number of the first device configurations in the device connection configuration, and set the corresponding total number of nodes N based on the identification result node ; and from the obtained N node first nodes n i constitute the initialized first node set.
[0067] Further, initializing the corresponding first edge set according to the front and rear device connection relationships of all the first device configurations and the first node set specifically includes:
[0068] Form a corresponding first front and rear device pair from the previous device name and the current device name of each of the first device configurations in the device connection configuration, and form a corresponding first front and rear device pair from the current device name and the subsequent device name; and perform duplicate removal processing on all the obtained first front and rear device pairs; the first front and rear device pair includes a front device name and a rear device name; when the first front and rear device pair is composed of a pair of the previous device name and the current device name, the front and rear device names respectively correspond to the previous and current device names; when the first front and rear device pair is composed of a pair of the current device name and the subsequent device name, the front and rear device names respectively correspond to the current and subsequent device names;
[0069] Take each of the deduplicated first front and rear device pairs as the corresponding current device pair; and take the front and rear device names of the current device pair as the corresponding front and rear point device names; and record the first nodes in the first node set corresponding to the front and rear device names as the corresponding front and rear nodes; and take the device types of the front and rear nodes as the corresponding front and rear point device types; and set the corresponding front and rear point port identifiers based on the preset device port connection rule and the front and rear point device types; and form a starting node from the front point device name and the front point port identifier, and form an ending node from the rear point device name and the rear point port identifier; and form a corresponding first edge attribute from the starting and ending nodes; and set a corresponding first edge e for the current device pair jSet the edge attribute of the current edge based on the first edge attribute; and when the previous device type is the container or the syringe pump, reset the port status corresponding to the previous port identifier in the device status of the previous node to 1; and when the next device type is the container or the syringe pump, reset the port status corresponding to the next port identifier in the device status of the next node to 1;
[0070] Identify the total number of the first pairs of front and rear devices after deduplication, and set the corresponding total number of edges N based on the identification result edge ; and by the obtained N edge such first edges e j form the initialized first edge set.
[0071] Further preferably, the device port connection rules include:
[0072] The container cannot be directly connected to the vacuum pump and the gas source device; the syringe pump cannot be connected to the one-way solenoid valve, the vacuum pump and the gas source device; the vacuum pump cannot be connected to the gas source device;
[0073] When the container is connected to the syringe pump, the liquid inlet port of the container can only be connected to the liquid outlet valve port of one syringe pump, and the liquid outlet port of the container can only be connected to the liquid inlet valve port of another syringe pump; reflected in the configuration of the previous and next port identifiers: if the previous and next device types are the container and the syringe pump, the corresponding previous and next port identifiers are the corresponding port identifiers PT A,2 and the port identifier PT B,1 ; if the previous and next device types are the syringe pump and the container, the corresponding previous and next port identifiers are the corresponding port identifiers PT B,2 and the port identifier PT A,1 ;
[0074] When the syringe pump is connected to the syringe pump, the liquid outlet valve port of the previous syringe pump is connected to the liquid inlet valve port of the next syringe pump; reflected in the configuration of the previous and next port identifiers: if the previous and next device types are both syringe pumps, the corresponding previous and next port identifiers are the corresponding port identifiers PT B,2 and the port identifier PT B,1 ;
[0075] When the container is connected to the one-way solenoid valve, if the one-way solenoid valve is currently also connected to a vacuum pump, the evacuation port of the container is connected to the intake port of the current one-way solenoid valve; if the one-way solenoid valve is currently also connected to a gas source device, the gas injection port of the container is connected to the outlet port of the current one-way solenoid valve; reflected in the configuration of the front and rear point port identifiers: if the front and rear point device types are the container and the one-way solenoid valve, and the one-way solenoid valve is currently also connected to a vacuum pump, the front and rear point port identifiers are the port identifier PT A,3 and the port identifier PT C,1 ; if the front and rear point device types are the one-way solenoid valve and the container, and the one-way solenoid valve is currently also connected to a gas source device, the front and rear point port identifiers are the corresponding port identifier PT C,2 and the port identifier PT A,4 ;
[0076] When the one-way solenoid valve is connected to the vacuum pump, the outlet port of the one-way solenoid valve is connected to the air extraction port of the vacuum pump; reflected in the configuration of the front and rear point port identifiers: if the front and rear point device types are the one-way solenoid valve and the vacuum pump, the front and rear point port identifiers are the port identifier PT C,2 and the port identifier PT D ; if the front and rear point device types are the vacuum pump and the one-way solenoid valve, the front and rear point port identifiers are the port identifier PT D and the port identifier PT C,2 ;
[0077] When the one-way solenoid valve is connected to the gas source device, the intake port of the one-way solenoid valve is connected to the air release port of the gas source device; reflected in the configuration of the front and rear point port identifiers: if the front and rear point device types are the one-way solenoid valve and the gas source device, the front and rear point port identifiers are the port identifier PT C,1 and the port identifier PT E ; if the front and rear point device types are the gas source device and the one-way solenoid valve, the front and rear point port identifiers are the port identifier PT E and the port identifier PT C,1 .
[0078] Preferably, generating corresponding experiment scripts by performing per-task script generation processing on all function call interfaces of the experimental directed graph, the task flow configuration, and the basic function library specifically includes:
[0079] Step 111: Take the first task declaration configured in the task flow as the corresponding current task declaration; and initialize the experimental script as empty;
[0080] Step 112: Identify the current task declaration; if the current task declaration is a vacuum - reinjection task declaration, go to Step 113; if the current task declaration is a basic pipetting task declaration, go to Step 114; if the current task declaration is a system waiting task declaration, go to Step 115;
[0081] Step 113: Extract the corresponding first container name, first gas type, and first repetition number from the current task declaration to form a corresponding first parameter group; and perform vacuum - reinjection subtask script generation processing based on the current first parameter group, the experimental directed graph, and the basic function library to obtain a corresponding first subtask script; and go to Step 116;
[0082] Among them, the first subtask script consists of one or more single - step operation scripts;
[0083] Step 114: Extract the corresponding first source container name, first target container name, first pipetting volume, and first pipetting flow rate from the current task declaration to form a corresponding second parameter group; and perform basic pipetting subtask script generation processing based on the current second parameter group, the experimental directed graph, and the basic function library to obtain the corresponding first subtask script; and go to Step 116;
[0084] Step 115: Extract the corresponding first waiting duration from the current task declaration; and set the waiting duration parameter of the system waiting interface to the first waiting duration to obtain a corresponding single - step operation script to form the corresponding first subtask script; and go to Step 116;
[0085] Step 116: Add the current latest first subtask script to the experimental script; and identify whether the current task declaration is the last task declaration configured in the task flow; if not, take the next task declaration in the task flow as the new current task declaration and return to Step 112; if so, output the latest experimental script as the result of this script generation process.
[0086] Further, the performing vacuum - reinjection subtask script generation processing based on the current first parameter group, the experimental directed graph, and the basic function library to obtain a corresponding first subtask script specifically includes:
[0087] Step 1201: Extract the corresponding first container name, first gas type, and first number of repetitions from the first parameter group; and record the first number of repetitions as the number n1.
[0088] Step 1202: Use the first node in the experimental directed graph where the device name matches the first container name as the corresponding current container node; and record the first nodes in the experimental directed graph where the device type is the one-way solenoid valve, the vacuum pump, and the gas source device as the corresponding solenoid valve node, vacuum pump node, and gas source node respectively.
[0089] Step 1203: When it is confirmed that the current container node is connected to a vacuum pump node and another gas source node through two of the solenoid valve nodes respectively, record the device names of the current two solenoid valve nodes as the corresponding air extraction and gas injection valve names respectively, and record the device names of the currently connected vacuum pump node and gas source node as the corresponding air extraction and gas injection device names respectively.
[0090] Step 1204: Set the third device identification parameter of the second valve control interface to the air extraction valve name and the second valve control parameter to connected to obtain a corresponding single-step operation script s1; set the third device identification parameter of the second valve control interface to the gas injection valve name and the second valve control parameter to off to obtain a corresponding single-step operation script s2; and form a synchronization script block denoted as script block b1 from the single-step operation scripts s1 and s2 according to a preset synchronization script block nesting method.
[0091] Among them, when the execution environment of the experimental script executes the synchronization script block, all single-step operation scripts in the block will be executed synchronously.
[0092] Step 1205: Set the fifth device identification parameter of the gas source device control interface to the gas injection device name and the second status control parameter to stop to obtain a corresponding single-step operation script s3; set the fourth device identification parameter of the vacuum pump control interface to the air extraction device name and the first status control parameter to start to obtain a corresponding single-step operation script s4; and form a synchronization script block denoted as script block b2 from the single-step operation scripts s3 and s4 according to the synchronization script block nesting method.
[0093] Step 1206: Set the waiting duration parameter of the system waiting interface to a preset vacuuming duration threshold to obtain a corresponding single-step operation script s5.
[0094] Step 1207, set the third device identification parameter of the second valve control interface to the name of the air extraction valve, and set the second valve control parameter to shut-off to obtain a corresponding single-step operation script s6; and set the third device identification parameter of the second valve control interface to the name of the gas injection valve, and set the second valve control parameter to connected to obtain a corresponding single-step operation script s7; and according to the synchronous script block nesting method, form a synchronous script block composed of the single-step operation scripts s6 and s7 and denote it as script block b3;
[0095] Step 1208, set the fifth device identification parameter of the gas source device control interface to the name of the gas injection device, and set the second state control parameter to start to obtain a corresponding single-step operation script s8; and set the fourth device identification parameter of the vacuum pump control interface to the name of the air extraction device, and set the first state control parameter to stop to obtain a corresponding single-step operation script s9; and according to the synchronous script block nesting method, form a synchronous script block composed of the single-step operation scripts s8 and s9 and denote it as script block b4;
[0096] Step 1209, set the waiting duration parameter of the system waiting interface to a preset gas injection duration threshold to obtain a corresponding single-step operation script s 10 ;
[0097] Step 1210, set the fifth device identification parameter of the gas source device control interface to the name of the gas injection device, and set the second state control parameter to stop to obtain a corresponding single-step operation script s 11 ;
[0098] Step 1211, set the third device identification parameter of the second valve control interface to the name of the gas injection valve, and set the second valve control parameter to shut-off to obtain a corresponding single-step operation script s 12 ;
[0099] Step 1212, form a sequentially executed script sequence S1{b1, b2, s5, b3, b4, s 10 , s 11 , s 12} from the script blocks b1, b2, b3, b4 and the single-step operation scripts s5, s 10 , s 11 , s 12}; and obtain a sequentially executed script sequence S2{S 10 , s 11 , s 12} by copying the script sequence S1{b1, b2, s5, b3, b4, s 1,i} n1 times;
[0100] Among them, 1≤index i≤n1, each script sequence S 1,i All of them are consistent with the script sequence S1{b1,b2,s5,b3,b4,s 10 ,s 11 ,s 12}Stay consistent;
[0101] Step 1213, the script sequence S2{S 1,i} is output as the first subtask script of the vacuuming-re-injection subtask script generation process.
[0102] Furthermore, the basic pipetting subtask script generation process is performed according to the current second parameter group, the experimental directed graph, and the basic function library to obtain the corresponding first subtask script, specifically including:
[0103] Step 1301: extract the corresponding first source container name, first target container name, first pipetting volume, and first pipetting flow rate from the second parameter group;
[0104] Step 1302: record the first node in the experimental directed graph whose device name matches the first source container name and the first target container name as the corresponding current source node and current target node; record the first node in the experimental directed graph whose device type is the injection pump as the corresponding pump node; record each node path from the current source node to the current target node in the experimental directed graph as the corresponding first path; record each first path in which all nodes other than the current source node and the current target node are the pump nodes as the corresponding second path; and record the shortest of the second paths as the current pump chain path; and record the minimum maximum piston position p on the current pump chain path. max as the corresponding single pipetting volume; and calculating the corresponding current number of repetitions n2=ceil(first pipetting volume / single pipetting volume) based on the first pipetting volume and the single pipetting volume, where ceil() is a round-up function; and subtracting 1 from the total number of nodes in the current pump chain path as the corresponding number of pipetting times n3;
[0105] Step 1303: Set the current source node as the corresponding first device node and the first pump node on the current pump chain path as the corresponding second device node; and initialize the index j to 1;
[0106] Step 1304: Use the device names of the first and second device nodes as corresponding first and second device names;
[0107] Step 1305: Identify the first and second device nodes. If the first and second device nodes are the current source node and the pump node, go to Step 1306; if the first and second device nodes are two pump nodes, go to Step 1307; if the first and second device nodes are the pump node and the current target node, go to Step 1308;
[0108] Step 1306: According to the preset flow rate - maximum flow velocity conversion rule, calculate the corresponding first maximum flow velocity based on the first pipetting flow rate and the cross-sectional area of the liquid inlet port of the second device node; and set the first device identification parameter of the first valve control interface to the second device name, the valve port parameter to the port identification PT B,1 , the first valve control parameter to connected to obtain a corresponding single-step operation script s 13 ; and set the first device identification parameter of the first valve control interface to the second device name, the valve port parameter to the port identification PT B,2 , the first valve control parameter to shut off to obtain a corresponding single-step operation script s 14 ; and set the second device identification parameter of the piston control interface to the second device name, the target position parameter to the single pipetting volume, and the maximum flow velocity parameter to the first maximum flow velocity to obtain a corresponding single-step operation script s 15 ; and according to the synchronous script block nesting method, from the single-step operation script s 13 , s 14 to form a synchronous script block denoted as script block b5; and from the script block b5 and the single-step operation script s 15 to form a sequentially executed script sequence S j {b5, s 15}; and go to Step 1309;
[0109] Step 1307: According to the flow rate - maximum flow velocity conversion rule, calculate the corresponding second maximum flow velocity based on the first pipetting flow rate and the cross-sectional area of the liquid outlet port of the first device node, and calculate the corresponding third maximum flow velocity based on the first pipetting flow rate and the cross-sectional area of the liquid inlet port of the second device node; and take the smaller value of the second and third maximum flow velocities as the corresponding fourth maximum flow velocity; and set the first device identification parameter of the first valve control interface to the first device name, the valve port parameter to the port identification PT B,1 , the first valve control parameter to shut off to obtain a corresponding single-step operation script s 16; and set the first device identification parameter of the first valve control interface to the first device name, and set the valve port parameter to the port identification PT B,2 and set the first valve control parameter to connected to obtain a corresponding single-step operation script s 17 ; and set the first device identification parameter of the first valve control interface to the second device name, and set the valve port parameter to the port identification PT B,1 and set the first valve control parameter to connected to obtain a corresponding single-step operation script s 18 ; and set the first device identification parameter of the first valve control interface to the second device name, and set the valve port parameter to the port identification PT B,2 and set the first valve control parameter to shut off to obtain a corresponding single-step operation script s 19 ; and set the second device identification parameter of the piston control interface to the first device name, set the target position parameter to 0, and set the maximum flow rate parameter to the fourth maximum flow rate to obtain a corresponding single-step operation script s 20 ; and set the second device identification parameter of the piston control interface to the second device name, set the target position parameter to the single pipetting volume, and set the maximum flow rate parameter to the fourth maximum flow rate to obtain a corresponding single-step operation script s 21 ; and according to the synchronous script block nesting method, from the single-step operation script s 16 s 17 s 18 s 19 form a synchronous script block denoted as script block b6; and according to the synchronous script block nesting method, from the single-step operation script s 20 s 21 form a synchronous script block denoted as script block b7; and form a sequentially executed script sequence S j {b6, b7}; and go to step 1309;
[0110] Step 1308, according to the flow rate - maximum flow rate conversion rule, calculate the corresponding fifth maximum flow rate according to the first pipetting flow rate and the cross-sectional area of the liquid outlet port of the first device node; and set the first device identification parameter of the first valve control interface to the first device name, and set the valve port parameter to the port identification PT B,1 and set the first valve control parameter to shut off to obtain a corresponding single-step operation script s 22 ; and set the first device identification parameter of the first valve control interface to the first device name, and set the valve port parameter to the port identification PT B,2Set the first valve control parameter to be connected to obtain a corresponding single-step operation script s 23 ; Set the second device identification parameter of the piston control interface to the first device name, set the target position parameter to 0, and set the maximum flow rate parameter to the fifth maximum flow rate to obtain a corresponding single-step operation script s 24 ; And according to the synchronous script block nesting method, from the single-step operation script s 22 、s 23 Form a synchronous script block denoted as script block b8; And from the script block b8 and the single-step operation script s 24 Form a sequentially executed script sequence S j {b8, s 24}; And go to step 1309;
[0111] Step 1309, increment the index j by 1; And identify whether the incremented index j is greater than the pipetting times n3; If so, go to step 1310; If not, use the current second device node as the new first device node, and use the next node of the current first device node on the current pump chain path as the new second device node, and return to step 1304;
[0112] Step 1310, from the obtained n3 script sequences S j Form a sequentially executed script sequence S3{S j} in ascending order of the index j; And obtain a sequentially executed script sequence S4{S j} by copying the script sequence S3{S 3,k} n2 times; 1 ≤ index k ≤ n2, and each script sequence S 3,k Is consistent with the script sequence S3{S j};
[0113] Step 1311, use the script sequence S4{S 3,k} as the first sub-task script generated this time.
[0114] The second aspect of the embodiments of the present invention provides an apparatus for implementing the configuration-driven experimental script generation method described in the first aspect above. The apparatus includes: a function library preparation module, a configuration template preparation module, a task configuration recognition module, a directed graph construction module, a script generation module, and a data saving module;
[0115] The function library preparation module is used to build a basic function library based on the device drivers of all operating devices in a specified experimental scenario; And give corresponding call interfaces to each function of the basic function library;
[0116] The configuration template preparation module is used to design an experimental task configuration template for the specified experimental scenario; the experimental task configuration template includes a device connection configuration template and a task flow configuration template;
[0117] The task configuration recognition module is used to extract the corresponding device connection configuration and task flow configuration from the experimental task configuration generated by the user based on the experimental task configuration template;
[0118] The directed graph construction module is used to construct a directed graph based on the device connection configuration to obtain a corresponding experimental directed graph;
[0119] The script generation module is used to perform per-task script generation processing according to the experimental directed graph, the task flow configuration, and all function call interfaces of the basic function library to obtain a corresponding experimental script;
[0120] The data saving module is used to form a corresponding script execution configuration from the experimental directed graph and the experimental script and save it.
[0121] A third aspect of the embodiments of the present invention provides an electronic device, including: a memory, a processor, and a transceiver;
[0122] The processor is used to be coupled with the memory, read and execute the instructions in the memory to implement the method steps described in the first aspect above;
[0123] The transceiver is coupled with the processor, and the processor controls the transceiver to perform message sending and receiving.
[0124] A fourth aspect of the embodiments of the present invention provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed by a computer, the computer is caused to execute the instructions of the method described in the first aspect above.
[0125] An embodiment of the present invention provides a method, apparatus, electronic device, and computer-readable storage medium for generating an experimental script based on configuration driving. As can be seen from the above content, in the embodiment of the present invention, a basic function library is pre-constructed based on the device drivers of all operating devices in the experimental scenario, and a visual experimental task configuration template (device connection configuration template, task flow configuration template) is customized for the current experimental scenario; even without script development experience, users can quickly generate device connection configurations and task flow configurations through interactive template operations; after obtaining the device connection configuration, an experimental directed graph is automatically generated based on this configuration, and the device connection relationships and initial device states in the current scenario are recorded through this directed graph; then, an experimental script corresponding to the task flow configuration is automatically generated according to the experimental directed graph and the basic function library. Through the embodiment of the present invention, the technical threshold for script writing is reduced, the script generation efficiency is improved, the writing error rate is reduced, and the script quality is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0126] Figure 1 FIG. is a schematic diagram of a method for generating an experimental script based on configuration driving provided by Embodiment 1 of the present invention;
[0127] Figure 2 FIG. is a schematic diagram of experimental equipment provided by Embodiment 1 of the present invention;
[0128] Figure 3 FIG. is a schematic diagram of node and edge attributes provided by Embodiment 1 of the present invention;
[0129] Figure 4 FIG. is a schematic diagram of an example of device connection and an example of an experimental directed graph provided by Embodiment 1 of the present invention;
[0130] Figure 5 FIG. is a module structure diagram of an apparatus for generating an experimental script based on configuration driving provided by Embodiment 2 of the present invention;
[0131] Figure 6 FIG. is a schematic diagram of the structure of an electronic device provided by Embodiment 3 of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0132] In order to make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0133] Embodiment 1 of the present invention provides a method for generating an experimental script based on configuration driving, as Figure 1As shown in the schematic diagram of a configuration-driven experimental script generation method provided in the first embodiment of the present invention, the method mainly includes the following steps:
[0134] Step 1: Construct a basic function library based on the device drivers of all operating devices in the specified experimental scenario; and provide corresponding call interfaces for each function in the basic function library.
[0135] Here, the specified experimental scenario in the embodiment of the present invention is a fixed scenario where the experimental equipment has been pre-installed and connected; the device name of each experimental device in this specified experimental scenario is unique.
[0136] The types of experimental equipment in the specified experimental scenario include at least five categories: containers, syringe pumps, one-way solenoid valves, vacuum pumps, and gas source devices. Among them:
[0137] 1) As Figure 2 shown in the schematic diagram of the experimental equipment provided in the first embodiment of the present invention, the container in the embodiment of the present invention includes four inlet and outlet ports, namely the liquid inlet, liquid outlet, vacuum extraction, and gas injection ports;
[0138] 2) As Figure 2 shown, the syringe pump in the embodiment of the present invention includes a liquid inlet, a liquid outlet valve port, and a moving piston; the on / off states of the liquid inlet and outlet valve ports are each controlled by an automatic control device, and the up and down displacement movement state of the moving piston is controlled by another automatic control device; the movement range of the moving piston is the piston position range [0, p max , p max is the corresponding maximum piston position, and the unit of the piston position corresponds to the unit of the liquid volume;
[0139] 3) As Figure 2 shown, the one-way solenoid valve in the embodiment of the present invention includes an air inlet and an air outlet port; the on / off states of the air inlet and outlet ports connecting the air channels are controlled by an automatic control device;
[0140] 4) As Figure 2 shown, the vacuum pump in the embodiment of the present invention includes an air extraction port, and the start / stop state of the vacuum pump is controlled by an automatic control device;
[0141] 5) As Figure 2 shown, the gas source device in the embodiment of the present invention includes a gas release port; the gas source device is used to store a type of inert gas and the start / stop state of the device is controlled by an automatic control device; the inert gases mentioned in the embodiment of the present invention are usually air, nitrogen, argon, helium, etc., and can be specifically configured based on experimental requirements.
[0142] In the embodiments of the present invention, an injection pump, a one-way solenoid valve, a vacuum pump, and a gas source device belong to operating devices; the device drivers of each operating device are used to perform single-step operation driving on each automatic control device of the current device.
[0143] The library functions of the basic function library in the embodiments of the present invention at least include a first valve control function, a piston control function, a second valve control function, a vacuum pump control function, a gas source control function, and a system waiting function; the call interfaces of each function are respectively the corresponding first valve control interface, piston control interface, second valve control interface, vacuum pump control interface, gas source control interface, and system waiting interface. The interface parameters of each interface and their corresponding function functions are as follows.
[0144] 1) First valve control interface and first valve control function:
[0145] The interface parameters of the first valve control interface include a first device identification parameter, a valve port parameter, and a first valve control parameter; among them, the first device identification parameter is the device name of an injection pump; the valve port parameter includes port identifiers PT B,1 , PT B,2 ; the port identifiers PT B,1 , PT B,2 are respectively the preset port identifiers of the inlet and outlet liquid valve ports of the injection pump; the first valve control parameter includes connection and shutdown;
[0146] The first valve control function is used to control the on / off state of the inlet or outlet liquid valve port of the injection pump corresponding to the first device identification parameter and the valve port parameter according to the first valve control parameter.
[0147] 2) Piston control interface and piston control function:
[0148] The interface parameters of the piston control interface include a second device identification parameter, a target position parameter, and a maximum flow rate parameter; among them, the second device identification parameter is the device name of an injection pump; the target position parameter is a piston position within the piston position range [0, p max ; the maximum flow rate parameter is the maximum flow rate of the liquid entering / leaving the pump when the moving piston extracts or pushes the liquid;
[0149] The piston control function is used to perform a one-way displacement control on the moving piston of the injection pump corresponding to the second device identification parameter with the maximum flow rate parameter as the upper limit speed constraint, the current piston position as the starting position, and the target position parameter as the ending position.
[0150] 3) Second valve control interface and second valve control function:
[0151] The interface parameters of the second valve control interface include a third device identification parameter and a second valve control parameter; among them, the third device identification parameter is the device name of a one-way solenoid valve; the second valve control parameter includes connection and disconnection;
[0152] The second valve control function is used to control the on / off state of the one-way solenoid valve corresponding to the third device identification parameter according to the second valve control parameter.
[0153] 4) Vacuum pump control interface and vacuum pump control function:
[0154] The interface parameters of the vacuum pump control interface include a fourth device identification parameter and a first state control parameter; among them, the fourth device identification parameter is the device name of a vacuum pump; the first state control parameter includes start and stop;
[0155] The vacuum pump control function is used to control the start / stop of the vacuum pump corresponding to the fourth device identification parameter according to the first state control parameter.
[0156] 5) Gas source equipment control interface and gas source equipment control function:
[0157] The interface parameters of the gas source equipment control interface include a fifth device identification parameter and a second state control parameter; among them, the fifth device identification parameter is the device name of a gas source equipment; the second state control parameter includes start and stop;
[0158] The gas source equipment control function is used to control the start / stop of the gas source equipment corresponding to the fifth device identification parameter according to the second state control parameter.
[0159] 6) System waiting interface:
[0160] The interface parameters of the system waiting interface include a waiting duration parameter; among them, the time unit of the waiting duration parameter is seconds;
[0161] The system waiting function is used to pause the script processing flow currently executed in the experimental script execution environment and continue to execute the current script processing flow after the pause duration exceeds the waiting duration parameter.
[0162] It should be noted that the execution environment of the experimental script is consistent with the running environment of the basic function library; the execution environment of the experimental script is used to load the script execution configuration for automated experiment processing; and during the processing, first initialize the device state of the specified experimental scenario according to the current experimental directed graph, and then complete the current round of experiment operation process by executing the current experimental script; and when executing the current experimental script, regard it as a sub-task script sequence, and sequentially execute the sub-task scripts arranged in sequence in the current sequence; and when executing each sub-task script, regard it as a script sequence, and sequentially execute the synchronous script blocks and single-step operation scripts arranged in sequence in the current sequence; and when executing each synchronous script block, synchronously execute all the single-step operation scripts in the current block; and when executing each single-step operation script, perform single-step control on the specified device through the device driver corresponding to the current script function call interface, and obtain the feedback status of this single-step control through the current device driver, and continue to execute the next synchronous script block or the next single-step operation script when the current feedback status is not an abnormal state.
[0163] The embodiments of the present invention do not limit the specific script format or script syntax of the experimental script, but require that the execution environment of the experimental script must support single-step operation scripts, synchronous script blocks, sequential script execution logic, and parallel script execution logic, and correspondingly, the single-step operation script separator and the synchronous script block nesting method should also be given. Specifically, a single-step operation script is a text of a basic function library call interface with clear parameter settings. Specifically, a synchronous script block is a text block with multiple single-step operation scripts embedded inside. Specifically, the sequential script execution logic means that the next single-step operation script / synchronous script block can be executed only after the previous single-step operation script / synchronous script block is executed and a successful execution feedback is obtained. Specifically, the parallel script execution logic means that multiple single-step operation scripts in the current synchronous script block can be executed concurrently, and the next single-step operation script / synchronous script block can be executed only after all the concurrent single-step operation scripts are executed and all are executed successfully.
[0164] Specifically, the single-step operation script separator is one or a pair of formatted text symbols for separating single-step operation scripts, or a standard syntax text.
[0165] For example, if the left and right curly braces “{” and “}” are used as the single-step operation script separator, then the writing format of the single-step operation script is:
[0166] “{
[0167] Single-step operation script
[0168] }”.
[0169] The synchronous script block nesting method specifically refers to one or a pair of formatting text symbols for embedding multiple single-step operation scripts, or a section of standard syntax text.
[0170] For example, if the left and right square brackets "[", "]" are used as the synchronous script block nesting symbols, then the writing format of the synchronous script block is as follows:
[0171]
[0172] Step 2: Design an experimental task configuration template for the specified experimental scenario.
[0173] Here, the experimental task configuration template of the embodiment of the present invention is a visualized configuration module, which is configured through an interactive method. The experimental task configuration template includes a device connection configuration template and a task flow configuration template, and the template descriptions are as follows.
[0174] 1) Device connection configuration template:
[0175] The basic configuration elements of the device connection configuration template at least include device configuration elements; and the device connection configuration template provides functions of element addition, element deletion, element setting / modification, and element set storage / export for all basic configuration elements.
[0176] The device configuration elements provide at least four configuration interfaces, namely the previous device name configuration interface, the current device name configuration interface, the next device name configuration interface, and the current device parameter configuration interface; among them, the previous, current, and next device name configuration interfaces respectively provide a list of available devices in the specified experimental scenario for the user to select the device name; the current device parameter configuration interface provides a list of device types in the specified experimental scenario for the user to set the current device and the device type, and further provides a maximum piston position parameter setting interface for the syringe pump when the current device type is set to the syringe pump, and further provides a list of available inert gases for the user to set the gas type parameter when the current device type is set to the gas source device.
[0177] 1) Task flow configuration template:
[0178] The basic configuration elements of the task flow configuration template at least include a vacuum extraction-reinjection task configuration element, a basic pipetting task configuration element, and a system waiting task configuration element; and the task flow configuration template provides functions of element addition, element deletion, element setting / modification, element sorting, and element sequence storage / export for all basic configuration elements.
[0179] The vacuum extraction - reinjection task configuration element provides a first container configuration interface, a first injection gas configuration interface, and a first repetition number configuration interface. Among them, the first container configuration interface provides a list of available containers in the specified experimental scenario for the user to select the device name. The first injection gas configuration interface provides a list of available inert gases for the user to select the injection gas type. The first repetition number configuration interface provides a repetition number setting interface for the user.
[0180] The basic pipetting task configuration element provides a first source container configuration interface, a first target container configuration interface, and a first pipetting volume and flow rate configuration interface. Among them, the first source container configuration interface and the first target container configuration interface provide a list of available containers in the specified experimental scenario for the user to select the device name. The first pipetting volume and flow rate configuration interface provides a data setting interface for the user to set the pipetting volume and the pipetting flow rate.
[0181] The system waiting task configuration element provides a waiting duration configuration interface. Among them, the waiting duration configuration interface provides a waiting duration setting interface for the user.
[0182] Step 3: Extract the corresponding device connection configuration and task flow configuration from the experimental task configuration generated by the user based on the experimental task configuration template.
[0183] Here, the experimental task configuration generated by the embodiments of the present invention based on the experimental task configuration template includes a device connection configuration and a task flow configuration.
[0184] The device connection configuration is generated by a device connection configuration template, specifically a device configuration set, and this set consists of multiple first device configurations. Each first device configuration is generated by the device configuration element of the device connection configuration template and corresponds to an experimental device in the specified experimental scenario.
[0185] The first device configuration includes the name of the previous device, the name of the current device, the name of the next device, and the current device parameters. Among them, the name of the current device is the device name of the current experimental device. When the name of the previous device is not empty, it is the device name of the previous experimental device connected to the current experimental device in the specified experimental scenario. When the name of the next device is not empty, it is the device name of the next experimental device connected to the current experimental device in the specified experimental scenario. The current device parameters include the current device type. The current device type includes a container, an injection pump, a one - way solenoid valve, a vacuum pump, and a gas source device. When the current device type is an injection pump, the current device parameters further include a maximum piston position parameter. When the current device type is a gas source device, the current device parameters further include a gas type parameter.
[0186] The task flow configuration is generated from a task flow configuration template, specifically as a sequence of task declarations, which is sorted by multiple task declarations. The types of task declarations include at least a vacuum evacuation - reinjection task declaration, a basic pipetting task declaration, and a system waiting task declaration; each type of task declaration is generated by the corresponding vacuum - reinjection task configuration element, basic pipetting task configuration element, or system waiting task configuration element in the task flow configuration template.
[0187] The vacuum evacuation - reinjection task declaration includes a first container name, a first gas type, and a first repetition count; wherein, the first container name is the device name of a container; the first gas type is a type of inert gas; the first repetition count is a positive integer.
[0188] The basic pipetting task declaration includes a first source container name, a first target container name, a first pipetting volume, and a first pipetting flow rate; wherein, the first source container name and the first target container name are each the device name of a container.
[0189] The system waiting task declaration includes a first waiting duration.
[0190] Step 4: Based on the device connection configuration, construct a directed graph to obtain the corresponding experimental directed graph.
[0191] Here, the experimental directed graph of the embodiment of the present invention includes a first node set and a first edge set.
[0192] The first node set includes multiple first nodes n i , 2 ≤ index i ≤ N node , N node is the total number of nodes; each first node n i corresponds to an experimental device in a specified experimental scenario.
[0193] The first node n i has node attributes including device name, device type, device port identifier, and device status, as Figure 3 shown in the schematic diagram of node and edge attributes provided in Embodiment 1 of the present invention; wherein:
[0194] 1) The device types include containers, syringe pumps, one - way solenoid valves, vacuum pumps, and gas source devices;
[0195] 2) When the device type is a container, the device port identifier is a set of identifiers, composed of four preset port identifiers PT A,1 , PT A,2 , PT A,3 , PT A,4 ; these four preset port identifiers correspond one - to - one with the liquid inlet, liquid outlet, vacuum evacuation, and gas injection ports of the container respectively; the device status is determined by the corresponding four port statuses s A,1 , sA,2 , s A,3 , s A,4 It consists of; the port status s A,1 , s A,2 , s A,3 , s A,4 All are binary states of 0 or 1. A value of 0 indicates that the corresponding port of the current state is in a closed and unused state, and a value of 1 indicates that the corresponding port of the current state is in a closed and unused state;
[0196] Here it should be noted that PT A,1 , PT A,2 , PT A,3 , PT A,4 are four preset identification information and can be customized based on application requirements; for example, set PT A,1 , PT A,2 , PT A,3 , PT A,4 to 1, 2, 3, 4;
[0197] 3) When the device type is an infusion pump, the node attributes also include the maximum piston position p max and the current piston position p; the device port identifier is an identifier set and consists of two preset port identifiers PT B,1 , PT B,2 ; these two preset port identifiers PT B,1 , PT B,2 correspond to the inlet and outlet valve ports of the infusion pump one by one; the device status is composed of the corresponding two port statuses s B,1 , s B,2 ; the port status s B,1 , s B,2 are both binary states of 0 or 1. A value of 0 indicates that the corresponding port of the current state is in an off state, and a value of 1 indicates that the corresponding port of the current state is in a connected state;
[0198] Here it should be noted that PT B,1 , PT B,2 are two preset identification information and can be customized based on application requirements; for example, set PT B,1 , PT B,2 to 1, 2;
[0199] 4) When the device type is a one-way solenoid valve, the device port identifier is an identifier set and consists of two preset port identifiers PT C,1 , PT C,2 ; these two preset port identifiers PT C,1 , PT C,2They respectively correspond one-to-one to the inlet and outlet ports of the one-way solenoid valve; the device status is a binary state of 0 or 1, where 0 indicates that the current solenoid valve is in the off state and 1 indicates that the current solenoid valve is in the connected state;
[0200] It should be noted here that PT C,1 , PT C,2 are two pre-set identification information and can be customized based on application requirements; for example, PT C,1 , PT C,2 are set to 1 and 2;
[0201] 5) When the device type is a vacuum pump, the device port identifier is the pre-set port identifier PT D , which corresponds to the air extraction port of the vacuum pump; the device status is a binary state of 0 or 1, where 0 indicates that the current vacuum pump is in the shutdown state and 1 indicates that the current vacuum pump is in the startup state;
[0202] It should be noted here that PT D is a pre-set identification information and can be customized based on application requirements; for example, PT D is set to 1;
[0203] 6) When the device type is a gas source device, the node attribute further includes the gas type, and the gas type is a type of inert gas; the device port identifier is the pre-set port identifier PT E , which corresponds to the air release port of the gas source device; the device status is a binary state of 0 or 1, where 0 indicates that the current gas source device is in the shutdown state and 1 indicates that the current gas source device is in the startup state.
[0204] It should be noted here that PT E is a pre-set identification information and can be customized based on application requirements; for example, PT E is set to 1.
[0205] The first edge set includes multiple first edges e j , 1 ≤ index j ≤ N edge , where N edge is the total number of edges; the edge attributes of the first edge e j include the start node and the end node, as shown in Figure 3 ; among them, the start and end nodes each correspond to a first node; the start / end node includes the front / back point device name and the front / back point port identifier, and the front / back point device name is the device name of the corresponding node, and the front / back point port identifier is a device port identifier of the corresponding node.
[0206] The experimental directed graph of the embodiment of the present invention is used to record the connection relationship of experimental equipment and the initial state of the experiment. Initializing the experimental scenario based on this directed graph can reduce the error rate of the experiment, and this directed graph can also provide a reference for equipment connection during the script generation process in step 5 below.
[0207] The specific content of the current step 4 includes:
[0208] Step 41, initialize the corresponding first node set based on the device parameters of all the first device configurations in the device connection configuration;
[0209] Specifically, it includes: Step 411, regard each first device configuration in the device connection configuration as the corresponding current device configuration; and regard the current device name and current device parameters of the current device configuration as the corresponding first name and first device parameters; and regard the current device type of the current first device parameters as the corresponding first type;
[0210] Step 412, and create a corresponding first node n for the current device configuration i as the corresponding current node;
[0211] Step 413, and set the device name and device type of the current node as the corresponding first name and first type;
[0212] Step 414, and identify the current first type;
[0213] Step 415, if the first type is a container, set the device port identifier of the current node as the identifier set composed of the preset port identifiers PT A,1 PT A,2 PT A,3 PT A,4 ; and set the device state of the current node as the state set composed of the port states s A,1 s A,2 s A,3 s A,4 ; and initialize all four port states in the current state set to 0;
[0214] Step 416, if the first type is an injection pump, extract the maximum piston position parameter from the current first device parameters as the corresponding first position parameter; and set the device port identifier of the current node as the identifier set composed of the preset port identifiers PT B,1 PT B,2 ; and set the device state of the current node as the state set composed of the port states s B,1 s B,2 ; and initialize both port states in the current state set to 0; and set the maximum piston position p of the current node maxSet it as the corresponding first position parameter; and set the current piston position p of the current node to 0;
[0215] Step 417, if the first type is a one-way solenoid valve, set the device port identifier of the current node to the identifier set composed of the preset port identifiers PT C,1 、PT C,2 ; and initialize the device status of the current node to 0;
[0216] Step 418, if the first type is a vacuum pump, set the device port identifier of the current node to the preset port identifier PT D ; and initialize the device status of the current node to 0;
[0217] Step 419, if the first type is a gas source device, extract the gas type parameter from the current first device parameter as the corresponding first gas parameter; and set the device port identifier of the current node to the preset port identifier PT E ; and initialize the device status of the current node to 0; and set the gas type of the current node to the corresponding first gas parameter;
[0218] Step 420, identify the total number of the first device configurations in the device connection configuration, and set the corresponding total number of nodes N based on the identification result node ; and from the obtained N node first nodes n i form an initialized first node set;
[0219] Step 42, and initialize the corresponding first edge set according to the front and rear device connection relationships of all the first device configurations and the first node set;
[0220] Specifically including: Step 421, form a corresponding first front and rear device pair by the previous device name and the current device name of each first device configuration in the device connection configuration, and form a corresponding first front and rear device pair by the current device name and the subsequent device name; and perform duplicate removal processing on all the obtained first front and rear device pairs;
[0221] Among them, the first front and rear device pair includes a front device name and a rear device name; when the first front and rear device pair is composed of a pair of a previous device name and a current device name, the front and rear device names respectively correspond to the previous and current device names; when the first front and rear device pair is composed of a pair of a current device name and a subsequent device name, the front and rear device names respectively correspond to the current and subsequent device names;
[0222] Step 422: Take each pair of the first front and rear devices after duplicate removal as the corresponding current device pair; take the front and rear device names of the current device pair as the corresponding front and rear point device names; take the first nodes in the first node set corresponding to the front and rear device names as the corresponding front and rear nodes; take the device types of the front and rear nodes as the corresponding front and rear point device types; set the corresponding front and rear point port identifiers based on the preset device port connection rules and the front and rear point device types; form a starting node composed of the front point device name and the front point port identifier, and form an ending node composed of the rear point device name and the rear point port identifier; form a corresponding first edge attribute from the starting and ending nodes; and set a corresponding first edge e for the current device pair j As the current edge, set the edge attribute of the current edge based on the first edge attribute; when the front point device type is a container or an injection pump, reset the port status corresponding to the front point port identifier in the device status of the front node to 1; when the rear point device type is a container or an injection pump, reset the port status corresponding to the rear point port identifier in the device status of the rear node to 1;
[0223] Here, the device port connection rules in the embodiments of the present invention include:
[0224] Rule a: A container cannot be directly connected to a vacuum pump and a gas source device; an injection pump cannot be connected to a one-way solenoid valve, a vacuum pump, and a gas source device; a vacuum pump cannot be connected to a gas source device;
[0225] Rule b: When a container is connected to an injection pump, the liquid inlet port of the container can only be connected to the liquid outlet valve port of one injection pump, and the liquid outlet port of the container can only be connected to the liquid inlet valve port of another injection pump; Rule b is reflected in the configuration of the front and rear point port identifiers. Specifically, if the front and rear point device types are a container and an injection pump, the corresponding front and rear point port identifiers are the corresponding port identifiers PT A,2 and port identifier PT B,1 ; if the front and rear point device types are an injection pump and a container, the corresponding front and rear point port identifiers are the corresponding port identifiers PT B,2 and port identifier PT A,1 ;
[0226] Rule c: When an injection pump is connected to an injection pump, the liquid outlet valve port of the previous injection pump is connected to the liquid inlet valve port of the next injection pump; Rule c is reflected in the configuration of the front and rear point port identifiers. Specifically, if the front and rear point device types are both injection pumps, the corresponding front and rear point port identifiers are the corresponding port identifiers PT B,2 and port identifier PT B,1 ;
[0227] Rule d: When the container is connected to the one-way solenoid valve, if the current one-way solenoid valve is also connected to a vacuum pump, the vacuum pumping port of the container is connected to the intake port of the current one-way solenoid valve; if the current one-way solenoid valve is also connected to a gas source device, the gas injection port of the container is connected to the outlet port of the current one-way solenoid valve. Rule d is reflected in the configuration of the front and rear point port identifiers, specifically: if the front and rear point device types are a container and a one-way solenoid valve, and the current one-way solenoid valve is also connected to a vacuum pump, the front and rear point port identifiers are port identifier PT A,3 and port identifier PT C,1 ; if the front and rear point device types are a one-way solenoid valve and a container, and the current one-way solenoid valve is also connected to a gas source device, the front and rear point port identifiers are the corresponding port identifier PT C,2 and port identifier PT A,4 ;
[0228] Rule e: When the one-way solenoid valve is connected to the vacuum pump, the outlet port of the one-way solenoid valve is connected to the air extraction port of the vacuum pump. Rule e is reflected in the configuration of the front and rear point port identifiers, specifically: if the front and rear point device types are a one-way solenoid valve and a vacuum pump, the front and rear point port identifiers are port identifier PT C,2 and port identifier PT D ; if the front and rear point device types are a vacuum pump and a one-way solenoid valve, the front and rear point port identifiers are port identifier PT D and port identifier PT C,2 ;
[0229] Rule f: When the one-way solenoid valve is connected to the gas source device, the intake port of the one-way solenoid valve is connected to the air release port of the gas source device. Rule f is reflected in the configuration of the front and rear point port identifiers, specifically: if the front and rear point device types are a one-way solenoid valve and a gas source device, the front and rear point port identifiers are port identifier PT C,1 and port identifier PT E ; if the front and rear point device types are a gas source device and a one-way solenoid valve, the front and rear point port identifiers are port identifier PT E and port identifier PT C,1 ;
[0230] Step 423, identify the total number of the first front and rear device pairs after duplicate removal, and set the corresponding total number of edges N based on the identification result edge ; and from the obtained N edge first edges e j form the initialized first edge set;
[0231] Step 43, and form the corresponding experimental directed graph from the latest first node set and the first edge set.
[0232] For example, it is known that a certain device connection configuration example includes 10 first device configurations as follows:
[0233] First device configuration 1: The name of the previous device is empty, the name of the current device = Container A1, the name of the subsequent device = Syringe pump B1, current device parameters {current device type = container};
[0234] First device configuration 2: The name of the previous device = Container A1, the name of the current device = Syringe pump B1, the name of the subsequent device = Container A2, current device parameters {current device type = syringe pump, maximum piston position parameter = V};
[0235] First device configuration 3: The name of the previous device = Syringe pump B1, the name of the current device = Container A2, the name of the subsequent device = Syringe pump B2, current device parameters {current device type = container};
[0236] First device configuration 4: The name of the previous device = Container A2, the name of the current device = Syringe pump B2, the name of the subsequent device = Syringe pump B3, current device parameters {current device type = syringe pump, maximum piston position parameter = V};
[0237] First device configuration 5: The name of the previous device = Syringe pump B2, the name of the current device = Syringe pump B3, the name of the subsequent device = Container A3, current device parameters {current device type = syringe pump, maximum piston position parameter = V};
[0238] First device configuration 6: The name of the previous device = Syringe pump B3, the name of the current device = Container A3, the name of the subsequent device = One-way solenoid valve C1, current device parameters {current device type = container};
[0239] First device configuration 7: The name of the previous device = Container A3, the name of the current device = One-way solenoid valve C1, the name of the subsequent device = Vacuum pump D, current device parameters {current device type = one-way solenoid valve};
[0240] First device configuration 8: The name of the previous device = One-way solenoid valve C1, the name of the current device = Vacuum pump D, the name of the subsequent device is empty, current device parameters {current device type = vacuum pump};
[0241] First device configuration 9: The name of the previous device is empty, the name of the current device = Gas source device E, the name of the subsequent device = One-way solenoid valve C2, current device parameters {current device type = gas source device, gas type parameter = air};
[0242] First device configuration 10: The name of the previous device = Gas source device E, the name of the current device = One-way solenoid valve C2, the name of the subsequent device = Container A3, current device parameters {current device type = one-way solenoid valve};
[0243] Then, the device connection example corresponding to the above device connection configuration example and the experimental directed graph example generated according to the above device connection configuration example are as follows Figure 4 shown in the schematic diagram of the device connection example and the experimental directed graph example provided in the first embodiment of the present invention.
[0244] Step 5: Perform per-task script generation processing based on all function call interfaces of the experimental directed graph, task flow configuration, and basic function library to obtain the corresponding experimental script;
[0245] Specifically, it includes: Step 51: Use the first task declaration of the task flow configuration as the corresponding current task declaration; and initialize the experimental script to be empty;
[0246] Step 52: Identify the current task declaration; if the current task declaration is a vacuum-pumping and reinjection task declaration, go to Step 53; if the current task declaration is a basic pipetting task declaration, go to Step 54; if the current task declaration is a system waiting task declaration, go to Step 55;
[0247] Here, the task declaration in the embodiment of the present invention can be regarded as a basic configuration for generating a dynamic script; the embodiment of the present invention gives two types of basic task declarations: vacuum-pumping and reinjection task declaration and basic pipetting task declaration;
[0248] The vacuum-pumping and reinjection task declaration is a task configuration text for gas-washing a specified container (designated by the first container name) a specified number of times (the first repetition number) using a specified gas (designated by the first gas type);
[0249] The basic pipetting task declaration is a task configuration text for pipetting a specified volume (designated by the first pipetting volume) from a specified source container (designated by the first source container name) to a specified target container (designated by the first target container name), and restricting the pipetting speed by specifying the flow rate (the first pipetting flow rate); if there are multiple pump chains that can reach from the specified source container to the specified target container, the shortest pump chain will be selected, and a pump chain is a pipetting transmission chain formed by sequentially connecting one or more syringe pumps;
[0250] It should be noted that in the embodiment of the present invention, based on these two basic pipetting task declarations, various other task declarations can be further combined. For example, a composite task declaration of pipetting first and then gas-washing can be formed by sequentially sorting a basic pipetting task declaration and a vacuum-pumping and reinjection task declaration. Another example is that a composite task declaration of pipetting first, then liquid-washing, and then gas-washing can be formed by sequentially sorting two basic pipetting task declarations and a vacuum-pumping and reinjection task declaration;
[0251] It should also be noted that when generating a script based on a task statement in the embodiments of the present invention, an operation script with sequential operations device by device and step by step will be automatically generated according to the device connection relationship provided by the experimental directed graph. When the operation object of the same type of task statement changes, the generated script will also change dynamically;
[0252] For example, taking Figure 4 as an example, if the pipetting task statement X is used to specify pipetting from container A1 to A2, then the generated script will consist of the following steps: first, synchronously call the first valve control interface to synchronously open and close the liquid inlet and outlet valve ports of syringe pump B1; then, call the piston control interface to control the moving piston of syringe pump B1 to move upward once from piston position 0, so as to achieve the effect of pumping liquid from container A1; then, synchronously call the first valve control interface to synchronously close and open the liquid inlet and outlet valve ports of syringe pump B1; then, call the piston control interface to control the moving piston of syringe pump B1 to move once from the current piston position to piston position 0, so as to achieve the effect of injecting liquid into container A2;
[0253] If the pipetting task statement X is used to specify pipetting from container A2 to A3, then the generated script will consist of the following steps: first, synchronously call the first valve control interface to synchronously open and close the liquid inlet and outlet valve ports of syringe pump B2; then, call the piston control interface to control the moving piston of syringe pump B2 to move upward once from piston position 0, so as to achieve the effect of pumping liquid from container A2; then, synchronously call the first valve control interface to synchronously close and open the liquid inlet and outlet valve ports of syringe pump B2, and synchronously open and close the liquid inlet and outlet valve ports of syringe pump B3; then, synchronously call the piston control interface to control the moving piston of syringe pump B2 to move once from the current piston position to piston position 0, control the moving piston of syringe pump B3 to move upward once from piston position 0, so as to achieve the effect of pipetting from syringe pump B2 to B3; then, synchronously call the first valve control interface to synchronously close and open the liquid inlet and outlet valve ports of syringe pump B3; then, call the piston control interface to control the moving piston of syringe pump B3 to move once from the current piston position to piston position 0, so as to achieve the effect of injecting liquid into container A3;
[0254] Step 53: Extract the corresponding first container name, first gas type, and first repetition number from the current task statement to form a corresponding first parameter group; and perform vacuuming - reinjection subtask script generation processing according to the current first parameter group, experimental directed graph, and basic function library to obtain a corresponding first subtask script; and go to step 56;
[0255] Among them, the first subtask script consists of one or more single - step operation scripts;
[0256] In the embodiments of the present invention, according to the current first parameter group, the experimental directed graph, and the basic function library, vacuum pumping - reinjection subtask script generation processing is performed to obtain the corresponding first subtask script, specifically including:
[0257] Step A - 1: Extract the corresponding first container name, first gas type, and first repetition number from the first parameter group; and record the first repetition number as the number n1.
[0258] Step A - 2: Use the first node in the experimental directed graph whose device name matches the first container name as the corresponding current container node; and record the first nodes in the experimental directed graph whose device types are one - way solenoid valves, vacuum pumps, and gas source devices as the corresponding solenoid valve node, vacuum pump node, and gas source node respectively.
[0259] Step A - 3: When it is confirmed that the current container node is connected to a vacuum pump node and another gas source node through two solenoid valve nodes respectively, record the device names of the current two solenoid valve nodes as the corresponding air extraction and gas injection valve names respectively, and record the device names of the currently connected vacuum pump node and gas source node as the corresponding air extraction and gas injection device names respectively.
[0260] Step A - 4: Set the third device identification parameter of the second valve control interface to the air extraction valve name and the second valve control parameter to connected to obtain a corresponding single - step operation script s1; and set the third device identification parameter of the second valve control interface to the gas injection valve name and the second valve control parameter to shut off to obtain a corresponding single - step operation script s2; and according to the preset synchronous script block nesting method, form a synchronous script block from the single - step operation scripts s1 and s2, denoted as script block b1.
[0261] As shown above, when the execution environment of the experimental script executes the synchronous script block, all single - step operation scripts in the block will be executed synchronously, that is, when the execution environment of the experimental script executes the synchronous script block b1, the single - step operation scripts s1 and s2 in the block will be executed synchronously.
[0262] Step A - 5: Set the fifth device identification parameter of the gas source device control interface to the gas injection device name and the second status control parameter to stop to obtain a corresponding single - step operation script s3; and set the fourth device identification parameter of the vacuum pump control interface to the air extraction device name and the first status control parameter to start to obtain a corresponding single - step operation script s4; and according to the synchronous script block nesting method, form a synchronous script block from the single - step operation scripts s3 and s4, denoted as script block b2.
[0263] Step A - 6: Set the waiting duration parameter of the system waiting interface to the preset vacuum pumping duration threshold to obtain a corresponding single - step operation script s5.
[0264] Here, the vacuum pumping duration threshold is a preset time length parameter, such as 60 seconds;
[0265] Step A-7, set the third device identification parameter of the second valve control interface as the name of the air extraction valve, and set the second valve control parameter as shutoff to obtain a corresponding single-step operation script s6; and set the third device identification parameter of the second valve control interface as the name of the gas injection valve, and set the second valve control parameter as connected to obtain a corresponding single-step operation script s7; and in the nested manner of the synchronous script block, form a synchronous script block denoted as script block b3 from the single-step operation scripts s6 and s7;
[0266] Step A-8, set the fifth device identification parameter of the gas source device control interface as the name of the gas injection device, and set the second status control parameter as start to obtain a corresponding single-step operation script s8; and set the fourth device identification parameter of the vacuum pump control interface as the name of the air extraction device, and set the first status control parameter as stop to obtain a corresponding single-step operation script s9; and in the nested manner of the synchronous script block, form a synchronous script block denoted as script block b4 from the single-step operation scripts s8 and s9;
[0267] Step A-9, set the waiting duration parameter of the system waiting interface as the preset gas injection duration threshold to obtain a corresponding single-step operation script s 10 ;
[0268] Here, the gas injection duration threshold is a preset time length parameter, such as 60 seconds;
[0269] Step A-10, set the fifth device identification parameter of the gas source device control interface as the name of the gas injection device, and set the second status control parameter as stop to obtain a corresponding single-step operation script s 11 ;
[0270] Step A-11, set the third device identification parameter of the second valve control interface as the name of the gas injection valve, and set the second valve control parameter as shutoff to obtain a corresponding single-step operation script s 12 ;
[0271] Step A-12, form a sequentially executed script sequence S1{b1, b2, s5, b3, b4, s 10 , s 11 , s 12} from script blocks b1, b2, b3, b4 and single-step operation scripts s5, s 10 , s 11 , s 12}; and by copying the script sequence S1{b1, b2, s5, b3, b4, s 10 , s 11,s 12} to obtain a sequentially executed script sequence S2{S 1,i};
[0272] where 1 ≤ index i ≤ n1, and each script sequence S 1,i is consistent with the script sequence S1{b1, b2, s5, b3, b4, s 10 ,s 11 ,s 12};
[0273] Step A-13, output the script sequence S2{S 1,i} as the first sub-task script for the current vacuuming-re-injection sub-task script generation process;
[0274] Step 54, extract the corresponding first source container name, first target container name, first pipetting volume, and first pipetting flow rate from the current task declaration to form a corresponding second parameter group; and perform basic pipetting sub-task script generation processing based on the current second parameter group, experimental directed graph, and basic function library to obtain a corresponding first sub-task script; and go to Step 56;
[0275] In the embodiment of the present invention, performing basic pipetting sub-task script generation processing based on the current second parameter group, experimental directed graph, and basic function library to obtain a corresponding first sub-task script specifically includes:
[0276] Step B-1, extract the corresponding first source container name, first target container name, first pipetting volume, and first pipetting flow rate from the second parameter group;
[0277] Step B-2, use the first node in the experimental directed graph where the device name matches the first source container name and the first target container name as the corresponding current source node and current target node; and denote the first node with the device type of syringe pump in the experimental directed graph as the corresponding pump node; and denote each node path from the current source node to the current target node in the experimental directed graph as the corresponding first path; and denote each first path where the nodes passed through except the current source node and the current target node are all pump nodes as the corresponding second path; and use the shortest second path as the current pump chain path; and use the smallest maximum piston position p max as the corresponding single pipetting volume; and calculate the corresponding current repetition number n2 = ceil(first pipetting volume / single pipetting volume), where ceil() is the ceiling function; and use the total number of nodes in the current pump chain path minus 1 as the corresponding pipetting number n3;
[0278] Step B-3: Take the current source node as the corresponding first device node, and the first pump node on the current pump chain path as the corresponding second device node; and initialize the index j to 1.
[0279] Step B-4: Take the device names of the first and second device nodes as the corresponding first and second device names.
[0280] Step B-5: Identify the first and second device nodes; if the first and second device nodes are the current source node and a pump node, go to Step B-6; if the first and second device nodes are two pump nodes, go to Step B-7; if the first and second device nodes are a pump node and the current target node, go to Step B-8.
[0281] Step B-6: According to the preset flow rate - maximum flow velocity conversion rule, calculate the corresponding first maximum flow velocity based on the first pipetting flow rate and the cross-sectional area of the liquid inlet port of the second device node; and set the first device identification parameter of the first valve control interface to the second device name, the valve port parameter to the port identification PT B,1 , the first valve control parameter to connected to obtain a corresponding single-step operation script s 13 ; and set the first device identification parameter of the first valve control interface to the second device name, the valve port parameter to the port identification PT B,2 , the first valve control parameter to shut off to obtain a corresponding single-step operation script s 14 ; and set the second device identification parameter of the piston control interface to the second device name, the target position parameter to the single pipetting volume, and the maximum flow velocity parameter to the first maximum flow velocity to obtain a corresponding single-step operation script s 15 ; and in the nested manner of the synchronous script block, from the single-step operation script s 13 , s 14 form a synchronous script block denoted as script block b5; and from script block b5 and the single-step operation script s 15 form a sequentially executed script sequence S j {b5, s 15}; and go to Step B-9.
[0282] Here, in the embodiment of the present invention, it is default that the product of the maximum flow velocity v max of the liquid and the cross-sectional area s of the flow pipeline is linearly related to the liquid flow rate f: f = w × (v max s), and the flow rate - maximum flow velocity conversion rule in the embodiment of the present invention is used to set the linear coefficient w; then, when w, s, and f are known, the corresponding v max can naturally be calculated;
[0283] Step B-7: According to the flow rate - maximum flow velocity conversion rule, calculate the corresponding second maximum flow velocity based on the first pipetting flow rate and the cross-sectional area of the liquid outlet port of the first equipment node, and calculate the corresponding third maximum flow velocity based on the first pipetting flow rate and the cross-sectional area of the liquid inlet port of the second equipment node; take the smaller value of the second and third maximum flow velocities as the corresponding fourth maximum flow velocity; and set the first equipment identification parameter of the first valve control interface to the first equipment name, the valve port parameter to the port identification PT B,1 , set the first valve control parameter to cut-off to obtain a corresponding single-step operation script s 16 ; and set the first equipment identification parameter of the first valve control interface to the first equipment name, the valve port parameter to the port identification PT B,2 , set the first valve control parameter to connect to obtain a corresponding single-step operation script s 17 ; and set the first equipment identification parameter of the first valve control interface to the second equipment name, the valve port parameter to the port identification PT B,1 , set the first valve control parameter to connect to obtain a corresponding single-step operation script s 18 ; and set the first equipment identification parameter of the first valve control interface to the second equipment name, the valve port parameter to the port identification PT B,2 , set the first valve control parameter to cut-off to obtain a corresponding single-step operation script s 19 ; and set the second equipment identification parameter of the piston control interface to the first equipment name, the target position parameter to 0, and the maximum flow velocity parameter to the fourth maximum flow velocity to obtain a corresponding single-step operation script s 20 ; and set the second equipment identification parameter of the piston control interface to the second equipment name, the target position parameter to the single pipetting volume, and the maximum flow velocity parameter to the fourth maximum flow velocity to obtain a corresponding single-step operation script s 21 ; and in the form of synchronous script block nesting, from the single-step operation script s 16 , s 17 , s 18 , s 19 form a synchronous script block denoted as script block b6; and in the form of synchronous script block nesting, from the single-step operation script s 20 , s 21 form a synchronous script block denoted as script block b7; and form a sequentially executed script sequence S j {b6, b7}; and go to step B-9;
[0284] Step B-8: According to the flow rate - maximum flow velocity conversion rule, calculate the corresponding fifth maximum flow velocity based on the first pipetting flow rate and the cross-sectional area of the liquid outlet port of the first equipment node; and set the first equipment identification parameter of the first valve control interface to the first equipment name, the valve port parameter to the port identification PTB,1 Set the first valve control parameter to off to obtain a corresponding single-step operation script s 22 ; and set the first device identification parameter of the first valve control interface to the first device name, and set the valve port parameter to the port identification PT B,2 Set the first valve control parameter to connected to obtain a corresponding single-step operation script s 23 ; and set the second device identification parameter of the piston control interface to the first device name, set the target position parameter to 0, and set the maximum flow rate parameter to the fifth maximum flow rate to obtain a corresponding single-step operation script s 24 ; and in the form of synchronous script block nesting, from the single-step operation script s 22 、s 23 Compose a synchronous script block denoted as script block b8; and from script block b8 and the single-step operation script s 24 Compose a sequentially executed script sequence S j {b8,s 24}; and go to step B-9;
[0285] Step B-9, increment the index j by 1; and identify whether the incremented index j is greater than the pipetting times n3; if so, go to step B-10; if not, take the current second device node as the new first device node, and take the next node of the current first device node on the current pump chain path as the new second device node, and return to step B-4;
[0286] Step B-10, from the obtained n3 script sequences S j Compose a sequentially executed script sequence S3{S j} in ascending order of the index j; and obtain a sequentially executed script sequence S4{S j} by copying the script sequence S3{S 3,k} n2 times;
[0287] Among them, 1 ≤ index k ≤ n2, and each script sequence S 3,k is consistent with the script sequence S3{S j};
[0288] Step B-11, take the script sequence S4{S 3,k} as the first sub-task script generated this time;
[0289] Step 55, extract the corresponding first waiting duration from the current task declaration; and set the waiting duration parameter of the system waiting interface to the first waiting duration to obtain a corresponding single-step operation script to form the corresponding first sub-task script; and go to step 56;
[0290] Step 56: Add the currently latest first subtask script to the experimental script; and identify whether the current task declaration is the last task declaration configured for the task flow. If not, use the next task declaration in the task flow configuration as the new current task declaration and return to Step 52. If so, output the latest experimental script as the processing result of this script generation.
[0291] Step 6: Compose a corresponding script execution configuration from the experimental directed graph and the experimental script and save it.
[0292] Here, every time a script execution configuration is loaded in the test script execution environment, the connection relationships of relevant devices in the experimental environment can be verified for correctness based on the experimental directed graph in the current configuration, and after the verification is successful, the initial states of all relevant devices can be set, thereby enabling timely avoidance of experimental risks brought about by environmental changes.
[0293] Figure 5 It is a module structure diagram of an experimental script generation device provided in the second embodiment of the present invention. This device is a terminal device or a server for implementing the foregoing method embodiment, or can be a device that enables the foregoing terminal device or server to implement the foregoing method embodiment. For example, this device can be a device or a chip system of the foregoing terminal device or server. As Figure 5 shown, this device includes: a function library preparation module 201, a configuration template preparation module 202, a task configuration identification module 203, a directed graph construction module 204, a script generation module 205, and a data saving module 206.
[0294] The function library preparation module 201 is used to build a basic function library based on the device drivers of all operating devices in a specified experimental scenario; and give corresponding call interfaces for each function in the basic function library.
[0295] The configuration template preparation module 202 is used to design an experimental task configuration template for a specified experimental scenario; the experimental task configuration template includes a device connection configuration template and a task flow configuration template.
[0296] The task configuration identification module 203 is used to extract the corresponding device connection configuration and task flow configuration from the experimental task configuration generated by the user based on the experimental task configuration template.
[0297] The directed graph construction module 204 is used to construct a directed graph based on the device connection configuration to obtain a corresponding experimental directed graph.
[0298] The script generation module 205 is used to perform per-task script generation processing according to the experimental directed graph, the task flow configuration, and all function call interfaces of the basic function library to obtain a corresponding experimental script.
[0299] The data storage module 206 is used to form a corresponding script execution configuration from the experimental directed graph and the experimental script and save it.
[0300] An experimental script generation device provided by an embodiment of the present invention can execute the method steps in the above method embodiment, and its implementation principle and technical effect are similar, which will not be elaborated here.
[0301] It should be noted that it should be understood that the division of each module of the above device is only a logical function division. In actual implementation, it can be fully or partially integrated into a physical entity, or physically separated. And these modules can all be implemented in the form of software called by processing elements; they can also all be implemented in hardware form; or some modules can be implemented in the form of software called by processing elements, and some modules can be implemented in hardware form. For example, the function library preparation module can be a separately established processing element, or can be integrated in a certain chip of the above device. In addition, it can also be stored in the memory of the above device in the form of program code, and called and executed by a certain processing element of the above device to perform the functions of the above determined modules. The implementation of other modules is similar. In addition, these modules can be fully or partially integrated together or independently implemented. The processing element described here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each of the above modules can be completed by the integrated logic circuit in the processor element or the instruction in software form.
[0302] For example, the above modules can be one or more integrated circuits configured to implement the above method, such as: one or more Application Specific Integrated Circuits (ASICs), or, one or more Digital Signal Processors (DSPs), or, one or more Field Programmable Gate Arrays (FPGAs), etc. Again, when a certain module above is implemented in the form of a processing element scheduling program code, the processing element can be a general-purpose processor, such as a Central Processing Unit (CPU) or other processors that can call program code. Again, these modules can be integrated together and implemented in the form of a System-on-a-chip (SOC).
[0303] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the foregoing method embodiments are generated in whole or in part. The above computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The above computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the above computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, optical fiber, Digital Subscriber Line (DSL)) or wireless (such as infrared, wireless, Bluetooth, microwave, etc.). The above computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more integrated available media. The above available medium may be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)), etc.
[0304] Figure 6 FIG. 4 is a schematic structural diagram of an electronic device provided in Embodiment 3 of the present invention. The electronic device may be a terminal device or a server for implementing the method of the foregoing embodiments, or may be a terminal device or a server for implementing the method of the foregoing embodiments and connected to the foregoing terminal device or server. As Figure 6 shown, the electronic device may include: a processor 301 (such as a CPU), a memory 302, and a transceiver 303; the transceiver 303 is coupled to the processor 301, and the processor 301 controls the transceiver operations of the transceiver 303. Various instructions may be stored in the memory 302 for completing various processing functions and implementing the processing steps described in the foregoing method embodiments. Preferably, the electronic device according to the embodiment of the present invention further includes: a power supply 304, a system bus 305, and a communication port 306. The system bus 305 is used to implement communication connections between components. The above communication port 306 is used for the electronic device to connect and communicate with other peripherals.
[0305] In Figure 6The system bus 305 mentioned above can be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The system bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of simplicity, only a thick line is used to represent it in the figure, but it does not mean that there is only one bus or one type of bus. The communication interface is used to implement communication between the database access device and other devices (such as clients, read-write libraries, and read-only libraries). The memory may include Random Access Memory (RAM), and may also include non-volatile memory, such as at least one disk memory.
[0306] The above-mentioned processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), a Graphics Processing Unit (GPU), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0307] It should be noted that the embodiment of the present invention also provides a computer-readable storage medium, in which instructions are stored. When it runs on a computer, the computer is made to execute the methods and processing procedures provided in the above embodiments.
[0308] The embodiment of the present invention provides a method, device, electronic device, and computer-readable storage medium for generating an experimental script based on configuration driving. As can be seen from the above, the embodiment of the present invention pre-builds a basic function library based on the device drivers of all operating devices in the experimental scenario, and customizes a visual experimental task configuration template (device connection configuration template, task flow configuration template) for the current experimental scenario; users can quickly generate device connection configuration and task flow configuration through interactive template operations without script development experience; after obtaining the device connection configuration, an experimental directed graph is automatically generated based on this configuration, and the device connection relationship and device initial state in the current scenario are recorded through this directed graph; then, an experimental script corresponding to the task flow configuration is automatically generated according to the experimental directed graph and the basic function library. Through the embodiment of the present invention, the technical threshold of script writing is reduced, the script generation efficiency is improved, the writing error rate is reduced, and the script quality is improved.
[0309] The steps of the methods or algorithms described in connection with the embodiments disclosed herein may be implemented in hardware, software modules executed by a processor, or a combination of both. The software modules may be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0310] The specific embodiments described above further elaborate on the objectives, technical solutions, and beneficial effects of the present invention. It should be understood that the above description is only for the specific embodiments of the present invention and is not used to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.
Claims
1. A configuration-driven experimental script generation method, characterized in that The method includes: Constructing a basic function library based on the device drivers of all operating devices in a specified experimental scenario; and providing corresponding call interfaces for each function in the basic function library; Designing an experimental task configuration template for the specified experimental scenario; the experimental task configuration template includes a device connection configuration template and a task flow configuration template; Extracting the corresponding device connection configuration and task flow configuration from the experimental task configuration generated by the user based on the experimental task configuration template; Constructing a directed graph based on the device connection configuration to obtain a corresponding experimental directed graph; Performing per-task script generation processing according to the experimental directed graph, the task flow configuration, and all function call interfaces of the basic function library to obtain a corresponding experimental script; Forming a corresponding script execution configuration from the experimental directed graph and the experimental script and saving it.
2. The method for generating an experimental script based on configuration drive according to claim 1, wherein The device name of each experimental device in the specified experimental scenario is unique; The types of experimental devices in the specified experimental scenario include containers, syringe pumps, one-way solenoid valves, vacuum pumps, and gas source devices; The container includes four inlet and outlet ports, namely, a liquid inlet port, a liquid outlet port, a vacuum pumping port, and a gas injection port; The injection pump includes a liquid inlet, a liquid outlet valve port, and a moving piston; the on / off states of the liquid inlet and outlet valve ports are each controlled by a self-control device, and the up / down displacement movement state of the moving piston is controlled by another self-control device; the movement range of the moving piston is the piston position range [0, p max , p max is the corresponding maximum piston position, and the unit of the piston position corresponds to the unit of the liquid volume; The one-way solenoid valve includes an inlet and an outlet port, and the on / off state of the communication airway between the inlet and outlet ports is controlled by an automatic control device; The vacuum pump includes a gas extraction port, and the start / stop state of the vacuum pump is controlled by an automatic control device; The gas source device includes a gas release port, and the gas source device is used to store a type of inert gas and the start / stop state of the device is controlled by an automatic control device; The syringe pump, the one-way solenoid valve, the vacuum pump, and the gas source device belong to the operating devices; the device drivers of each operating device are used to perform single-step operation driving on each automatic control device of the current device; The basic function library includes a first valve control function, a piston control function, a second valve control function, a vacuum pump control function, a gas source control function, and a system waiting function; the call interfaces of each function are the corresponding first valve control interface, piston control interface, second valve control interface, vacuum pump control interface, gas source control interface, and system waiting interface; The execution environment of the experimental script is consistent with the running environment of the basic function library; the execution environment of the experimental script is used to load the script execution configuration for automated experimental processing; and during the processing, first initialize the device state of the specified experimental scenario according to the current experimental directed graph, and then complete the current round of experimental operation process by executing the current experimental script; And when executing the current experimental script, regard it as a sequence of subtask scripts, and sequentially execute the subtask scripts arranged in sequence in the current sequence; and when executing each subtask script, regard it as a script sequence, and sequentially execute the synchronous script blocks and single-step operation scripts arranged in sequence in the current sequence; And when executing each synchronous script block, synchronously execute all single-step operation scripts in the current block; When executing each single-step operation script, perform single-step control on the specified device through the device driver corresponding to the current script function call interface, obtain the feedback status of this single-step control through the current device driver, and continue to execute the next synchronization script block or the next single-step operation script when the current feedback status is not an abnormal status.
3. The method for generating an experimental script based on configuration drive according to claim 2, wherein The interface parameters of the first valve control interface include a first device identification parameter, a valve port parameter, and a first valve control parameter; the first device identification parameter is the device name of one of the syringe pumps; the valve port parameter includes port identifiers PT B,1 , PT B,2 ; the port identifiers PT B,1 , PT B,2 are respectively the preset port identifiers of the liquid inlet and outlet valve ports of the syringe pump; the first valve control parameter includes connection and disconnection; The first valve control function is used to control the on / off state of the liquid inlet or liquid outlet valve port of the syringe pump corresponding to the first device identification parameter and the valve port parameter according to the first valve control parameter; The interface parameters of the piston control interface include a second device identification parameter, a target position parameter, and a maximum flow rate parameter; the second device identification parameter is the device name of one of the syringe pumps; the target position parameter is a piston position within the piston position range [0, p max , and the maximum flow rate parameter is the maximum flow rate of the liquid entering / leaving the pump when the moving piston draws or pushes the liquid. The piston control function is used to perform a one-way displacement control on the moving piston of the syringe pump corresponding to the second device identification parameter with the maximum flow rate parameter as the upper speed constraint, the current piston position as the starting position, and the target position parameter as the ending position; The interface parameters of the second valve control interface include a third device identification parameter and a second valve control parameter; the third device identification parameter is the device name of a one-way solenoid valve; the second valve control parameter includes connection and shutdown; The second valve control function is used to control the on / off state of the one-way solenoid valve corresponding to the third device identification parameter according to the second valve control parameter; The interface parameters of the vacuum pump control interface include a fourth device identification parameter and a first state control parameter; the fourth device identification parameter is the device name of a vacuum pump; the first state control parameter includes start and stop; The vacuum pump control function is used to perform start / stop control on the vacuum pump corresponding to the fourth device identification parameter according to the first state control parameter; The interface parameters of the gas source device control interface include a fifth device identification parameter and a second state control parameter; the fifth device identification parameter is the device name of a gas source device; The second state control parameter includes start and stop; The gas source device control function is used to perform start / stop control on the gas source device corresponding to the fifth device identification parameter according to the second state control parameter; The interface parameters of the system waiting interface include a waiting duration parameter; the time unit of the waiting duration parameter is seconds; The system waiting function is used to pause the script processing flow currently executed in the experimental script execution environment and continue to execute the current script processing flow after the pause duration exceeds the waiting duration parameter.
4. The method for generating an experimental script based on configuration drive according to claim 2, wherein The basic configuration element of the device connection configuration template is a device configuration element; the device connection configuration template provides functions of element addition, element deletion, element setting / modification, and element set storage / export for the basic configuration element. The device configuration element provides at least four configuration interfaces, namely the previous device name configuration interface, the current device name configuration interface, the next device name configuration interface, and the current device parameter configuration interface; the previous, current, and next device name configuration interfaces respectively provide the user with a list of available devices in the specified experimental scenario for device name selection; the current device parameter configuration interface provides the user with a list of device types in the specified experimental scenario to set the current device's type, and when the current device type is set to the syringe pump, it further provides the user with a maximum piston position parameter setting interface for the syringe pump, and when the current device type is set to the gas source device, it further provides the user with a list of available inert gases for gas type parameter setting; The basic configuration elements of the task flow configuration template at least include a vacuum pumping - reinjection task configuration element, a basic pipetting task configuration element, and a system waiting task configuration element; the task flow configuration template provides functions such as element addition, element deletion, element setting / modification, element sorting, and element sequence storage / export for the basic configuration elements; The vacuum pumping - reinjection task configuration element provides a first container configuration interface, a first injection gas configuration interface, and a first repetition number configuration interface; the first container configuration interface provides the user with a list of available containers in the specified experimental scenario for device name selection; the first injection gas configuration interface provides the user with a list of available inert gases for injection gas type selection; the first repetition number configuration interface provides the user with a repetition number setting interface; The basic pipetting task configuration element provides a first source container configuration interface, a first target container configuration interface, and a first pipetting volume and flow rate configuration interface; the first source container configuration interface and the first target container configuration interface provide the user with a list of available containers in the specified experimental scenario for device name selection; the first pipetting volume and flow rate configuration interface provides the user with a data setting interface for pipetting volume and pipetting flow rate; The system waiting task configuration element provides a waiting duration configuration interface; the waiting duration configuration interface provides the user with a waiting duration setting interface.
5. The method for generating an experiment script based on configuration - driven according to claim 2, wherein, The device connection configuration is generated by the device connection configuration template, specifically as a device configuration set composed of multiple first device configurations; each of the first device configurations is generated by the device configuration element of the device connection configuration template and corresponds to an experimental device in the specified experimental scenario; The first device configuration includes the name of the previous device, the name of the current device, the name of the next device, and the current device parameters; the name of the current device is the name of the current experimental device; when the name of the previous device is not empty, it is the name of the previous experimental device connected to the current experimental device in the specified experimental scenario; when the name of the next device is not empty, it is the name of the next experimental device connected to the current experimental device in the specified experimental scenario; the current device parameters include the current device type; the current device type includes the container, the syringe pump, the one-way solenoid valve, the vacuum pump, and the gas source device; when the current device type is the syringe pump, the current device parameters further include the maximum piston position parameter; when the current device type is the gas source device, the current device parameters further include the gas type parameter; The task flow configuration is generated from the task flow configuration template, specifically as a sequence of task declarations sorted by multiple task declarations; the types of task declarations at least include a vacuum-pumping and reinjection task declaration, a basic pipetting task declaration, and a system waiting task declaration; each type of task declaration is generated by the corresponding vacuum-reinjection task configuration element, basic pipetting task configuration element, or system waiting task configuration element in the task flow configuration template; The vacuum-pumping and reinjection task declaration includes the name of the first container, the first gas type, and the first number of repetitions; the name of the first container is the name of a container device; the first gas type is a type of inert gas; the first number of repetitions is a positive integer; The basic pipetting task declaration includes the name of the first source container, the name of the first target container, the first pipetting volume, and the first pipetting flow rate; the name of the first source container and the name of the first target container are each the name of a container device; The system waiting task declaration includes the first waiting duration.
6. The method for generating an experimental script based on configuration driving according to claim 5, wherein, The experimental directed graph includes a first node set and a first edge set; The first node set includes a plurality of first nodes n i , where 2 ≤ index i ≤ N node , and N node is the total number of nodes; each of the first nodes n i corresponds to one experimental device in the specified experimental scenario; the node attributes of the first node n i include device name, device type, device port identifier, and device status; The device types include the container, the syringe pump, the one-way solenoid valve, the vacuum pump, and the gas source device; When the device type is the container, the device port identifier is a set of identifiers, consisting of four preset port identifiers PT A,1 , PT A,2 , PT A,3 , PT A,4 . The four preset port identifiers respectively correspond one-to-one to the liquid inlet, liquid outlet, vacuum pumping, and gas injection ports of the container; the device status consists of four corresponding port statuses s A,1 , s A,2 , s A,3 , s A,4 . The port statuses s A,1 , s A,2 , s A,3 , s A,4 are all binary states of 0 or 1. A value of 0 indicates that the port corresponding to the current state is in a closed and unused state, and a value of 1 indicates that the port corresponding to the current state is in a closed and unused state; When the device type is the syringe pump, the node attributes also include the maximum piston position p max and the current piston position p; the device port identifier is a set of identifiers, consisting of two preset port identifiers PT B,1 PT B,2 The preset port identifier PT B,1 PT B,2 They correspond to the inlet and outlet valve ports of the injection pump respectively; the device status is determined by the corresponding two port status s B,1 、s B,2 Composition; the port status s B,1 、s B,2 Both are binary states of 0 or 1. 0 indicates that the corresponding port is in the off state, and 1 indicates that the corresponding port is in the connected state. When the device type is the one-way solenoid valve, the device port identifier is an identifier set, which consists of two preset port identifiers PT C,1 , PT C,2 . The preset port identifier PT C,1 , PT C,2 corresponds to the inlet and outlet ports of the one-way solenoid valve one by one; the device state is a binary state of 0 or 1. A value of 0 indicates that the current solenoid valve is in the off state, and a value of 1 indicates that the current solenoid valve is in the connected state; When the device type is the vacuum pump, the device port identifier is the preset port identifier PT D , corresponding to the air extraction port of the vacuum pump; the device status is a binary status of 0 or 1, where 0 indicates that the current vacuum pump is in the shutdown state and 1 indicates that the current vacuum pump is in the startup state; When the device type is the gas source device, the node attribute further includes a gas type, and the gas type is a type of inert gas; the device port identifier is a preset port identifier PT E , corresponding to the air release port of the gas source device; the device status is a binary status of 0 or 1, where 0 indicates that the current gas source device is in a shutdown state and 1 indicates that the current gas source device is in a startup state; The first edge set includes a plurality of first edges e j , where 1 ≤ index j ≤ N edge , and N edge is the total number of edges; the edge attributes of the first edge e j include a start node and an end node; the start and end nodes each correspond to one of the first nodes; the start / end nodes include the name of the front / back point device and the identification of the front / back point port, the name of the front / back point device being the device name of the corresponding node, and the identification of the front / back point port being a device port identification of the corresponding node.
7. The method for generating an experimental script based on configuration driving according to claim 6, wherein The construction of the directed graph based on the device connection configuration to obtain the corresponding experimental directed graph specifically includes: Initializing the corresponding first node set with the device parameters of all the first device configurations based on the device connection configuration; and initializing the corresponding first edge set according to the front and back device connection relationships of all the first device configurations and the first node set; and forming the initialized experimental directed graph by the latest first node set and the first edge set.
8. The method for generating an experimental script based on configuration driving according to claim 7, wherein Initializing the corresponding first node set with the device parameters of all the first device configurations based on the device connection configuration specifically includes: Configure each of the first device configurations in the device connection configuration as the corresponding current device configuration; and use the current device name and the current device parameters of the current device configuration as the corresponding first name and first device parameters; and use the current device type of the current first device parameters as the corresponding first type; Create a corresponding first node n for the creation of the current device configuration i As the corresponding current node; And set the device name and the device type of the current node as the corresponding first name and the first type; And identify the current first type; If the first type is the container, set the device port identifier of the current node to the preset port identifier PT A,1 , PT A,2 , PT A,3 , PT A,4 to form an identifier set; and set the device status of the current node to the port status s A,1 , s A,2 , s A,3 , s A,4 to form a status set, and initialize all four port statuses in the current status set to 0; If the first type is the syringe pump, extract the maximum piston position parameter from the current first device parameters as the corresponding first position parameter; and set the device port identifier of the current node to the identifier set composed of the preset port identifier PT B,1 , PT B,2 ; and set the device status of the current node to the status set composed of the port status s B,1 , s B,2 ; and initialize both port statuses in the current status set to 0; and set the maximum piston position p max of the current node to the corresponding first position parameter; and set the current piston position p of the current node to 0; If the first type is the one-way solenoid valve, set the device port identifier of the current node to the identifier set composed of the preset port identifier PT C,1 , PT C,2 ; and initialize the device status of the current node to 0; If the first type is the vacuum pump, set the device port identifier of the current node to the preset port identifier PT D ; and initialize the device status of the current node to 0; If the first type is the gas source device, extract the gas type parameter from the current first device parameter as the corresponding first gas parameter; and set the device port identifier of the current node to the preset port identifier PT E ; and initialize the device status of the current node to 0; and set the gas type of the current node to the corresponding first gas parameter; Identify the total number of the first device configurations configured for the device connection, and set the corresponding total number of nodes N based on the identification result node ; and from the obtained N node first nodes n i form the initialized first node set 9. The method for generating an experimental script based on configuration driving according to claim 7, wherein Initializing the corresponding first edge set according to the front and rear device connection relationships of all the first device configurations and the first node set specifically includes: Form a corresponding first front and rear device pair from the previous device name and the current device name of each of the first device configurations in the device connection configuration, and form a corresponding first front and rear device pair from the current device name and the subsequent device name; and perform deduplication processing on all the obtained first front and rear device pairs; the first front and rear device pair includes a front device name and a rear device name; when the first front and rear device pair is composed of a pair of the previous device name and the current device name, the front and rear device names correspond to the previous and current device names respectively; when the first front and rear device pair is composed of a pair of the current device name and the subsequent device name, the front and rear device names correspond to the current and subsequent device names respectively; Each of the deduplicated first front-back device pairs is used as the corresponding current device pair; and the front and back device names of the current device pair are used as the corresponding front and back point device names; and the first nodes in the first node set corresponding to the front and back device names are denoted as the corresponding front and back nodes; and the device types of the front and back nodes are used as the corresponding front and back point device types; and the corresponding front and back point port identifiers are set based on a preset device port connection rule and the front and back point device types; and a starting node is formed by the front point device name and the front point port identifier, and an ending node is formed by the back point device name and the back point port identifier; and a corresponding first edge attribute is formed by the starting and ending nodes; and a corresponding first edge e is set for the current device pair j as the current edge, and the edge attribute of the current edge is set based on the first edge attribute; and when the front point device type is the container or the syringe pump, the port status corresponding to the front point port identifier in the device status of the front node is reset to 1; and when the back point device type is the container or the syringe pump, the port status corresponding to the back point port identifier in the device status of the back node is reset to 1; Identify the total number of the first front and rear device pairs after duplicate removal, and set the corresponding total number of edges N based on the identification result edge ; and from the obtained N edge first edges e j form the initialized first edge set 10. The method for generating an experimental script based on configuration driving according to claim 9, wherein The device port connection rules include: The container cannot be directly connected to the vacuum pump and the gas source device; the syringe pump cannot be connected to the one-way solenoid valve, the vacuum pump and the gas source device; the vacuum pump cannot be connected to the gas source device; When the container is connected to the syringe pump, the liquid inlet port of the container can only be connected to the liquid outlet valve port of one syringe pump, and the liquid outlet port of the container can only be connected to the liquid inlet valve port of another syringe pump; reflected in the configuration of the front and rear point port identifiers: if the front and rear point device types are the container and the syringe pump, the corresponding front and rear point port identifiers are the corresponding port identifiers PT A,2 and the port identifier PT B,1 ; if the front and rear point device types are the syringe pump and the container, the corresponding front and rear point port identifiers are the corresponding port identifiers PT B,2 and the port identifier PT A,1 ; When the injection pump is connected to the injection pump, the liquid outlet valve port of the previous injection pump is connected to the liquid inlet valve port of the next injection pump; reflected in the configuration of the front and rear point port identifiers: if the device types of the front and rear points are both injection pumps, the corresponding front and rear point port identifiers are the corresponding port identifiers PT B,2 and the port identifier PT B,1 ; When the container is connected to the one-way solenoid valve, if the one-way solenoid valve is currently also connected to a vacuum pump, the vacuum pumping port of the container is connected to the intake port of the current one-way solenoid valve; if the one-way solenoid valve is currently also connected to a gas source device, the gas injection port of the container is connected to the outlet port of the current one-way solenoid valve; reflected in the configuration of the front and rear point port identifiers: if the front and rear point device types are the container and the one-way solenoid valve, and the one-way solenoid valve is currently also connected to a vacuum pump, the front and rear point port identifiers are the port identifier PT A,3 and the port identifier PT C,1 ; if the front and rear point device types are the one-way solenoid valve and the container, and the one-way solenoid valve is currently also connected to a gas source device, the front and rear point port identifiers are the corresponding port identifier PT C,2 and the port identifier PT A,4 ; When the one-way solenoid valve is connected to the vacuum pump, the air outlet port of the one-way solenoid valve is connected to the air extraction port of the vacuum pump; reflected in the configuration of the front and rear point port identifiers: if the front and rear point device types are the one-way solenoid valve and the vacuum pump, the front and rear point port identifiers are the port identifier PT C,2 and the port identifier PT D ; if the front and rear point device types are the vacuum pump and the one-way solenoid valve, the front and rear point port identifiers are the port identifier PT D and the port identifier PT C,2 ; When the one-way solenoid valve is connected to the air source device, the intake port of the one-way solenoid valve is connected to the air release port of the air source device; reflected in the configuration of the front and rear point port identifiers: if the front and rear point device types are the one-way solenoid valve and the air source device, the front and rear point port identifiers are the port identifier PT C,1 and the port identifier PT E ; if the front and rear point device types are the air source device and the one-way solenoid valve, the front and rear point port identifiers are the port identifier PT E and the port identifier PT C,1 .
11. The method for generating an experimental script based on configuration driving according to claim 6, wherein Generating an experimental script corresponding to each task by performing step-by-step task script generation processing according to the experimental directed graph, the task flow configuration and all function call interfaces of the basic function library specifically includes: Step 111, use the first task statement in the task flow configuration as the corresponding current task statement; and initialize the experimental script to be empty; Step 112, identify the current task statement; if the current task statement is a vacuum-pumping and reinjecting task statement, go to step 113; if the current task statement is a basic pipetting task statement, go to step 114; if the current task statement is a system waiting task statement, go to step 115; Step 113, extract the corresponding first container name, the first gas type and the first repetition number from the current task statement to form a corresponding first parameter group; and perform vacuum-pumping and reinjecting subtask script generation processing according to the current first parameter group, the experimental directed graph and the basic function library to obtain a corresponding first subtask script; and go to step 116; Among them, the first subtask script is composed of one or more single-step operation scripts; Step 114: Extract the corresponding first source container name, first target container name, first pipetting volume, and first pipetting flow rate from the current task statement to form a corresponding second parameter group; and perform basic pipetting subtask script generation processing based on the current second parameter group, the experimental directed graph, and the basic function library to obtain the corresponding first subtask script; then proceed to Step 116; Step 115: Extract the corresponding first waiting duration from the current task statement; and set the waiting duration parameter of the system waiting interface to the first waiting duration to obtain a corresponding single-step operation script to form the corresponding first subtask script; then proceed to Step 116; Step 116: Add the current latest first subtask script to the experimental script; and identify whether the current task statement is the last task statement configured in the task flow; if not, use the next task statement in the task flow configuration as the new current task statement and return to Step 112; if so, output the latest experimental script as the result of this script generation processing.
12. The method for generating an experimental script based on configuration drive according to claim 11, wherein The generation of the first subtask script for the vacuum extraction - reinjection subtask based on the current first parameter group, the experimental directed graph, and the basic function library specifically includes: Step 1201: Extract the corresponding first container name, first gas type, and first repetition count from the first parameter group; and record the first repetition count as the number n1; Step 1202: Use the first node in the experimental directed graph where the device name matches the first container name as the corresponding current container node; and record the first nodes in the experimental directed graph where the device type is the one-way solenoid valve, the vacuum pump, and the gas source device as the corresponding solenoid valve node, vacuum pump node, and gas source node respectively; Step 1203: When it is confirmed that the current container node is connected to a vacuum pump node and another gas source node through two solenoid valve nodes respectively, record the device names of the current two solenoid valve nodes as the corresponding air extraction and gas injection valve names respectively, and record the device names of the currently connected vacuum pump node and gas source node as the corresponding air extraction and gas injection device names respectively; Step 1204: Set the third device identification parameter of the second valve control interface to the air extraction valve name and the second valve control parameter to connected to obtain a corresponding single-step operation script s1; and set the third device identification parameter of the second valve control interface to the gas injection valve name and the second valve control parameter to shut off to obtain a corresponding single-step operation script s2; and form a synchronous script block denoted as script block b1 from the single-step operation scripts s1 and s2 according to a preset synchronous script block nesting method; Among them, when the execution environment of the experimental script executes the synchronous script block, all single-step operation scripts in the block will be executed synchronously; Step 1205, set the fifth device identification parameter of the gas source device control interface as the gas injection device name, and set the second status control parameter as stop to obtain a corresponding single-step operation script s3; set the fourth device identification parameter of the vacuum pump control interface as the gas extraction device name, and set the first status control parameter as start to obtain a corresponding single-step operation script s4; and according to the synchronous script block nesting method, form a synchronous script block denoted as script block b2 from the single-step operation scripts s3 and s4; Step 1206, set the waiting duration parameter of the system waiting interface as a preset vacuum pumping duration threshold to obtain a corresponding single-step operation script s5; Step 1207, set the third device identification parameter of the second valve control interface as the gas extraction valve name, and set the second valve control parameter as shut-off to obtain a corresponding single-step operation script s6; set the third device identification parameter of the second valve control interface as the gas injection valve name, and set the second valve control parameter as connected to obtain a corresponding single-step operation script s7; and according to the synchronous script block nesting method, form a synchronous script block denoted as script block b3 from the single-step operation scripts s6 and s7; Step 1208, set the fifth device identification parameter of the gas source device control interface as the gas injection device name, and set the second status control parameter as start to obtain a corresponding single-step operation script s8; set the fourth device identification parameter of the vacuum pump control interface as the gas extraction device name, and set the first status control parameter as stop to obtain a corresponding single-step operation script s9; and according to the synchronous script block nesting method, form a synchronous script block denoted as script block b4 from the single-step operation scripts s8 and s9; Step 1209, set the waiting duration parameter of the system waiting interface to a preset gas injection duration threshold to obtain a corresponding single-step operation script s 10 ; Step 1210, set the fifth device identification parameter of the gas source device control interface to the name of the gas injection device, and set the second state control parameter to stop to obtain a corresponding single-step operation script s 11 ; Step 1211, set the third device identification parameter of the second valve control interface as the name of the gas injection valve, and set the second valve control parameter as shut-off to obtain a corresponding single-step operation script s 12 ; Step 1212, the script blocks b1, b2, b3, b4 and the single-step operation scripts s5, s 10 , s 11 , s 12 constitute a sequentially executed script sequence S1{b1, b2, s5, b3, b4, s 10 , s 11 , s 12}; and by copying the script sequence S1{b1, b2, s5, b3, b4, s 10 , s 11 , s 12} n1 times, a sequentially executed script sequence S2{S 1,i} is obtained; where 1 ≤ index i ≤ n1, and each script sequence S 1,i is consistent with the script sequence S1{b1, b2, s5, b3, b4, s 10 , s 11 , s 12}; Step 1213, output the script sequence S2{S 1,i} as the first sub-task script for the current vacuum pumping - reinjection sub-task script generation process.
13. The method for generating an experimental script based on configuration drive according to claim 11, wherein The generation process of the basic pipetting subtask script according to the current second parameter group, the experimental directed graph, and the basic function library to obtain the corresponding first subtask script specifically includes: Step 1301, extract the corresponding first source container name, first target container name, first pipetting volume, and first pipetting flow rate from the second parameter group; Step 1302: Use the first nodes in the experimental directed graph where the device name matches the first source container name and the first target container name as the corresponding current source node and current target node; mark the first nodes with the device type of the syringe pump in the experimental directed graph as the corresponding pump nodes; mark each node path from the current source node to the current target node in the experimental directed graph as the corresponding first path; mark each first path where the nodes passed through except the current source node and the current target node are all pump nodes as the corresponding second path; use the shortest second path as the current pump chain path; and use the smallest maximum piston position p max on the current pump chain path as the corresponding single pipetting volume; calculate the corresponding current repeat count n2 = ceil(First pipetting volume / Single pipetting volume), where ceil() is the ceiling function; and use the total number of nodes in the current pump chain path minus 1 as the corresponding pipetting count n3; Step 1303, use the current source node as the corresponding first device node, and the first pump node on the current pump chain path as the corresponding second device node; and initialize the index j as 1; Step 1304, use the device names of the first and second device nodes as the corresponding first and second device names; Step 1305, identify the first and second device nodes; if the first and second device nodes are the current source node and the pump node, go to Step 1306; if the first and second device nodes are two pump nodes, go to Step 1307; if the first and second device nodes are the pump node and the current target node, go to Step 1308; Step 1306, according to the preset flow rate - maximum flow velocity conversion rule, calculate the corresponding first maximum flow velocity based on the first pipetting flow rate and the cross-sectional area of the liquid inlet port of the second device node; and set the first device identification parameter of the first valve control interface to the second device name, the valve port parameter to the port identification PT B,1 , set the first valve control parameter to connected to obtain a corresponding single-step operation script s 13 ; and set the first device identification parameter of the first valve control interface to the second device name, the valve port parameter to the port identification PT B,2 , set the first valve control parameter to off to obtain a corresponding single-step operation script s 14 ; and set the second device identification parameter of the piston control interface to the second device name, the target position parameter to the single pipetting volume, and the maximum flow velocity parameter to the first maximum flow velocity to obtain a corresponding single-step operation script s 15 ; and according to the synchronous script block nesting method, from the single-step operation script s 13 , s 14 form a synchronous script block denoted as script block b5; and from the script block b5 and the single-step operation script s 15 form a sequentially executed script sequence S j {b5, s 15}; and go to step 1309; Step 1307, according to the flow rate - maximum flow velocity conversion rule, calculate the corresponding second maximum flow velocity based on the first pipetting flow rate and the cross-sectional area of the liquid outlet port of the first device node, and calculate the corresponding third maximum flow velocity based on the first pipetting flow rate and the cross-sectional area of the liquid inlet port of the second device node; and take the smaller value of the second and third maximum flow velocities as the corresponding fourth maximum flow velocity; and set the first device identification parameter of the first valve control interface to the first device name, and set the valve port parameter to the port identification PT B,1 , set the first valve control parameter to off to obtain a corresponding single-step operation script s 16 ; and set the first device identification parameter of the first valve control interface to the first device name, and set the valve port parameter to the port identification PT B,2 , set the first valve control parameter to on to obtain a corresponding single-step operation script s 17 ; and set the first device identification parameter of the first valve control interface to the second device name, and set the valve port parameter to the port identification PT B,1 , set the first valve control parameter to on to obtain a corresponding single-step operation script s 18 ; and set the first device identification parameter of the first valve control interface to the second device name, and set the valve port parameter to the port identification PT B,2 , set the first valve control parameter to off to obtain a corresponding single-step operation script s 19 ; and set the second device identification parameter of the piston control interface to the first device name, set the target position parameter to 0, and set the maximum flow velocity parameter to the fourth maximum flow velocity to obtain a corresponding single-step operation script s 20 ; and set the second device identification parameter of the piston control interface to the second device name, set the target position parameter to the single pipetting volume, and set the maximum flow velocity parameter to the fourth maximum flow velocity to obtain a corresponding single-step operation script s 21 ; and according to the synchronous script block nesting method, from the single-step operation script s 16 , s 17 , s 18 , s 19 compose a synchronous script block denoted as script block b6; and according to the synchronous script block nesting method, from the single-step operation script s 20 , s 21 compose a synchronous script block denoted as script block b7; and compose a sequentially executed script sequence S j {b6,b7}; and go to step 1309; Step 1308, according to the flow rate - maximum flow velocity conversion rule, calculate the corresponding fifth maximum flow velocity based on the first pipetting flow rate and the cross-sectional area of the liquid outlet port of the first device node; and set the first device identification parameter of the first valve control interface to the first device name, the valve port parameter to the port identification PT B,1 , set the first valve control parameter to shut-off to obtain a corresponding single-step operation script s 22 ; and set the first device identification parameter of the first valve control interface to the first device name, the valve port parameter to the port identification PT B,2 , set the first valve control parameter to connected to obtain a corresponding single-step operation script s 23 ; and set the second device identification parameter of the piston control interface to the first device name, the target position parameter to 0, and the maximum flow velocity parameter to the fifth maximum flow velocity to obtain a corresponding single-step operation script s 24 ; and according to the synchronous script block nesting method, from the single-step operation script s 22 , s 23 form a synchronous script block denoted as script block b8; and from the script block b8 and the single-step operation script s 24 form a sequentially executed script sequence S j {b8, s 24}; and go to step 1309; Step 1309: increment the index j by 1; and identify whether the incremented index j is greater than the pipetting times n3; if so, go to Step 1310; if not, use the current second device node as the new first device node, use the next node of the current first device node on the current pump chain path as the new second device node, and return to Step 1304; Step 1310, form a sequentially executed script sequence S3{S j} from the obtained n3 script sequences S in ascending order of the index j; and obtain a sequentially executed script sequence S4{S j} by copying the script sequence S3{S j} n2 times; 1 ≤ index k ≤ n2, and each script sequence S 3,k is consistent with the script sequence S3{S 3,k}; j} Step 1311, use the script sequence S4{S 3,k} as the first subtask script generated this time.
14. An apparatus for performing the configuration-driven experimental script generation method according to any one of claims 1-13, characterized in that, The device includes: a function library preparation module, a configuration template preparation module, a task configuration recognition module, a directed graph construction module, a script generation module, and a data saving module; The function library preparation module is used to build a basic function library based on the device drivers of all operating devices in a specified experimental scenario; and provide corresponding call interfaces for each function in the basic function library; The configuration template preparation module is used to design an experimental task configuration template for the specified experimental scenario; the experimental task configuration template includes a device connection configuration template and a task flow configuration template; The task configuration recognition module is used to extract the corresponding device connection configuration and task flow configuration from the experimental task configuration generated by the user based on the experimental task configuration template; The directed graph construction module is used to construct a directed graph based on the device connection configuration to obtain a corresponding experimental directed graph; The script generation module is used to perform per-task script generation processing according to the experimental directed graph, the task flow configuration, and all function call interfaces of the basic function library to obtain a corresponding experimental script; The data saving module is used to form a corresponding script execution configuration from the experimental directed graph and the experimental script and save it.
15. An electronic device, characterized in that, including: a memory, a processor, and a transceiver; The processor is used to be coupled with the memory, read and execute the instructions in the memory to implement the method according to any one of claims 1-13; The transceiver is coupled with the processor, and the processor controls the transceiver to perform message sending and receiving.
16. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a computer, the computer is caused to execute the method according to any one of claims 1-13.