An instrument control system, method and apparatus
By introducing a three-layer architecture consisting of an instrument scheduling module, an instrument management module, and an instrument driver module, the problem of multi-client access conflicts in existing instrument control systems is solved, achieving decoupling of multiple clients and system scalability.
Patent Information
- Application Number
- CN202510575282.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-06
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2045-05-06
AI Technical Summary
In existing instrument control systems, there is a strong binding relationship between the client and the instrument driver, making it impossible for multiple clients to access the instrument control system simultaneously.
It adopts a three-layer architecture consisting of an instrument scheduling module, an instrument management module, and an instrument driver module. The instrument scheduling module uniformly schedules multiple instruments, the instrument management module manages instrument instances, and the instrument driver module realizes communication between the instrument control system and the instruments, supporting access from multiple clients.
It decouples the client and the instrument driver module, supports access from multiple clients, avoids conflicts between multiple client accesses, and improves the scalability and flexibility of the instrument control system.
Smart Images

Figure CN120469358B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of instrumentation technology, and in particular to an instrumentation control system, method, and device. Background Technology
[0002] When controlling multiple instruments, the common solution in existing instrument control systems is to integrate the corresponding drivers for each instrument within the control system. Clients then directly manipulate these drivers using control commands to control the instruments. However, this existing solution has the following drawbacks: the client and the instrument driver are strongly bound together, preventing multiple clients from accessing the control system simultaneously. Summary of the Invention
[0003] To address the aforementioned technical problems, this application discloses an instrument control system, method, and device. It uses an instrument scheduling module to uniformly schedule multiple instruments, an instrument management module to manage instrument instances, and an instrument driver module to enable communication between the instrument control system and the instruments. It also supports access to the instrument control system from multiple clients.
[0004] On the one hand, this application provides an instrument control system, which includes an instrument scheduling module, an instrument management module, and an instrument drive module;
[0005] The instrument scheduling module is used to receive at least one instrument control instruction, which is a control instruction sent by at least one client for at least one instrument to be controlled; obtain the instrument instance corresponding to each instrument to be controlled from the instrument management module; and call the 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 used 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.
[0007] The instrument drive module is used to control the at least one instrument to be controlled to execute the operation corresponding to the at least one instrument control command.
[0008] In some embodiments, the instrument management module is further configured to:
[0009] Receive the initialization command sent by the instrument scheduling module, load at least one preset instrument class library, and obtain the preset instrument class corresponding to each type of preset instrument;
[0010] Load the preset instrument configuration file and obtain the attribute information of at least one instrument to be connected;
[0011] Based on the preset instrument class and the attribute information, determine the target instrument class corresponding to each instrument to be connected;
[0012] Based on the attribute information, the target instrument class is instantiated 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 library update instruction; the preset instrument library update instruction includes a new instrument class corresponding to a new instrument, and the preset instrument library update instruction is generated after the at least one preset instrument library is updated;
[0015] Load the configuration file for the newly added meter and obtain the new attribute information of the newly added meter;
[0016] Based on the newly added attribute information, the newly added meter class is instantiated to create a new meter instance corresponding to the newly added meter.
[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] Establish a mapping relationship between the preset instrument identifier and the preset instrument instance to obtain the preset instrument key-value pair corresponding to each instrument to be connected;
[0019] Upon receiving the instance acquisition instruction, the instrument instance corresponding to the target instrument identifier in the preset instrument key-value pair is determined 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 instrument to be connected, and the instrument driver module is further configured to:
[0022] Receive instrument connection instructions sent by the instrument management module; the instrument connection instructions include connection information for each instrument to be connected;
[0023] Based on the connection information and the preset driver interface corresponding to the connection information, the connection between the instrument driver module and each instrument to be connected is realized.
[0024] In some embodiments, the instrument scheduling module is further configured to:
[0025] Each instrument control command is parsed to obtain the target instrument identifier for each instrument to be controlled and the control information for each instrument to be controlled.
[0026] Obtain the instance of the instrument to be controlled corresponding to the target instrument identifier from the instrument management module;
[0027] Based on the instance of the instrument to be controlled, the preset instrument control function corresponding to the control information is called, and the instance of the instrument to be controlled and the control information are sent to the instrument driver module.
[0028] In some embodiments, the instrument drive module is further configured to:
[0029] Receive the instance of the instrument to be controlled and the control information sent by the instrument scheduling module;
[0030] The at least one instrument to be controlled is determined based on the instance of the instrument to be controlled;
[0031] The control information is converted into target instrument commands that can be recognized by the at least one instrument to be controlled;
[0032] The target instrument command is sent to the at least one instrument to be controlled.
[0033] In some embodiments, the instrument scheduling module is further configured to:
[0034] The instrument control result is obtained from the instrument driver module; the instrument control result is the result returned after the at least one instrument to be controlled executes the operation corresponding to the at least one instrument control command;
[0035] The instrument control results are sent to the at least one client.
[0036] On the other hand, this 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 command, which is a control command 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 instance of the instrument to be controlled corresponding to each instrument to be controlled to the instrument scheduling module.
[0039] The instrument scheduling module calls the preset instrument control function corresponding to each instrument control command based on the instrument instance to be controlled, and sends each instrument control command to the instrument driver module;
[0040] The instrument drive module controls the at least one instrument to be controlled to execute the operation corresponding to the at least one instrument control command.
[0041] On the other hand, this application also provides an instrument control method, which is applied to the above-mentioned instrument scheduling module, and the method includes:
[0042] Receive at least one instrument control command, wherein the at least one instrument control command is a control command sent by at least one client for at least one instrument to be controlled;
[0043] Send an instance acquisition command to the instrument management module, and receive the instance of each instrument to be controlled from the instrument management module;
[0044] Based on the instance of the instrument to be controlled, the preset instrument control function corresponding to each instrument control command is called, and each instrument control command is sent to the instrument driver module.
[0045] On the other hand, this application also provides an electronic device, the device including a processor and a memory, the memory storing at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement the above-described instrument control method.
[0046] Implementing the embodiments of this application has the following beneficial effects:
[0047] The instrument control system disclosed in this application comprises a three-layer architecture: an instrument scheduling module, an instrument management module, and an instrument driver module. The instrument scheduling module is used for unified scheduling of multiple instruments to be controlled. The instrument management module is used to manage the instrument instances corresponding to the instruments to be controlled. 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 commands sent by multiple clients, it obtains the instrument instance to be controlled corresponding to each instrument control command, calls the instrument control method corresponding to each client command based on the instrument instance to be controlled, and sends multiple instrument control commands to the instrument driver module to realize the control of the instruments to be controlled. This decouples the clients from the instrument driver module, supports multiple clients accessing the instrument control system, and avoids conflicts between multiple clients accessing the system. Attached Figure Description
[0048] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0049] Figure 1 This is a schematic diagram of the structure of an instrument control system provided in an embodiment of this application;
[0050] Figure 2 A schematic flowchart illustrating an instrument control method provided in an embodiment of this application;
[0051] Figure 3 A schematic diagram of module interaction relationships provided in an embodiment of this application;
[0052] Figure 4 A schematic diagram of an instrument control system architecture provided in this application embodiment;
[0053] Figure 5 A schematic flowchart illustrating an instrument control method provided in an embodiment of this application;
[0054] Figure 6 This is a schematic diagram of the structure of an instrument control device provided in an embodiment of this application;
[0055] Figure 7 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0056] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this application, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0057] In the description of this application, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. Furthermore, the terms "first," "second," etc., are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such information can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in a sequence other than that illustrated or described herein.
[0058] See Figure 1 , Figure 1 This is a schematic diagram of an instrument control system provided in an embodiment of the present application. The system includes an instrument scheduling module, an instrument management module, and an instrument drive module.
[0059] The instrument scheduling module is used to receive at least one instrument control instruction, which is a control instruction sent by at least one client for at least one instrument to be controlled; obtain the instrument instance corresponding to each instrument to be controlled from the instrument management module; and call the 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 used 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.
[0061] The instrument drive module is used to control the at least one instrument to be controlled to execute the operation corresponding to the at least one instrument control command.
[0062] In some embodiments, the instrument control system runs on a server and is used to control an instrument system consisting of multiple instruments, including instruments to be controlled, such as voltmeters, ammeters, voltage sources, current sources, and source meters.
[0063] In some embodiments, the instrument scheduling module can provide a unified remote access interface. Clients can send instrument control commands to the instrument scheduling module through this interface. The remote access interface can be implemented using RPC (Remote Procedure Call) technology; for example, it could be a gRPC (Google Remote Procedure Call) interface. Through this unified remote access interface, clients only need to send instrument control commands according to a specific interface call specification to control the instruments. The instrument control system supports remote access and instrument control between different platforms (i.e., the server and client can have different operating systems) via the remote access interface, adapting to distributed deployment requirements.
[0064] In some embodiments, the Business Center module receives instrument control commands sent by clients and coordinates underlying instrument resources in a unified manner when multiple clients send multiple instrument control commands simultaneously, avoiding conflicts between multiple client accesses. The Instrument Manager module manages the instrument instances corresponding to each instrument in the instrument system. The Driver Layer module has built-in various common driver interfaces, including NIDriver, VISADriver, serial communication, LAN communication, etc., to realize communication between the instrument control system and the instrument to be controlled.
[0065] In some embodiments, see Figure 2 , Figure 2 This is a flowchart illustrating an instrument control method provided in an embodiment of this application. The method includes:
[0066] S201, the instrument scheduling module receives at least one instrument control instruction, wherein 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, instrument control commands may be operation commands for the instrument to be controlled, such as setting voltage, setting current, measuring voltage, measuring current, and switching channels.
[0068] S203, the instrument management module receives the instance acquisition instruction sent by the instrument scheduling module and sends the instance of the instrument to be controlled corresponding to each instrument to be controlled to the instrument scheduling module;
[0069] In some embodiments, after receiving the instrument control command, the instrument scheduling module parses the instrument control command and then sends an instance acquisition command to the instrument management module, so that the instrument management module sends the corresponding instrument instance to be controlled to the instrument scheduling module based on the instance acquisition command.
[0070] S205, the instrument scheduling module calls the preset instrument control function corresponding to each instrument control command based on the instrument instance to be controlled, and sends each instrument control command to the instrument driver module;
[0071] In some embodiments, the instrument scheduling module calls the preset instrument control function corresponding to each instrument control command through the instrument instance corresponding to each instrument to be controlled, and sends each instrument control command to the instrument driver 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 voltage setting method, current setting method, voltage measurement method, current measurement method, channel switching method, etc. For example, if the instrument control instruction is a voltage setting instruction, its corresponding preset instrument control function is the voltage setting method setVotage(); if the instrument control instruction is a current setting instruction, its corresponding preset instrument control function is the current setting method setCurrent().
[0073] S207, the instrument drive module controls the at least one instrument to be controlled to execute the operation corresponding to the at least one instrument control command respectively.
[0074] In some embodiments, the instrument driving module processes at least one instrument control command based on the instrument communication protocol corresponding to at least one instrument to be controlled, converts it into corresponding instrument-specific commands, and sends them to at least one instrument to be controlled corresponding to at least one instrument control command, so that at least one instrument to be controlled can perform corresponding operations.
[0075] In some embodiments, the instrument management module is further configured to:
[0076] Receive the initialization command sent by the instrument scheduling module, load at least one preset instrument class library, and obtain the preset instrument class corresponding to each type of preset instrument;
[0077] Load the preset instrument configuration file and obtain the attribute information of at least one instrument to be connected;
[0078] Based on the preset instrument class and the attribute information, determine the target instrument class corresponding to each instrument to be connected;
[0079] Based on the attribute information, the target instrument class is instantiated 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 may be a dynamic link library (DLL). The preset instrument class library contains preset instrument classes corresponding to each model of preset instrument in the instrument system. The preset instrument classes define the attributes and methods that each model of preset instrument has. The attributes of the preset instrument may include instrument identifier, instrument type, instrument model, connection type, and connection address. The methods that the preset instrument can implement include preset instrument control functions. At least one preset instrument class library may include the built-in instrument class library Instrument.dll corresponding to the built-in instrument and the extended instrument class library ExtendInstrument.dll corresponding to the user extended instrument. Here, the built-in instrument refers to the instrument that already exists 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, the preset instrument configuration file is provided by the 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 the specific parameter information and specific connection information of the instrument to be connected. The specific parameter information may include the instrument identifier, instrument type, instrument model, voltage range / current range, number of channels, etc. of the instrument to be connected. The specific connection information may include the connection type, connection address, etc. of the instrument to be connected.
[0082] In some embodiments, after the instrument control system is started, the instrument scheduling module sends an initialization command 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 preset instrument, loads the preset instrument configuration file, obtains the attribute information of at least one instrument to be connected, determines the preset instrument class corresponding to at least one instrument to be connected based on the instrument model in the attribute information, determines it as the target instrument class, and instantiates the target instrument class based on the specific parameter information and specific connection information in the attribute information, creating a preset instrument instance corresponding to each instrument to be connected.
[0083] It should be noted that the preset instrument control functions that can be implemented by preset instruments can be defined by the base class BaseInstrument built into the instrument control system, and the preset instrument classes in the preset instrument class library can inherit from the base class. In addition, the preset instrument classes also define interfaces for obtaining preset instrument attribute information, such as getIRangeList(), getVRangeList(), and getChannelCount().
[0084] The instrument control system in this embodiment operates on the instrument to be controlled based on the instrument instance to be controlled. Therefore, by providing the instrument class file and configuration file corresponding to the new instrument, the user enables the instrument management module to create a new 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 independently access the new instrument to realize the control of the new instrument by the instrument control system, thus making the instrument control system scalable.
[0085] In some embodiments, the instrument management module is further configured to:
[0086] Receive a preset instrument library update instruction; the preset instrument library update instruction includes a new instrument class corresponding to a new instrument, and the preset instrument library update instruction is generated after the at least one preset instrument library is updated;
[0087] Load the configuration file for the newly added meter and obtain the new attribute information of the newly added meter;
[0088] Based on the newly added attribute information, the newly added meter class is instantiated to create a new meter instance corresponding to the newly added meter.
[0089] In some embodiments, when a user adds a new meter, the preset meter library under the preset path needs to be updated. The new meter class corresponding to the new meter is added to the extended meter library. After the user updates the preset meter library, the server will generate a preset meter library update instruction and send it to the meter management module. The preset meter library update instruction includes the new meter class corresponding to the new meter. After receiving the preset meter library update instruction, the meter management module loads the new meter configuration file corresponding to the new meter, obtains the new attribute information of the new meter, and then instantiates the new meter class based on the new attribute information to create a new meter instance corresponding to the new meter.
[0090] The instrument control system in this embodiment operates on the instrument to be controlled based on the instrument instance. Therefore, when a user adds a new instrument, they only need 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 command and creates the new instrument instance corresponding to the new instrument based on the new instrument class and configuration file. This enables the instrument control system to control the new instrument based on the new instrument instance. Users can independently add new instruments, 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] Establish a mapping relationship between the preset instrument identifier and the preset instrument instance to obtain the preset instrument key-value pair corresponding to each instrument to be connected;
[0093] Upon receiving the instance acquisition instruction, the instrument instance corresponding to the target instrument identifier in the preset instrument key-value pair is determined 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 instrument name, instrument code, instrument ID, etc. After the instrument management module creates a preset instrument instance corresponding to each instrument to be connected, it establishes a mapping relationship between the preset instrument identifier and the preset instrument instance based on the preset instrument identifier corresponding to each instrument to be connected, obtaining a preset instrument key-value pair corresponding to each instrument to be connected, i.e., <preset instrument identifier, preset instrument instance>, and stores the preset instrument key-value pair in memory. When the instrument management module receives an instance acquisition instruction sent by the instrument scheduling module, it queries the preset instrument key-value pair based on the target instrument identifier of each instrument to be controlled contained in the instance acquisition instruction, determines the instrument instance corresponding to the target instrument identifier as the instrument instance to be controlled, and sends the instrument instance to be controlled to the instrument scheduling module.
[0096] The instrument management module in this embodiment manages instrument instances. It saves created preset instrument instances in the form of <preset instrument identifier, preset instrument instance>, facilitating the provision of corresponding target instrument instances to the instrument scheduling module upon receiving an instance retrieval command. Furthermore, since the instrument control system operates on target instrument instances, users can provide new instrument information, enabling the instrument management module to create new instrument instances corresponding to those new instruments. The instrument scheduling module, based on these new instrument instances, can then invoke instrument control methods, allowing for independent access to new instruments and enabling the instrument control system to control them. This provides scalability to the instrument control system.
[0097] In some embodiments, the attribute information further includes connection information of the at least one instrument to be connected, and the instrument driver module is further configured to:
[0098] Receive instrument connection instructions sent by the instrument management module; the instrument connection instructions include connection information for each instrument to be connected;
[0099] Based on the connection information and the preset driver interface corresponding to the connection information, the connection between the instrument driver module and each instrument to be connected is realized.
[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 command to the instrument driver module. Based on the connection information contained in the instrument connection command, the instrument driver module calls the preset driver interface corresponding to the connection information 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 this embodiment has a variety of 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. Users can independently connect new instruments, which significantly improves the scalability of the instrument control system.
[0103] In some embodiments, the instrument scheduling module is further configured to:
[0104] Each instrument control command is parsed to obtain the target instrument identifier for each instrument to be controlled and the control information for each instrument to be controlled.
[0105] Obtain the instance of the instrument to be controlled corresponding to the target instrument identifier from the instrument management module;
[0106] Based on the instance of the instrument to be controlled, the preset instrument control function corresponding to the control information is called, and the instance of the instrument to be controlled and the control information are sent to the instrument driver module.
[0107] In some embodiments, see Figure 3 , Figure 3 This is a schematic diagram of module interaction provided in an embodiment of this application. After receiving at least one instrument control command, the instrument scheduling module parses each instrument control command to obtain the target instrument identifier of each instrument to be controlled and the control information for each instrument to be controlled. Then, it sends an instance acquisition command to the instrument management module to obtain the instrument instance to be controlled corresponding to the target instrument identifier. Based on the instrument instance to be controlled, it calls the preset instrument control functions corresponding to the control information respectively, 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 command to obtain the target instrument identifier SMU1 and the control information set voltage to 5V. Then, it obtains the target instrument instance S2011Cinstrument1 corresponding to the target instrument identifier SMU1 from the instrument management module. Based on the target instrument instance S2011Cinstrument1, it calls the preset instrument control function setVotage() corresponding to the control information and sends the target instrument instance and control information to the instrument driver module.
[0109] In some embodiments, see Figure 4 , Figure 4 This is a schematic diagram of an instrument control system architecture provided in an embodiment of this application. The access layer, i.e., the client, is used to send instrument control commands; the business processing layer, i.e., the instrument scheduling module, is used to coordinate the underlying instrument resources in a unified manner; the basic capability layer, i.e., the instrument management module and the instrument driver module, is used to manage instrument instances and realize communication between the instrument control system and the instrument to be controlled; and the data layer is used to store instrument-related data.
[0110] The instrument control system in this embodiment comprises a three-layer architecture: an instrument scheduling module, an instrument management module, and an instrument driver module. The instrument scheduling module is used for unified scheduling of multiple instruments to be controlled. The instrument management module is used to manage the instrument instances corresponding to the instruments to be controlled. 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 commands from multiple clients, it obtains the instrument instance to be controlled corresponding to each instrument control command, calls the instrument control method corresponding to each client command based on the instrument instance to be controlled, and sends multiple instrument control commands to the instrument driver module to realize the control of the instruments to be controlled. This decouples the clients from the instrument driver module, supports multiple clients accessing the instrument control system, and avoids conflicts between multiple clients. In addition, the instrument control system has a highly modular structure, and when an anomaly occurs, the problematic module can be handled separately, which facilitates rapid location and repair.
[0111] In some embodiments, the instrument drive module is further configured to:
[0112] Receive the instance of the instrument to be controlled and the control information sent by the instrument scheduling module;
[0113] The at least one instrument to be controlled is determined based on the instance of the instrument to be controlled;
[0114] The control information is converted into target instrument commands that can be recognized by the at least one instrument to be controlled;
[0115] The target instrument command is sent to the at least one instrument to be controlled.
[0116] In some embodiments, after receiving the instance of the instrument to be controlled and the control information sent by the instrument scheduling module, the instrument driving module processes the control information according to the instrument communication protocol corresponding to at least one instrument to be controlled, generates target instrument commands that can be recognized by at least one instrument to be controlled, and sends them to at least one instrument to be controlled so that at least one instrument to be controlled can perform corresponding operations.
[0117] The instrument driver module in this embodiment is used to realize communication between the instrument control system and the instrument to be controlled. When the instrument scheduling module receives instrument control commands sent by multiple clients, it obtains the instrument instance to be controlled corresponding to each instrument control command, calls the instrument control method corresponding to each client command based on the instrument instance to be controlled, and sends multiple instrument control commands to the instrument driver module. The instrument driver module converts the multiple instrument control commands into corresponding instrument-specific commands and sends them to the corresponding instrument to be controlled, thereby realizing the control of the instrument to be controlled. This can decouple the client and the instrument driver module, support multiple clients to access the instrument control system, and avoid multiple client access conflicts.
[0118] In some embodiments, the instrument scheduling module is further configured to:
[0119] The instrument control result is obtained from the instrument driver module; the instrument control result is the result returned after the at least one instrument to be controlled executes the operation corresponding to the at least one instrument control command;
[0120] The instrument control results are sent to the at least one client.
[0121] In some embodiments, after at least one instrument to be controlled executes the operation corresponding to at least one instrument control command, the operation result, i.e. the instrument control result, is returned to the instrument driver module. The instrument driver 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 command.
[0122] In this embodiment, the instrument scheduling module is responsible for communication between the instrument control system and the client, and the instrument driver module is responsible for 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 command, the generated operation result can be sent to the client in sequence through the instrument driver module and the instrument scheduling module. Since the instrument control system has a highly modular structure, the problematic module can be handled separately when an anomaly occurs, which facilitates quick location and repair.
[0123] This application provides an instrument control system, which includes an instrument scheduling module, an instrument management module, and an instrument driving module. The instrument scheduling module receives at least one instrument control command, which is a control command sent by at least one client for at least one instrument to be controlled. It obtains an instance of each instrument to be controlled from the instrument management module. Based on the instance of the instrument to be controlled, it calls a preset instrument control function corresponding to each instrument control command and sends each instrument control command to the instrument driving module. The instrument management module receives an instance acquisition command sent by the instrument scheduling module and sends the instance of the instrument to be controlled corresponding to the instance acquisition command to the instrument scheduling module. The instrument driving module controls the at least one instrument to be controlled to execute the operation corresponding to the at least one instrument control command. The instrument control system in this application includes a three-layer architecture: an instrument scheduling module, an instrument management module, and an instrument driving module. The instrument scheduling module is used for unified scheduling of multiple instruments to be controlled, the instrument management module is used for managing the instrument instances corresponding to the instruments to be controlled, and the instrument driving module is used for communication between the instrument control system and the instruments to be controlled. When the instrument scheduling module receives instrument control commands from multiple clients, it obtains the instrument instance to be controlled corresponding to each instrument control command, calls the instrument control method corresponding to each client command based on the instrument instance to be controlled, and sends multiple instrument control commands to the instrument driver module to realize the control of the instrument to be controlled. This can decouple the client from the instrument driver module, support multiple clients to access the instrument control system, and avoid conflicts between multiple clients.
[0124] This application also provides an instrument control method, which is applied to the aforementioned instrument control system, specifically to the instrument scheduling module within the aforementioned instrument control system. (See [link]). Figure 5 The method includes:
[0125] S501, Receive at least one instrument control command, wherein the at least one instrument control command is a control command sent by at least one client for at least one instrument to be controlled;
[0126] S503, send an instance acquisition instruction to the instrument management module, and receive the instrument instance corresponding to each instrument to be controlled from the instrument management module;
[0127] S505, based on the instance of the instrument to be controlled, call the preset instrument control function corresponding to each instrument control command, and send each instrument control command to the instrument driver module.
[0128] This application also provides an instrument control device, see [link]. Figure 6The device includes:
[0129] The instrument control command receiving unit 610 is used to receive at least one instrument control command, wherein the at least one instrument control command is a control command sent by at least one client for at least one instrument to be controlled.
[0130] The instrument instance acquisition unit 620 is used to send an instance acquisition instruction to the instrument management module and receive the instrument instance corresponding to each instrument to be controlled from the instrument management module.
[0131] The preset instrument control function calling unit 630 is used to call the preset instrument control function corresponding to each instrument control command based on the instrument instance to be controlled, and send each instrument control command to the instrument driver module.
[0132] In some embodiments, the instrument control command receiving unit 610 includes:
[0133] The instrument control command parsing subunit is used to parse each instrument control command to obtain the target instrument identifier of each instrument to be controlled and the control information for each instrument to be controlled.
[0134] In some embodiments, the instrument instance acquisition unit 620 includes:
[0135] The instrument instance acquisition subunit is used to acquire the instrument instance to be controlled corresponding to the target instrument identifier from the instrument management module.
[0136] In some embodiments, the preset instrument control function call unit 630 includes:
[0137] The preset instrument control function call subunit is used to call the preset instrument control function 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 driver module.
[0138] In some embodiments, the apparatus further includes:
[0139] An instrument control result acquisition unit is used to acquire instrument control results from the instrument drive module; the instrument control result is the result returned after the at least one instrument to be controlled executes the operation corresponding to the at least one instrument control command respectively;
[0140] An instrument control result sending unit is used 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 this application, and has the corresponding functional modules and beneficial effects for executing the method. Technical details not described in detail in the above embodiments can be found in an instrument control system or method provided in any embodiment of this application.
[0142] This embodiment also provides a computer-readable storage medium storing computer-executable instructions, which are loaded by a processor and executed by the instrument control method described above in this embodiment.
[0143] This embodiment also provides an electronic device, which includes a processor and a memory, wherein the memory stores a computer program adapted to be loaded by the processor and executed as described above in this embodiment of an instrument control method.
[0144] The electronic device may be a computer terminal, a mobile terminal, or a server, and may also participate in constituting the apparatus or system provided in the embodiments of this application. For example... Figure 7 As shown, the electronic device 7 may include one or more (shown as 702a, 702b, ..., 702n in the figure) processors 702 (processors 702 may include, but are not limited to, microprocessors MCUs or programmable logic devices FPLDs), a memory 704 for storing information, and a transmission device 706 for communication functions. In addition, it may also include input / output interfaces (I / O interfaces) and network interfaces. Those skilled in the art will understand that... Figure 7 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, electronic device 7 may also include... Figure 7 The more or fewer components shown, or having the same Figure 7 The different configurations shown.
[0145] It should be noted that the aforementioned one or more processors 702 and / or other information processing circuits are generally referred to herein as "information processing circuits". These information processing circuits may be wholly or partially embodied in software, hardware, firmware, or any other combination thereof. Furthermore, the information processing circuits may be a single, independent processing module, or may be wholly or partially integrated into any other element within the electronic device 7.
[0146] The memory 704 can be used to store software programs and modules of application software, such as the program instruction / information storage device corresponding to the method described in the embodiments of this application. The processor 702 executes various functional applications and information processing by running the software programs and modules stored in the memory 704, thereby realizing the above-mentioned instrument control method. The memory 704 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 704 may further include memory remotely located relative to the processor 702, and these remote memories can be connected to the electronic device 7 via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0147] The transmission device 706 is used to receive or send information via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the electronic device 7. In one example, the transmission device 706 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 706 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0148] This specification provides the operational steps of the methods described in the embodiments or flowcharts, but more or fewer operational steps may be included based on conventional or non-inventive labor. The steps and order listed in the embodiments are merely one possible execution order among many steps and do not represent the only execution order. In actual system or interrupt product execution, the methods shown in the embodiments or drawings can be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment).
[0149] The structure shown in this embodiment is only a partial structure related to the solution of this application and does not constitute a limitation on the device to which the solution of this application is applied. Specific devices may include more or fewer components than shown, or combinations of certain components, or arrangements of different components. It should be understood that the methods, apparatuses, etc., disclosed in this embodiment can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between devices or unit modules through some interfaces.
[0150] Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0151] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this specification can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0152] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. An instrument control system, characterized in that, The system includes an instrument scheduling module, an instrument management module, and an instrument drive module; The instrument scheduling module is used to receive at least one instrument control instruction, wherein 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. Obtain the instance of each instrument to be controlled from the instrument management module; Based on the instance of the instrument to be controlled, the preset instrument control function corresponding to each instrument control command is called, and each instrument control command is sent to the instrument driver module; The instrument management module is used 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. The instrument drive module is used to control the at least one instrument to be controlled to execute the operation corresponding to the at least one instrument control command respectively; The instrument management module is also used to receive initialization instructions sent by the instrument scheduling module, load at least one preset instrument class library, and obtain the preset instrument class corresponding to each type of preset instrument. Load the preset instrument configuration file and obtain the attribute information of at least one instrument to be connected; Based on the preset instrument class and the attribute information, determine the target instrument class corresponding to each instrument to be connected; Based on the attribute information, the target instrument class is instantiated to create a preset instrument instance corresponding to each instrument to be connected; The preset instrument instance includes the instrument instance to be controlled.
2. The instrument control system according to claim 1, characterized in that, The instrument management module is also used for: Receive a preset instrument library update instruction; the preset instrument library update instruction includes a new instrument class corresponding to a new instrument, and the preset instrument library update instruction is generated after the at least one preset instrument library is updated; Load the configuration file for the newly added meter and obtain the new attribute information of the newly added meter; Based on the newly added attribute information, the newly added meter class is instantiated to create a new meter instance corresponding to the newly added meter.
3. The instrument control system according to claim 1, characterized in that, The attribute information includes a preset instrument identifier for the at least one instrument to be connected, the instance acquisition instruction includes a target instrument identifier for each instrument to be controlled, and the instrument management module is further configured to: Establish a mapping relationship between the preset instrument identifier and the preset instrument instance to obtain the preset instrument key-value pair corresponding to each instrument to be connected; Upon receiving the instance acquisition instruction, the instrument instance corresponding to the target instrument identifier in the preset instrument key-value pair is determined as the instrument instance to be controlled; The instance of the instrument to be controlled is sent to the instrument scheduling module.
4. The instrument control system according to claim 1, characterized in that, The attribute information also includes connection information for the at least one instrument to be connected, and the instrument driver module is further configured to: Receive instrument connection instructions sent by the instrument management module; the instrument connection instructions include connection information for each instrument to be connected; Based on the connection information and the preset driver interface corresponding to the connection information, the connection between the instrument driver module and each instrument to be connected is realized.
5. The instrument control system according to claim 1, characterized in that, The instrument scheduling module is also used for: Each instrument control command is parsed to obtain the target instrument identifier for each instrument to be controlled and the control information for each instrument to be controlled. Obtain the instance of the instrument to be controlled corresponding to the target instrument identifier from the instrument management module; Based on the instance of the instrument to be controlled, the preset instrument control function corresponding to the control information is called, and the instance of the instrument to be controlled and the control information are sent to the instrument driver module.
6. The instrument control system according to claim 5, characterized in that, The instrument drive module is also used for: Receive the instance of the instrument to be controlled and the control information sent by the instrument scheduling module; The at least one instrument to be controlled is determined based on the instance of the instrument to be controlled; The control information is converted into target instrument commands that can be recognized by the at least one instrument to be controlled; The target instrument command is sent to the at least one instrument to be controlled.
7. The instrument control system according to claim 1, characterized in that, The instrument scheduling module is also used for: The instrument control result is obtained from the instrument driver module; the instrument control result is the result returned after the at least one instrument to be controlled executes the operation corresponding to the at least one instrument control command; The instrument control results are sent to the at least one client.
8. 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 command, which is a control command sent by at least one client for at least one instrument to be controlled; The instrument management module receives an instance acquisition instruction from the instrument scheduling module and sends the corresponding instrument instance to be controlled for each instrument to be controlled to the instrument scheduling module; it receives an initialization instruction from the instrument scheduling module, loads at least one preset instrument class library, and obtains the preset instrument class corresponding to each model of preset instrument; it loads a preset instrument configuration file and obtains the attribute information of at least one instrument to be connected; based on the preset instrument class and the attribute information, it determines the target instrument class corresponding to each instrument to be connected; it instantiates the target instrument class 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; The instrument scheduling module calls the preset instrument control function corresponding to each instrument control command based on the instrument instance to be controlled, and sends each instrument control command to the instrument driver module; The instrument drive module controls the at least one instrument to be controlled to execute the operation corresponding to the at least one instrument control command.
9. An instrument control method, characterized in that, The method is applied to the instrument scheduling module, and the method includes: Receive at least one instrument control command, wherein the at least one instrument control command is a control command sent by at least one client for at least one instrument to be controlled; Send an instance acquisition command to the instrument management module, and receive the instance of each instrument to be controlled from the instrument management module; Based on the instance of the instrument to be controlled, the preset instrument control function corresponding to each instrument control command is called, and each instrument control command is sent to the instrument driver module; An initialization command is sent to the instrument management module to cause the instrument management module to load at least one preset instrument class library and obtain the preset instrument class corresponding to each model of preset instrument; load the preset instrument configuration file and obtain the attribute information of at least one instrument to be connected; determine the target instrument class corresponding to each instrument to be connected based on the preset instrument class and the attribute information; instantiate the target instrument class 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.
10. An electronic device, characterized in that, The device includes a processor and a memory, the memory storing at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement the instrument control method as described in claim 8 or 9.
Citation Information
Patent Citations
Test method, server and system
CN102231685A
Radio frequency test instrument sharing system and application method thereof
CN102769665A
