Instrument control system, method and equipment
By introducing a three-layer architecture of instrument scheduling module, management module and driver module, unified scheduling and decoupling of instruments by multiple clients is achieved, and the problem of multi-client access conflict in the existing technology is solved, and the scalability of the instrument control system is improved.
Patent Information
- Application Number
- CN202510575282.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-06
- Publication Date
- 2025-08-12
AI Technical Summary
In the existing instrument control system, there is a strong binding relationship between the client and the instrument driver, and multiple clients cannot access the instrument control system simultaneously.
The instrument scheduling module is used to uniformly schedule multiple instruments, manage instrument instances through the instrument management module, and use the instrument driver module to realize communication between the instrument control system and the instrument, supporting multiple client access.
It realizes decoupling between the client and the instrument driver module, supports multi-client access, avoids multi-client access conflicts, and improves the scalability and flexibility of the instrument control system.
Smart Images

Figure CN120469358A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of instrumentation technology, and in particular to an instrument control system, method, and device. Background Art
[0002] When controlling multiple instruments, existing instrument control systems typically integrate the corresponding drivers for the existing instruments within the control system. Clients then directly operate the instrument drivers using control commands specific to the instruments, achieving control of the existing instruments. However, this existing solution suffers from the following drawbacks: The client and instrument driver are tightly bound, preventing multiple clients from simultaneously accessing the instrument control system. Summary of the Invention
[0003] In order to solve the above technical problems, the present application discloses an instrument control system, method and equipment, which uniformly schedules multiple instruments through an instrument scheduling module, manages instrument instances through an instrument management module, realizes communication between the instrument control system and the instruments through an instrument driver module, and supports multi-client access to the instrument control system.
[0004] In one aspect, the present application provides an instrument control system, the system comprising an instrument scheduling module, an instrument management module, and an instrument driving module;
[0005] The instrument scheduling module is configured to receive at least one instrument control instruction, the at least one instrument control instruction being a control instruction for at least one instrument to be controlled, sent by at least one client; obtain from the instrument management module an instrument instance to be controlled corresponding to each instrument to be controlled; call a preset instrument control function corresponding to each instrument control instruction based on the instrument instance to be controlled, and send each instrument control instruction to the instrument driver module;
[0006] The instrument management module is configured to receive the instance acquisition instruction sent by the instrument scheduling module, and send the to-be-controlled instrument instance corresponding to the instance acquisition instruction to the instrument scheduling module;
[0007] The instrument driving module is used to control the at least one instrument to be controlled to respectively perform operations corresponding to the at least one instrument control instruction.
[0008] In some embodiments, the instrument management module is further configured to:
[0009] Receive the initialization instruction sent by the instrument scheduling module, load at least one preset instrument class library, and obtain the preset instrument class corresponding to each model of the preset instrument;
[0010] Load the preset instrument configuration file and obtain the attribute information of at least one instrument to be connected;
[0011] Determining a target instrument class corresponding to each to-be-connected instrument based on the preset instrument class and the attribute information;
[0012] The target instrument class is instantiated based on the attribute information to create a preset instrument instance corresponding to each instrument to be connected; the preset instrument instance includes the instrument instance to be controlled.
[0013] In some embodiments, the instrument management module is further configured to:
[0014] Receive a preset instrument class library update instruction; the preset instrument class library update instruction includes a new instrument class corresponding to the new instrument, and the preset instrument class library update instruction is generated after the at least one preset instrument class library is updated;
[0015] Loading a new instrument configuration file corresponding to the new instrument, and obtaining new attribute information of the new instrument;
[0016] The newly added instrument class is instantiated based on the newly added attribute information, and a newly added instrument instance corresponding to the newly added instrument is created.
[0017] In some embodiments, the attribute information includes a preset instrument identifier of the at least one instrument to be connected, the instance acquisition instruction includes a target instrument identifier of each instrument to be controlled, and the instrument management module is further configured to:
[0018] Establishing a mapping relationship between the preset instrument identifier and the preset instrument instance to obtain a preset instrument key-value pair corresponding to each to-be-connected instrument;
[0019] In case of receiving the instance acquisition instruction, determining the instrument instance corresponding to the target instrument identifier in the preset instrument key-value pair as the instrument instance to be controlled;
[0020] The instance of the instrument to be controlled is sent to the instrument scheduling module.
[0021] In some embodiments, the attribute information further includes connection information of the at least one meter to be connected, and the meter driving module is further configured to:
[0022] receiving an instrument connection instruction sent by the instrument management module; the instrument connection instruction including connection information of each instrument to be connected;
[0023] Based on the connection information and the preset driving interface corresponding to the connection information, the connection between the instrument driving module and each instrument to be connected is achieved.
[0024] In some embodiments, the instrument scheduling module is further configured to:
[0025] Parsing each instrument control instruction to obtain a target instrument identifier of each instrument to be controlled and control information for each instrument to be controlled;
[0026] Acquire the to-be-controlled instrument instance corresponding to the target instrument identifier from the instrument management module;
[0027] The preset instrument control functions corresponding to the control information are called based on the instrument instance to be controlled, and the instrument instance to be controlled and the control information are sent to the instrument driving module.
[0028] In some embodiments, the instrument driver module is further configured to:
[0029] receiving the instance of the instrument to be controlled and the control information sent by the instrument scheduling module;
[0030] Determining the at least one instrument to be controlled based on the instrument instance to be controlled;
[0031] converting the control information into a target instrument instruction recognizable by the at least one instrument to be controlled;
[0032] The target instrument instruction is sent to the at least one instrument to be controlled.
[0033] In some embodiments, the instrument scheduling module is further configured to:
[0034] Acquire an instrument control result from the instrument driving module; the instrument control result is a result returned after the at least one instrument to be controlled respectively executes an operation corresponding to the at least one instrument control instruction;
[0035] The instrument control result is sent to the at least one client.
[0036] On the other hand, the present application also provides an instrument control method, which is applied to the above-mentioned instrument control system, and the method includes:
[0037] The instrument scheduling module receives at least one instrument control instruction, where the at least one instrument control instruction is a control instruction sent by at least one client for at least one instrument to be controlled;
[0038] The instrument management module receives the instance acquisition instruction sent by the instrument scheduling module, and sends the to-be-controlled instrument instance corresponding to each to-be-controlled instrument to the instrument scheduling module;
[0039] The instrument scheduling module calls the preset instrument control function corresponding to each instrument control instruction based on the instrument instance to be controlled, and sends each instrument control instruction to the instrument driving module;
[0040] The instrument driving module controls the at least one instrument to be controlled to respectively execute an operation corresponding to the at least one instrument control instruction.
[0041] On the other hand, the present application also provides an instrument control method, which is applied to the above-mentioned instrument scheduling module, and the method includes:
[0042] receiving at least one instrument control instruction, where the at least one instrument control instruction is a control instruction sent by at least one client and directed to at least one instrument to be controlled;
[0043] Sending an instance acquisition instruction to the instrument management module, and receiving from the instrument management module the instrument instance to be controlled corresponding to each instrument to be controlled;
[0044] Based on the instance of the instrument to be controlled, a preset instrument control function corresponding to each instrument control instruction is called, and each instrument control instruction is sent to an instrument driving module.
[0045] On the other hand, the present application also provides an electronic device, which includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the above-mentioned instrument control method.
[0046] The implementation of the embodiments of the present application has the following beneficial effects:
[0047] The instrument control system disclosed in this application includes a three-tier architecture: an instrument scheduling module, an instrument management module, and an instrument driver module. The instrument scheduling module is used to uniformly schedule multiple instruments to be controlled; the instrument management module is used to manage the instrument instances corresponding to the instruments to be controlled; and the instrument driver module is used to implement communication between the instrument control system and the instruments to be controlled. Upon receiving instrument control instructions from multiple clients, the instrument scheduling module obtains the instrument instances to be controlled corresponding to each instrument control instruction, invokes the instrument control method corresponding to each client instruction based on the instrument instance to be controlled, and sends the multiple instrument control instructions to the instrument driver module to control the instruments to be controlled. This decoupling between the client and the instrument driver module is achieved, supporting multiple clients accessing the instrument control system and avoiding multi-client access conflicts. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0049] Figure 1 A schematic diagram of the structure of an instrument control system provided in an embodiment of the present application;
[0050] Figure 2 A flow chart of an instrument control method provided in an embodiment of the present application;
[0051] Figure 3 A schematic diagram of module interaction provided in an embodiment of the present application;
[0052] Figure 4 A schematic diagram of an instrument control system architecture provided in an embodiment of the present application;
[0053] Figure 5 A flow chart of an instrument control method provided in an embodiment of the present application;
[0054] Figure 6 A schematic diagram of the structure of an instrument control device provided in an embodiment of the present application;
[0055] Figure 7 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0056] To make the objectives, technical solutions, and advantages of this application more clear, this application will be further described in detail below with reference to the accompanying drawings. It is clear that the embodiments described are only some of the embodiments of this application, and not all of them. All other embodiments obtained by persons of ordinary skill in the art based on the embodiments in this application without inventive effort are within the scope of protection of this application.
[0057] In the description of the present application, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. Moreover, the terms "first", "second", etc. are applicable to distinguishing similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the information used in this way can be interchangeable where appropriate so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0058] See also Figure 1 , Figure 1 A schematic diagram of the structure of an instrument control system provided in an embodiment of the present application, wherein the system includes an instrument scheduling module, an instrument management module, and an instrument driving module;
[0059] The instrument scheduling module is configured to receive at least one instrument control instruction, the at least one instrument control instruction being a control instruction for at least one instrument to be controlled, sent by at least one client; obtain from the instrument management module an instrument instance to be controlled corresponding to each instrument to be controlled; call a preset instrument control function corresponding to each instrument control instruction based on the instrument instance to be controlled, and send each instrument control instruction to the instrument driver module;
[0060] The instrument management module is configured to receive the instance acquisition instruction sent by the instrument scheduling module, and send the to-be-controlled instrument instance corresponding to the instance acquisition instruction to the instrument scheduling module;
[0061] The instrument driving module is used to control the at least one instrument to be controlled to respectively perform operations corresponding to the at least one instrument control instruction.
[0062] In some embodiments, the instrument control system runs on a server, and the instrument control system is used to control an instrument system composed of multiple instruments. The instrument system includes instruments to be controlled, and the instruments to be controlled can be voltmeters, ammeters, voltage sources, current sources, source meters, and other instruments.
[0063] In some embodiments, the instrument scheduling module can provide a unified remote access interface, and the client can send instrument control instructions to the instrument scheduling module through the remote access interface. The remote access interface can be implemented through RPC (Remote Procedure Call) technology. For example, the remote access interface can be a gRPC (Google Remote Procedure Call) interface. Through the unified remote access interface, the client only needs to send instrument control instructions according to certain interface call specifications to achieve control of the instrument to be controlled. The instrument control system supports client remote access and instrument control through the remote access interface between different platforms (that is, the server and the client can have different operating systems), adapting to distributed deployment requirements.
[0064] In some embodiments, the instrument scheduling module (BusinessCenter) is used to receive instrument control instructions sent by the client. When multiple clients send multiple instrument control instructions at the same time, the underlying instrument resources are coordinated uniformly to avoid multi-client access conflicts; the instrument management module (InstrumentManager) is used to manage the instrument instances corresponding to each instrument in the instrument system; the instrument driver module (Driver Layer) has built-in multiple common driver interfaces, including NIDriver, VISADriver, serial communication, LAN communication, etc., which are used to realize communication between the instrument control system and the instrument to be controlled.
[0065] In some embodiments, see Figure 2 , Figure 2 A flow chart of an instrument control method provided in an embodiment of the present application, the method comprising:
[0066] S201: An instrument scheduling module receives at least one instrument control instruction, where the at least one instrument control instruction is a control instruction sent by at least one client for at least one instrument to be controlled;
[0067] In some embodiments, the instrument control instruction may be an operation instruction for the instrument to be controlled, such as setting voltage, setting current, measuring voltage, measuring current, switching channels, etc.
[0068] S203, the instrument management module receives the instance acquisition instruction sent by the instrument scheduling module, and sends the to-be-controlled instrument instance corresponding to each to-be-controlled instrument to the instrument scheduling module;
[0069] In some embodiments, after receiving the instrument control instruction, the instrument scheduling module parses the instrument control instruction and then sends an instance acquisition instruction to the instrument management module, so that the instrument management module sends the instrument instance to be controlled corresponding to each instrument to be controlled to the instrument scheduling module based on the instance acquisition instruction.
[0070] S205, the instrument scheduling module calls the preset instrument control function corresponding to each instrument control instruction based on the instrument instance to be controlled, and sends each instrument control instruction to the instrument driving module;
[0071] In some embodiments, the instrument scheduling module calls the preset instrument control function corresponding to each instrument control instruction through the to-be-controlled instrument instance corresponding to each to-be-controlled instrument, and sends each instrument control instruction to the instrument driving module.
[0072] In some embodiments, the preset instrument control function refers to a variety of instrument control methods built into the instrument control system. Each type of instrument control instruction has a corresponding preset instrument control function. The preset instrument control function may include a voltage setting method, a current setting method, a voltage measurement method, a current measurement method, a channel switching method, etc. For example, if the instrument control instruction is a voltage setting instruction, then its corresponding preset instrument control function is the voltage setting method setVotage(); if the instrument control instruction is a current setting instruction, then its corresponding preset instrument control function is the current setting method setCurrent().
[0073] S207 , the instrument driving module controls the at least one instrument to be controlled to respectively execute an operation corresponding to the at least one instrument control instruction.
[0074] In some embodiments, the instrument driving module processes at least one instrument control instruction based on the instrument communication protocol corresponding to at least one instrument to be controlled, converts it into a corresponding instrument-specific instruction, and sends it to at least one instrument to be controlled corresponding to the at least one instrument control instruction, so that the at least one instrument to be controlled performs the corresponding operation.
[0075] In some embodiments, the instrument management module is further configured to:
[0076] Receive the initialization instruction sent by the instrument scheduling module, load at least one preset instrument class library, and obtain the preset instrument class corresponding to each model of the preset instrument;
[0077] Load the preset instrument configuration file and obtain the attribute information of at least one instrument to be connected;
[0078] Determining a target instrument class corresponding to each to-be-connected instrument based on the preset instrument class and the attribute information;
[0079] The target instrument class is instantiated based on the attribute information to create a preset instrument instance corresponding to each instrument to be connected; the preset instrument instance includes the instrument instance to be controlled.
[0080] In some embodiments, the preset instrument class library can be a dynamic link library (DLL), which contains preset instrument classes corresponding to each model of preset instrument in the instrument system. The preset instrument class defines the properties and methods that can be implemented for each model of preset instrument. The properties of the preset instrument may include instrument identification, instrument type, instrument model, connection type, and connection address. The methods that can be implemented by the preset instrument include preset instrument control functions. At least one preset instrument class library may include a built-in instrument class library Instrument.dll corresponding to the built-in instrument and an extended instrument class library ExtendInstrument.dll corresponding to the user extended instrument, wherein the built-in instrument refers to the instrument already existing in the initial instrument system. The built-in instrument class library contains preset instrument classes corresponding to each model of built-in instrument, and the extended instrument class library contains preset instrument classes corresponding to each model of user extended instrument.
[0081] In some embodiments, a preset instrument configuration file is provided by a user, which contains attribute information of at least one instrument to be connected. The instrument to be connected refers to the instrument that the user needs to operate. The instrument to be connected is at least one instrument in the instrument system. The attribute information of the instrument to be connected may include specific parameter information and specific connection information of the instrument to be connected. The specific parameter information may include the instrument identification, instrument type, instrument model, voltage range / current range, number of channels and other information of the instrument to be connected. The specific connection information may include the connection type, connection address and other information of the instrument to be connected.
[0082] In some embodiments, after the instrument control system is started, the instrument scheduling module sends an initialization instruction to the instrument management module, the instrument management module scans the local preset path of the server, loads at least one preset instrument class library under the preset path, obtains the preset instrument class corresponding to each model of the preset instrument, and then loads the preset instrument configuration file to obtain the attribute information of at least one instrument to be connected. Based on the instrument model in the attribute information, the preset instrument class corresponding to at least one instrument to be connected is determined, and it is determined as the target instrument class. The target instrument class is instantiated based on the specific parameter information and specific connection information in the attribute information, and a preset instrument instance corresponding to each instrument to be connected is created.
[0083] It should be noted that the preset instrument control functions implemented by the preset instrument are defined by the BaseInstrument base class within the instrument control system. The preset instrument classes in the preset instrument class library inherit from this base class. Furthermore, the preset instrument class defines interfaces for retrieving preset instrument attribute information, such as getIRangeList(), getVRangeList(), and getChannelCount().
[0084] The instrument control system in the embodiment of the present application operates the instrument to be controlled based on the instrument instance to be controlled. Therefore, the user provides the instrument class file and configuration file corresponding to the new instrument, so that the instrument management module creates an instrument instance corresponding to the new instrument. The instrument scheduling module calls the instrument control method based on the instrument instance corresponding to the new instrument, and can autonomously connect to the new instrument to realize the control of the new instrument by the instrument control system, making the instrument control system scalable.
[0085] In some embodiments, the instrument management module is further configured to:
[0086] Receive a preset instrument class library update instruction; the preset instrument class library update instruction includes a new instrument class corresponding to the new instrument, and the preset instrument class library update instruction is generated after the at least one preset instrument class library is updated;
[0087] Loading a new instrument configuration file corresponding to the new instrument, and obtaining new attribute information of the new instrument;
[0088] The newly added instrument class is instantiated based on the newly added attribute information, and a newly added instrument instance corresponding to the newly added instrument is created.
[0089] In some embodiments, when a user connects a new instrument, it is necessary to update the preset instrument class library under the preset path and add a new instrument class corresponding to the new instrument in the extended instrument class library. After the user updates the preset instrument class library, the server will generate a preset instrument class library update instruction and send it to the instrument management module. The preset instrument class library update instruction includes the new instrument class corresponding to the new instrument. After receiving the preset instrument class library update instruction, the instrument management module loads the new instrument configuration file corresponding to the new instrument, obtains the new attribute information of the new instrument, and then instantiates the new instrument class based on the new attribute information to create a new instrument instance corresponding to the new instrument.
[0090] The instrument control system in the embodiment of the present application operates the instrument to be controlled based on the instance of the instrument to be controlled. Therefore, when the user connects a new instrument, he only needs to update the preset instrument class library, add the new instrument class corresponding to the new instrument, and provide the configuration file corresponding to the new instrument. After the user updates the preset instrument class library, the instrument management module responds to the preset instrument class library update instruction, and creates a new instrument instance corresponding to the new instrument based on the new instrument class and configuration file corresponding to the new instrument, so that the instrument control system can control the new instrument based on the new instrument instance. The user can independently connect to the new instrument, which improves the scalability of the instrument control system.
[0091] In some embodiments, the attribute information includes a preset instrument identifier of the at least one instrument to be connected, the instance acquisition instruction includes a target instrument identifier of each instrument to be controlled, and the instrument management module is further configured to:
[0092] Establishing a mapping relationship between the preset instrument identifier and the preset instrument instance to obtain a preset instrument key-value pair corresponding to each to-be-connected instrument;
[0093] In case of receiving the instance acquisition instruction, determining the instrument instance corresponding to the target instrument identifier in the preset instrument key-value pair as the instrument instance to be controlled;
[0094] The instance of the instrument to be controlled is sent to the instrument scheduling module.
[0095] In some embodiments, the preset instrument identifier and the target instrument identifier can be an instrument name, an instrument code, an instrument ID, etc. After the instrument management module creates a preset instrument instance corresponding to each to-be-connected instrument, it establishes a mapping relationship between the preset instrument identifier and the preset instrument instance based on the preset instrument identifier corresponding to each to-be-connected instrument, obtains a preset instrument key-value pair corresponding to each to-be-connected instrument, i.e., <preset instrument identifier, preset instrument instance>, and stores the preset instrument key-value pair in memory. Upon receiving an instance acquisition instruction sent by the instrument scheduling module, the instrument management module searches the preset instrument key-value pair based on the target instrument identifier of each to-be-controlled instrument contained in the instance acquisition instruction, determines the instrument instance corresponding to the target instrument identifier as the to-be-controlled instrument instance, and sends the to-be-controlled instrument instance to the instrument scheduling module.
[0096] The instrument management module in the embodiments of the present application is used to manage instrument instances. It saves the created preset instrument instances in the format of <preset instrument identifier, preset instrument instance>. This facilitates providing the instrument scheduling module with the corresponding instrument instances to be controlled upon receiving an instance acquisition instruction. Furthermore, because the instrument control system operates the controlled instrument based on the instrument instances to be controlled, the user can provide information related to the new instrument, causing the instrument management module to create an instrument instance corresponding to the new instrument. The instrument scheduling module then calls the instrument control method based on the instrument instance corresponding to the new instrument, autonomously accessing the new instrument and enabling the instrument control system to control the new instrument, thus making the instrument control system scalable.
[0097] In some embodiments, the attribute information further includes connection information of the at least one meter to be connected, and the meter driving module is further configured to:
[0098] receiving an instrument connection instruction sent by the instrument management module; the instrument connection instruction including connection information of each instrument to be connected;
[0099] Based on the connection information and the preset driving interface corresponding to the connection information, the connection between the instrument driving module and each instrument to be connected is achieved.
[0100] In some embodiments, the connection information may include information such as connection type and connection address. For example, if the connection type is USB connection, the connection address may be COM1; if the connection type is network card connection, the connection address may be the IP address of the instrument to be connected.
[0101] In some embodiments, the instrument management module sends an instrument connection instruction to the instrument driver module. The instrument driver module calls the preset driver interface corresponding to the connection information based on the connection information contained in the instrument connection instruction to realize the connection between the instrument driver module and each instrument to be connected. For example, if the connection type is a network card connection, the instrument driver module realizes the connection between the instrument driver module and the instrument to be connected based on the IP address of the instrument to be connected and the network card driver interface.
[0102] The instrument driver module in the embodiment of the present application has multiple common driver interfaces built in. The instrument driver module calls the preset driver interface corresponding to the connection information of the new instrument provided by the user, which can realize the connection between the instrument driver module and the instrument to be connected. The user can independently connect to the new instrument, which significantly improves the scalability of the instrument control system.
[0103] In some embodiments, the instrument scheduling module is further configured to:
[0104] Parsing each instrument control instruction to obtain a target instrument identifier of each instrument to be controlled and control information for each instrument to be controlled;
[0105] Acquire the to-be-controlled instrument instance corresponding to the target instrument identifier from the instrument management module;
[0106] The preset instrument control functions corresponding to the control information are called based on the instrument instance to be controlled, and the instrument instance to be controlled and the control information are sent to the instrument driving module.
[0107] In some embodiments, see Figure 3 , Figure 3 A schematic diagram of a module interaction relationship provided in an embodiment of the present application shows that after receiving at least one instrument control instruction, the instrument scheduling module parses each instrument control instruction to obtain the target instrument identifier of each instrument to be controlled and the control information for each instrument to be controlled, and then sends an instance acquisition instruction to the instrument management module to obtain the instrument instance to be controlled corresponding to the target instrument identifier, calls the preset instrument control function corresponding to the control information based on the instrument instance to be controlled, and sends the instrument instance to be controlled and the control information to the instrument driver module.
[0108] For example, the instrument scheduling module parses the instrument control instruction and obtains the target instrument identifier of the instrument to be controlled as SMU1, and the control information is to set the voltage to 5V. Then, it obtains the instrument instance to be controlled S2011Cinstrument1 corresponding to the target instrument identifier SMU1 from the instrument management module, calls the preset instrument control function setVotage() corresponding to the control information based on the instrument instance to be controlled S2011Cinstrument1, and sends the instrument instance to be controlled and the control information to the instrument driver module.
[0109] In some embodiments, see Figure 4 , Figure 4 A schematic diagram of the instrument control system architecture provided in an embodiment of the present application includes an access layer, namely the client, for sending instrument control instructions; a business processing layer, namely the instrument scheduling module, for unified coordination of underlying instrument resources; a basic capability layer, namely the instrument management module and the instrument driver module, for managing instrument instances and enabling communication between the instrument control system and the instrument to be controlled; and a data layer for storing instrument-related data.
[0110] The instrument control system in the embodiment of the present application includes a three-layer architecture of an instrument scheduling module, an instrument management module, and an instrument driver module. The instrument scheduling module is used to uniformly schedule multiple instruments to be controlled, the instrument management module is used to manage the instrument instances corresponding to the instruments to be controlled, and the instrument driver module is used to realize communication between the instrument control system and the instruments to be controlled. When the instrument scheduling module receives instrument control instructions sent by multiple clients, it obtains the instrument instance to be controlled corresponding to each instrument control instruction, calls the instrument control method corresponding to each client instruction based on the instrument instance to be controlled, and sends multiple instrument control instructions to the instrument driver module to realize control of the instrument to be controlled, thereby realizing decoupling between the client and the instrument driver module, supporting multiple clients to access the instrument control system, and avoiding multi-client access conflicts. In addition, the structure of the instrument control system is highly modular. When an abnormality occurs, the problem module can be processed separately, which is convenient for rapid location and repair.
[0111] In some embodiments, the instrument driver module is further configured to:
[0112] receiving the instance of the instrument to be controlled and the control information sent by the instrument scheduling module;
[0113] Determining the at least one instrument to be controlled based on the instrument instance to be controlled;
[0114] converting the control information into a target instrument instruction recognizable by the at least one instrument to be controlled;
[0115] The target instrument instruction is sent to the at least one instrument to be controlled.
[0116] In some embodiments, after the instrument driving module receives the instance of the instrument to be controlled and the control information sent by the instrument scheduling module, it processes the control information based on the instrument communication protocol corresponding to at least one instrument to be controlled, generates at least one target instrument instruction that can be recognized by the instrument to be controlled, and sends it to the at least one instrument to be controlled, so that the at least one instrument to be controlled performs the corresponding operation.
[0117] The instrument driving module in the embodiment of the present application is used to realize communication between the instrument control system and the instrument to be controlled. When the instrument scheduling module receives instrument control instructions sent by multiple clients, it obtains the instrument instance to be controlled corresponding to each instrument control instruction, calls the instrument control method corresponding to each client instruction based on the instrument instance to be controlled, and sends multiple instrument control instructions to the instrument driving module. The instrument driving module converts the multiple instrument control instructions into corresponding instrument-specific instructions and sends them to the corresponding instruments to be controlled to realize control of the instruments to be controlled, thereby realizing decoupling between the client and the instrument driving module, supporting multiple clients to access the instrument control system, and avoiding multiple client access conflicts.
[0118] In some embodiments, the instrument scheduling module is further configured to:
[0119] Acquire an instrument control result from the instrument driving module; the instrument control result is a result returned after the at least one instrument to be controlled respectively executes an operation corresponding to the at least one instrument control instruction;
[0120] The instrument control result is sent to the at least one client.
[0121] In some embodiments, after at least one instrument to be controlled executes an operation corresponding to at least one instrument control instruction, the operation result, i.e., the instrument control result, is returned to the instrument driving module. The instrument driving module then sends the instrument control result to the instrument scheduling module, and the instrument scheduling module then sends the instrument control result to at least one client corresponding to at least one instrument control instruction.
[0122] In the embodiment of the present application, the instrument scheduling module is responsible for the communication between the instrument control system and the client, and the instrument driver module is responsible for the communication between the instrument control system and the instrument to be controlled. After the instrument to be controlled executes the operation corresponding to the instrument control instruction, the generated operation result can be sent to the client through the instrument driver module and the instrument scheduling module in sequence. Since the instrument control system structure is highly modular, the problem module can be processed separately when an abnormality occurs, which is convenient for rapid location and repair.
[0123] An embodiment of the present application provides an instrument control system, the system comprising an instrument scheduling module, an instrument management module, and an instrument driver module; the instrument scheduling module is configured to receive at least one instrument control instruction, the at least one instrument control instruction being a control instruction for at least one instrument to be controlled sent by at least one client; obtain an instrument instance to be controlled corresponding to each instrument to be controlled from the instrument management module; call a preset instrument control function corresponding to each instrument control instruction based on the instrument instance to be controlled, and send each instrument control instruction to the instrument driver module; the instrument management module is configured to receive an instance acquisition instruction sent by the instrument scheduling module, and send the instrument instance to be controlled corresponding to the instance acquisition instruction to the instrument scheduling module; and the instrument driver module is configured to control the at least one instrument to be controlled to perform the operation corresponding to the at least one instrument control instruction. The instrument control system in the embodiment of the present application comprises a three-layer architecture comprising an instrument scheduling module, an instrument management module, and an instrument driver module. The instrument scheduling module is configured to uniformly schedule multiple instruments to be controlled, the instrument management module is configured to manage the instrument instances corresponding to the instruments to be controlled, and the instrument driver module is configured to implement communication between the instrument control system and the instruments to be controlled. When the instrument scheduling module receives instrument control instructions sent by multiple clients, it obtains the instrument instance to be controlled corresponding to each instrument control instruction, calls the instrument control method corresponding to each client instruction based on the instrument instance to be controlled, and sends multiple instrument control instructions to the instrument driving module to realize the control of the instruments to be controlled, thereby realizing the decoupling between the client and the instrument driving module, supporting multiple clients to access the instrument control system, and avoiding multiple client access conflicts.
[0124] The present application also provides an instrument control method, which is applied to the above instrument control system, and is specifically applied to the instrument scheduling module in the above instrument control system. Figure 5 , the method comprising:
[0125] S501, receiving at least one instrument control instruction, where the at least one instrument control instruction is a control instruction sent by at least one client and directed to at least one instrument to be controlled;
[0126] S503, sending an instance acquisition instruction to the instrument management module, and receiving from the instrument management module the instrument instance to be controlled corresponding to each instrument to be controlled;
[0127] S505 : Based on the instance of the instrument to be controlled, a preset instrument control function corresponding to each instrument control instruction is called, and each instrument control instruction is sent to an instrument driving module.
[0128] The present application also provides an instrument control device, see Figure 6, the device comprises:
[0129] The instrument control instruction receiving unit 610 is configured to receive at least one instrument control instruction, where the at least one instrument control instruction is a control instruction sent by at least one client and directed to at least one instrument to be controlled;
[0130] The to-be-controlled instrument instance acquisition unit 620 is configured to send an instance acquisition instruction to the instrument management module, and receive from the instrument management module the to-be-controlled instrument instance corresponding to each to-be-controlled instrument;
[0131] The preset instrument control function calling unit 630 is configured to call the preset instrument control function corresponding to each instrument control instruction based on the to-be-controlled instrument instance, and send each instrument control instruction to the instrument driving module.
[0132] In some embodiments, the instrument control instruction receiving unit 610 includes:
[0133] The instrument control instruction parsing subunit is configured to parse each instrument control instruction to obtain a target instrument identifier of each instrument to be controlled and control information for each instrument to be controlled.
[0134] In some embodiments, the to-be-controlled instrument instance acquiring unit 620 includes:
[0135] The to-be-controlled instrument instance acquiring subunit is configured to acquire the to-be-controlled instrument instance corresponding to the target instrument identifier from the instrument management module.
[0136] In some embodiments, the preset instrument control function calling unit 630 includes:
[0137] The preset instrument control function calling subunit is used to call the preset instrument control functions corresponding to the control information based on the instrument instance to be controlled, and send the instrument instance to be controlled and the control information to the instrument driving module.
[0138] In some embodiments, the apparatus further comprises:
[0139] An instrument control result acquisition unit, configured to acquire an instrument control result from the instrument driving module; the instrument control result is a result returned after the at least one instrument to be controlled respectively executes an operation corresponding to the at least one instrument control instruction;
[0140] The instrument control result sending unit is configured to send the instrument control result to the at least one client.
[0141] The apparatus provided in the above embodiments can execute the method provided in any embodiment of the present application, and has the functional modules and beneficial effects corresponding to the execution of the method. For technical details not fully described in the above embodiments, please refer to an instrument control system or method provided in any embodiment of the present application.
[0142] This embodiment further provides a computer-readable storage medium, in which computer-executable instructions are stored. The computer-executable instructions are loaded by a processor and execute the instrument control method described above in this embodiment.
[0143] This embodiment further provides an electronic device, which includes a processor and a memory, wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the instrument control method described above in this embodiment.
[0144] The electronic device may be a computer terminal, a mobile terminal or a server, and the electronic device may also participate in constituting the device or system provided in the embodiment of the present application. Figure 7 As shown, the electronic device 7 may include one or more (shown as 702a, 702b, ..., 702n in the figure) processors 702 (the processor 702 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPLD), a memory 704 for storing information, and a transmission device 706 for communication functions. In addition, it may also include: an input / output interface (I / O interface) and a network interface. It will be understood by those skilled in the art that Figure 7 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 7 More or fewer components than shown, or with Figure 7 Different configurations shown.
[0145] It should be noted that the one or more processors 702 and / or other information processing circuits described above may generally be referred to herein as "information processing circuitry." Such information processing circuitry may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. Furthermore, the information processing circuitry may be a single, independent processing module, or may be fully or partially integrated into any of the other components of the electronic device 7.
[0146] The memory 704 can be used to store software programs and modules of application software, such as program instructions / information storage devices corresponding to the methods described in the embodiments of the present application. The processor 702 executes various functional applications and information processing by running the software programs and modules stored in the memory 704, that is, to implement the above-mentioned instrument control method. The memory 704 may include a high-speed random access memory and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 704 may further include a memory remotely located relative to the processor 702, and these remote memories may be connected to the electronic device 7 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0147] The transmission device 706 is used to receive or send information via a network. Specific examples of the aforementioned network may include a wireless network provided by the communication provider of the electronic device 7. In one embodiment, the transmission device 706 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In one embodiment, the transmission device 706 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0148] This specification provides method operation steps as described in the embodiments or flowcharts, but more or fewer operation steps may be included based on routine or non-creative work. The steps and order listed in the embodiments are only one way of executing the order of many steps and do not represent the only execution order. When an actual system or interrupt product is executed, it can be executed sequentially or in parallel according to the method shown in the embodiments or the drawings (for example, in a parallel processor or multi-threaded processing environment).
[0149] The structure shown in this embodiment is only a partial structure related to the scheme of the present application, and does not constitute a limitation on the device to which the scheme of the present application is applied. The specific device may include more or fewer components than shown, or combine certain components, or have different arrangements of components. It should be understood that the methods, devices, etc. disclosed in this embodiment can be implemented in other ways. For example, the device embodiment described above is only schematic. For example, the division of the modules is only a division of logical functions. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or unit modules.
[0150] Based on this understanding, the technical solution of this application, or the portion that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of this application. The aforementioned storage medium includes: a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc., various media that can store program code.
[0151] Those skilled in the art may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in this specification can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the composition and steps of each example according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0152] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. An instrument control system, characterized in that: The system includes an instrument scheduling module, an instrument management module and an instrument driving module; The instrument scheduling module is configured to receive at least one instrument control instruction, where the at least one instrument control instruction is a control instruction sent by at least one client for at least one instrument to be controlled; Obtaining from the instrument management module the instrument instance to be controlled corresponding to each instrument to be controlled; Based on the instance of the instrument to be controlled, a preset instrument control function corresponding to each instrument control instruction is called, and each instrument control instruction is sent to the instrument driving module; The instrument management module is configured to receive the instance acquisition instruction sent by the instrument scheduling module, and send the to-be-controlled instrument instance corresponding to the instance acquisition instruction to the instrument scheduling module; The instrument driving module is used to control the at least one instrument to be controlled to respectively perform operations corresponding to the at least one instrument control instruction.
2. The instrument control system according to claim 1, characterized in that: The instrument management module is also used for: Receive the initialization instruction sent by the instrument scheduling module, load at least one preset instrument class library, and obtain the preset instrument class corresponding to each model of the preset instrument; Load the preset instrument configuration file and obtain the attribute information of at least one instrument to be connected; Determining a target instrument class corresponding to each to-be-connected instrument based on the preset instrument class and the attribute information; Instantiate the target instrument class based on the attribute information, and create a preset instrument instance corresponding to each instrument to be connected; The preset instrument instance includes the instrument instance to be controlled.
3. The instrument control system according to claim 2, characterized in that: The instrument management module is also used for: Receive a preset instrument class library update instruction; the preset instrument class library update instruction includes a new instrument class corresponding to the new instrument, and the preset instrument class library update instruction is generated after the at least one preset instrument class library is updated; Loading a new instrument configuration file corresponding to the new instrument, and obtaining new attribute information of the new instrument; The newly added instrument class is instantiated based on the newly added attribute information, and a newly added instrument instance corresponding to the newly added instrument is created.
4. The instrument control system according to claim 2, characterized in that: The attribute information includes a preset instrument identifier of the at least one instrument to be connected, the instance acquisition instruction includes a target instrument identifier of each instrument to be controlled, and the instrument management module is further configured to: Establishing a mapping relationship between the preset instrument identifier and the preset instrument instance to obtain a preset instrument key-value pair corresponding to each to-be-connected instrument; In case of receiving the instance acquisition instruction, determining the instrument instance corresponding to the target instrument identifier in the preset instrument key-value pair as the instrument instance to be controlled; The instance of the instrument to be controlled is sent to the instrument scheduling module.
5. The instrument control system according to claim 2, characterized in that: The attribute information also includes connection information of the at least one instrument to be connected, and the instrument driving module is further configured to: receiving an instrument connection instruction sent by the instrument management module; the instrument connection instruction including connection information of each instrument to be connected; Based on the connection information and the preset driving interface corresponding to the connection information, the connection between the instrument driving module and each instrument to be connected is achieved.
6. The instrument control system according to claim 1, characterized in that: The instrument scheduling module is also used for: Parsing each instrument control instruction to obtain a target instrument identifier of each instrument to be controlled and control information for each instrument to be controlled; Acquire the to-be-controlled instrument instance corresponding to the target instrument identifier from the instrument management module; The preset instrument control functions corresponding to the control information are called based on the instrument instance to be controlled, and the instrument instance to be controlled and the control information are sent to the instrument driving module.
7. The instrument control system according to claim 6, characterized in that: The instrument drive module is also used for: receiving the instance of the instrument to be controlled and the control information sent by the instrument scheduling module; Determining the at least one instrument to be controlled based on the instrument instance to be controlled; converting the control information into a target instrument instruction recognizable by the at least one instrument to be controlled; The target instrument instruction is sent to the at least one instrument to be controlled.
8. The instrument control system according to claim 1, characterized in that: The instrument scheduling module is also used for: Acquire an instrument control result from the instrument driving module; the instrument control result is a result returned after the at least one instrument to be controlled respectively executes an operation corresponding to the at least one instrument control instruction; The instrument control result is sent to the at least one client.
9. An instrument control method, characterized in that: The method is applied to an instrument control system, and the method includes: The instrument scheduling module receives at least one instrument control instruction, where the at least one instrument control instruction is a control instruction sent by at least one client for at least one instrument to be controlled; The instrument management module receives the instance acquisition instruction sent by the instrument scheduling module, and sends the to-be-controlled instrument instance corresponding to each to-be-controlled instrument to the instrument scheduling module; The instrument scheduling module calls the preset instrument control function corresponding to each instrument control instruction based on the instrument instance to be controlled, and sends each instrument control instruction to the instrument driving module; The instrument driving module controls the at least one instrument to be controlled to respectively execute an operation corresponding to the at least one instrument control instruction.
10. An instrument control method, characterized in that: The method is applied to an instrument scheduling module, and the method includes: receiving at least one instrument control instruction, where the at least one instrument control instruction is a control instruction sent by at least one client and directed to at least one instrument to be controlled; Sending an instance acquisition instruction to the instrument management module, and receiving from the instrument management module the instrument instance to be controlled corresponding to each instrument to be controlled; Based on the instance of the instrument to be controlled, a preset instrument control function corresponding to each instrument control instruction is called, and each instrument control instruction is sent to an instrument driving module.
11. An electronic device, characterized in that: The device includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the instrument control method according to claim 9 or 10.
Citation Information
Patent Citations
Test method, server and system
CN102231685A
Radio frequency test instrument sharing system and application method thereof
CN102769665A
Software development platform for embedded industrial control instrument
CN103077039A
Intelligent network management system and method used for monitoring state and dispatching for instruments
CN104731062A
Method, device and system of automatically controlling instrument
CN106325117A