Interaction method and device, electronic equipment and storage medium
By transferring the interactive logic of the industrial control system from hard-coded to configuration information, the problem of system rigidity is solved, and flexible control logic management and efficient system maintenance are achieved.
Patent Information
- Application Number
- CN202510410616.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-02
- Publication Date
- 2025-08-19
AI Technical Summary
The tight coupling between the components of the existing industrial control system leads to rigid system and it is difficult to quickly adapt to business needs or technological progress, affecting scalability and maintainability.
The interactive logic is abstracted from the hard-coded program and transferred to the configuration information for management. By continuously monitoring the current system status and the configuration information, the data item is triggered to perform target operations, and the control logic and code are separated.
A flexible and easy-to-maintenance system architecture is realized, reducing cross-departmental communication costs, improving work efficiency, and reducing program correction and release waiting time.
Smart Images

Figure CN120508343A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of industrial control technology, and in particular to an interaction method, device, electronic device, and storage medium. Background Art
[0002] Currently, control systems in medical devices typically consist of one or more industrial computers (IPCs) and a series of peripheral devices. Data exchange between these devices, as well as between the devices and the IPCs, follows predetermined logic to achieve a unified and coordinated workflow. In this architecture, the data exchange logic is primarily implemented by human-machine interface (HMI) or user interface (UI) software.
[0003] However, the communication protocols used by different devices vary significantly. This not only increases integration difficulties but also requires adjustments to the data interaction logic between devices as business needs change. This is especially true in complex industrial application scenarios, such as large-scale production lines or integrated management systems involving multiple types of equipment. UI software development and subsequent maintenance present significant challenges.
[0004] Taking surgical robots as an example, their control systems often involve complex state machine management and a large number of parameter settings. The UI software needs to access the data in the control system through specific communication protocols, such as the ADS (Automation Device Service) protocol, and dynamically update the display interface according to predefined rules. At the same time, these data also need to be synchronized to the software of other related equipment, such as imaging diagnostic workstations or other auxiliary equipment. Therefore, in this type of highly integrated industrial control system, the tight coupling between the various components has become a major feature. This means that even a small adjustment to a certain module may affect the entire system, triggering a chain reaction, and requiring a series of corresponding modifications across the entire system.
[0005] This high degree of interdependence and mutual influence poses a severe challenge to the scalability, maintainability, and flexibility of the control system. When faced with new business needs or technological advances, the existing system architecture may become too rigid and difficult to adapt quickly. Summary of the Invention
[0006] In order to solve the problems of the prior art, the embodiments of the present application provide an interactive method, device, electronic device and storage medium. The technical solution is as follows:
[0007] In one aspect, an interaction method is provided, the method comprising:
[0008] Acquire configuration information of the target system; the configuration information includes data items corresponding to each host computer of the target system; the data items indicate that a target operation is to be performed under the target system state;
[0009] Sending a system status request to a lower computer of the target system so that the lower computer returns the current system status of the target system;
[0010] If the current system state does not satisfy the target system state indicated by any data item in the configuration information, continue to obtain the current system state until the current system state obtained further satisfies the target system state indicated by any data item in the configuration information, and determine that the data item satisfied by the current system state obtained further is the target data item;
[0011] An instruction for executing the target operation indicated by the target data item is sent to the target host computer corresponding to the target data item, so that the target host computer executes the target operation indicated by the target data item and continues to obtain the current system status.
[0012] In another aspect, an interactive device is provided, comprising:
[0013] An information acquisition module is used to acquire configuration information of a target system; the configuration information includes data items corresponding to each host computer of the target system; the data items indicate the execution of a target operation under the target system state;
[0014] A status acquisition module is used to send a system status request to the lower computer of the target system so that the lower computer returns the current system status of the target system;
[0015] a target determination module, configured to, if the current system state does not satisfy the target system state indicated by any data item in the configuration information, continue to obtain the current system state until the current system state obtained further satisfies the target system state indicated by any data item in the configuration information, and determine that the data item satisfied by the current system state obtained further is the target data item;
[0016] The target instruction module is used to send an instruction to the target host computer corresponding to the target data item to execute the target operation indicated by the target data item, so that the target host computer executes the target operation indicated by the target data item and continues to obtain the current system status.
[0017] In an exemplary embodiment, the information acquisition module includes:
[0018] A configuration loading module, configured to load the configuration information in response to the startup of any of the host computers;
[0019] a variable loading module, configured to load the variables of the target system based on a list of variables to be loaded when the target system is started, if the configuration information is loaded successfully;
[0020] a startup success module, configured to, if there are unloaded variables in the list of variables to be loaded, continue loading the variables of the target system until there are no unloaded variables in the list of variables to be loaded, and determine that the target system is successfully started;
[0021] The state machine loading module is used to load the state machine configuration of the target system.
[0022] In an exemplary embodiment, the status acquisition module includes:
[0023] A status request module, configured to send a system status request to the slave computer so that the slave computer returns the behavior data of the target system;
[0024] A state conversion module is used to execute state conversion logic on the behavior data of the target system based on the state machine configuration to obtain the current system state.
[0025] In an exemplary embodiment, the apparatus further includes a data transfer module for acquiring data required by the target host computer to perform the target operation indicated by the target data item and sending the data to the target host computer, wherein the data transfer module includes:
[0026] A data acquisition module, configured to acquire target data in response to a data acquisition request sent by the target host computer; the data acquisition request indicates data required to perform a target operation indicated by the target data item;
[0027] A data execution module is used to send the target data to the target host computer, so that the target host computer executes the target operation indicated by the target data item based on the target data.
[0028] In an exemplary embodiment, the data acquisition request carries a target data identifier; the configuration information includes a mapping relationship between a communication node identifier, a port identifier, a data identifier, and a data address; and the data acquisition module includes:
[0029] A request parsing module, configured to parse the data acquisition request and obtain the target data identifier;
[0030] A configuration determination module, configured to determine a communication node identifier, a port identifier, and a data address corresponding to the target data identifier based on the configuration information;
[0031] A communication connection module, configured to establish a communication connection with a target communication node based on a communication node identifier and a port identifier corresponding to the target data identifier;
[0032] The data reading module is used to read the data of the target communication node based on the data address corresponding to the target data identifier to obtain the target data.
[0033] In an exemplary embodiment, the apparatus further includes a configuration information updating module for reloading the configuration information of the target system after the configuration information is updated, the configuration information updating module including:
[0034] A configuration updating module, configured to load the updated configuration information in response to an update of the configuration information;
[0035] The system configuration module is configured to use the updated configuration information as the configuration information of the target system.
[0036] On the other hand, an electronic device is provided, comprising 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 any of the above-mentioned interaction methods.
[0037] On the other hand, a computer-readable storage medium is provided, in which at least one instruction or at least one program is stored. The at least one instruction or the at least one program is loaded and executed by a processor to implement the interaction method as described in any of the above aspects.
[0038] On the other hand, a surgical robot is provided, comprising a slave control terminal and a master control terminal, wherein:
[0039] The slave control end is used to perform surgical operations, and the slave control end includes at least one surgical robotic arm;
[0040] The master control end is used to control the slave control end, and the slave control end control device includes a master hand mechanical arm;
[0041] at least one processor, the processor being disposed on the master end or the slave end; and
[0042] a memory communicatively connected to the at least one processor; wherein,
[0043] The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor to enable the at least one processor to perform any of the above-mentioned interaction methods.
[0044] In another aspect, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the electronic device to perform any of the above-described interaction methods.
[0045] The embodiment of the present application abstracts the interaction logic of the target system from the traditional hard-coded program and transfers it to the configuration information for management. The configuration information includes data items corresponding to each host computer of the target system, and the data items indicate the execution of target operations under the target system state; the current system state is continuously monitored and compared with the target system state stored in the configuration information. Once the current system state matches the target system state indicated by a data item in the configuration information, the host computer corresponding to the data item will be triggered to execute the target operation indicated by the data item. The control logic is configured, so that the control logic is separated from the actual code implementation, thereby achieving a more flexible and easy-to-maintain system architecture. Especially when developing a complete set of industrial control systems and frequently changing the control logic, changes to the control logic can be quickly implemented by simply adjusting the parameter settings in the configuration file without touching the underlying code, reducing the communication cost between departments. Once the configuration update is completed and passed the review, it can be directly applied to the production environment, greatly reducing the waiting time caused by program modification, compilation and release, and improving overall work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. 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.
[0047] Figure 1 This is a flow chart of an interactive method provided in an embodiment of the present application;
[0048] Figure 2 This is a flowchart of another interactive method provided in an embodiment of the present application;
[0049] Figure 3 This is a flowchart of a system initialization method provided in an embodiment of the present application;
[0050] Figure 4 This is an example diagram of the first type of configuration information provided in an embodiment of the present application;
[0051] Figure 5This is an example diagram of the second type of configuration information provided in an embodiment of the present application;
[0052] Figure 6 This is an example diagram of the third type of configuration information provided in an embodiment of the present application;
[0053] Figure 7 This is a structural block diagram of an interactive device provided in an embodiment of the present application;
[0054] Figure 8 This is a schematic diagram of an application scenario of a surgical robot system provided in an embodiment of the present application;
[0055] Figure 9 is a structural diagram of a slave operating device provided in an embodiment of the present application;
[0056] Figure 10 This is a hardware structure block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0057] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0058] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.
[0059] It is understandable that in the specific implementation of this application, related data such as user information is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0060] Existing technologies are characterized by the tight coupling between the various components of highly integrated industrial control systems. This means that even a small adjustment to a single module can have ripple effects across the entire system, triggering a chain reaction and requiring a series of corresponding modifications across the entire system. This high degree of interdependence and mutual influence poses severe challenges to the scalability, maintainability, and flexibility of industrial control systems. When faced with new business needs or technological advancements, existing system architectures can become too rigid and difficult to adapt quickly.
[0061] In view of this, this application proposes an interactive method, please refer to Figure 1 , which shows a flow chart of an interaction method provided by an embodiment of the present application. The interaction logic of the target system is abstracted from the traditional hard-coded program and transferred to configuration information for management. The configuration information includes data items corresponding to each host computer of the target system, and the data items indicate the execution of target operations under the target system state. The current system state is continuously monitored. The current system state can be defined as an ads variable. By monitoring the value of the variable, it is determined whether the current system state meets the target system state bound to any data item in the configuration information. Once the current system state matches the target system state indicated by a data item in the configuration information, the host computer corresponding to the data item is triggered to execute the target operation indicated by the data item. By configuring the control logic, the control logic is separated from the actual code implementation, thereby achieving a more flexible and easy-to-maintain system architecture. When developing a complete industrial control system and frequently changing the control logic, the control logic can be quickly modified by simply adjusting the parameter settings in the configuration file. Similarly, if multiple industrial control systems are being developed simultaneously, the interaction method provided by the embodiment of the present application can also be used. Only simple configuration modifications are required to adapt to the development of multiple industrial control systems at the same time.
[0062] See also Figure 2 , which shows a flow chart of another interactive method provided by an embodiment of the present application. It should be noted that this specification provides method operation steps such as the embodiments or flow charts, but may include more or fewer operation steps based on conventional or non-creative work. The order of steps listed in the embodiment is only one way of executing the steps among many, and does not represent the only execution order. When the actual system or product is executed, it can be executed in sequence or in parallel (for example, in a parallel processor or multi-threaded processing environment) according to the method shown in the embodiment or the accompanying drawings. Specifically, Figure 2 As shown, the method may include:
[0063] S201, obtaining configuration information of the target system.
[0064] The target system can be a device, a production line, or a more complex system integration, such as a system of surgical robot equipment.
[0065] Configuration information includes data items corresponding to each host computer in the target system. Specifically, configuration information refers to a set of predefined rules that tell the target system how to act based on the current system state. In practice, configuration information is typically a configuration file stored in a database or file system that defines the target system's behavior. Furthermore, the target system needs to support dynamic updates and version control for this configuration information.
[0066] Taking the surgical robot system as an example, the host computer typically includes a control host, a master hand host, a UI host, and other device hosts. The control host, serving as the host for the doctor's cart, provides access to and modification of data in the TwinCAT PLC (TwinCAT Programmable Logic Controller) project, a process implemented via ADS communication. The master hand host, serving as the host for the patient cart, provides access to various parameters of the master hand, such as physical data like position, angle, and force, by accessing the master hand's API (Application Programming Interface). The UI host provides access to and modification of UI interface element properties, such as the content of text controls and the visibility of image controls. This process uses reflection to locate controls with specified names and assigns them the given values. Other device hosts, such as the image host, are used to interpret images captured by the endoscope and provide access to and modification of data in the image cart software, a process implemented via TCP (Transmission Control Protocol). Any variable that needs to interact with other hosts can be defined as a data item.
[0067] Among them, the data item indicates the execution of the target operation under the target system state. Specifically, in the configuration information, the data item is an information unit used to represent the system state and its corresponding operation. The system state can be a physical quantity such as temperature, humidity, pressure, or a logical state such as device status, alarm flag, or safety parameters, operating mode, alarm threshold, etc. The target system state can be expressed as a logical expression to describe a more complex combination of conditional states; the operation refers to the action that the target system should perform or the state that changes under a specific system state. In specific implementations, each data item may also include a weight or priority setting to determine the priority execution order when multiple conditions are triggered.
[0068] In an exemplary embodiment, Figure 3As shown, the above step S201 may include the following steps:
[0069] In response to the startup of any host computer, loading configuration information;
[0070] If the configuration information is loaded successfully, the variables of the target system are loaded based on the list of variables to be loaded when the target system is started. The list of variables to be loaded is a collection of variables that need to be loaded during the startup or initialization phase of the target system. These variables usually refer to key parameters that must exist when the target system is started, or important data points required for communication with other components of the target system (such as sensors, actuators, etc.). Specifically, if the configuration information fails to load, a prompt will be displayed indicating that the parsing failed, the configuration information does not exist, etc., and the configuration information will be reloaded.
[0071] In the case that there are unloaded variables in the list of variables to be loaded, the variables of the target system continue to be loaded until there are no unloaded variables in the list of variables to be loaded, and it is determined that the target system has been successfully started. Specifically, if a variable in the list of variables to be loaded fails to be loaded, it is prompted that the parsing failed and the configuration information is reloaded. In a specific implementation, a certain startup time is given to the target system. If the startup time is exceeded and there are still unloaded variables in the list of variables to be loaded, it is determined that the startup timeout has occurred. At this time, it is considered that the target system has been started, but a variable in the list of variables to be loaded does not exist in the target system, and the configuration information is reloaded.
[0072] Load the state machine configuration of the target system; the state machine configuration defines the state and behavior of the target system. Specifically, if the state machine configuration is loaded successfully, the target system is considered to have been initialized. Conversely, if the state machine configuration fails to load, a parsing failure is prompted and the configuration information is reloaded.
[0073] Specifically, in order to achieve the purpose of dynamic configuration, the configuration information is defined in a json file, and the control host immediately parses the configuration file after the host computer software is started. Figure 3 The specific process of system initialization is shown in the . In order to prevent the json file from being unable to be parsed after being modified, a check on the json file is added. If the file does not exist, or the file format is incorrect and the parsing fails, the user will be prompted to check and modify it, and then reload it through reset. When a file fails to parse, it means that the system initialization has failed, and the file needs to be modified and the system initialization needs to be re-executed. Since there are many configuration files, including the configuration of the entire project parameters, the configuration of text information on the UI interface, the configuration of ads communication, the configuration of error codes, etc., it is necessary to check each file to ensure that when there is an abnormal file, the problematic file can be found immediately.
[0074] It can be seen from the above technical solutions of the embodiment of the present application that the embodiment of the present application considers that the initialization of the target system is completed only when the configuration information is loaded successfully, the target system is started successfully, and the state machine configuration is loaded successfully, thereby ensuring the integrity and reliability of the system, reducing maintenance costs, and enhancing the overall performance of the system.
[0075] S203: Send a system status request to the lower computer of the target system, so that the lower computer returns the current system status of the target system.
[0076] Among them, the lower computer refers to the industrial computer, which is directly connected to the sensors and actuators in the production process and is responsible for data collection and preliminary processing.
[0077] Specifically, you can poll periodically or request status when a specific event occurs. The interval between periodic requests can be configured according to application requirements, such as once every millisecond, to ensure that the system can respond to changes in a timely manner.
[0078] In an exemplary embodiment, the above step S203 may include the following steps:
[0079] Send a system status request to the lower computer so that the lower computer returns the behavior data of the target system;
[0080] Based on the state machine configuration, the state transition logic is executed on the behavior data of the target system to obtain the current system state.
[0081] Among them, behavioral data refers to data that reflects the current activity status of the target system, including but not limited to sensor readings, device status, operating parameters, etc.
[0082] The state machine configuration refers to a configuration file that defines the possible states of the target system and its transition logic.
[0083] Among them, the state transition logic refers to the process of changing the current system state according to predetermined rules based on the current system state and behavior data of the target system.
[0084] Specifically, the control host sends requests to the subordinate computers via the network or a dedicated communication interface, either periodically or as needed, requesting them to provide behavioral data of the target system. These requests are typically periodic to ensure real-time system status. Furthermore, the requests can include specific identifiers or parameters to precisely specify the type or range of the desired behavioral data.
[0085] Specifically, the system analyzes received behavioral data based on the state transition rules defined in the state machine configuration file and updates the current system state accordingly. A state machine configuration may include multiple states and the transition conditions between them. For example, if a temperature sensor reading exceeds a preset threshold, the system state may transition from "normal operation" to "overheating warning." State transition logic may also include advanced features such as conditional branching, loops, and delays to accommodate complex application scenarios.
[0086] It can be seen from the above technical solutions of the embodiments of the present application that, through the state transition logic, the target system can respond to changes quickly to avoid problems caused by slow response. By sending a system status request to the lower computer, the lower computer returns the behavior data of the target system, and executes the state transition logic on these behavior data based on the state machine configuration, thereby determining the current state of the target system and realizing real-time monitoring and intelligent management of the system state.
[0087] S205: Determine whether the current system state satisfies the target system state indicated by any data item in the configuration information.
[0088] Specifically, if the result of the judgment is no, step S203 may be executed; otherwise, if the result of the judgment is yes, step S207 may be executed.
[0089] Specifically, when the current system state does not satisfy the target system state indicated by any data item in the configuration information, continue to obtain the current system state; when the current system state satisfies the target system state indicated by any data item in the configuration information, determine that the data item satisfied by the current system state is the target data item.
[0090] S207: Determine the data item that is satisfied by the current system state as the target data item.
[0091] The target system state indicated by the target data item is consistent with the current system state.
[0092] S209: Send an instruction for executing the target operation indicated by the target data item to the target host computer corresponding to the target data item, so that the target host computer executes the target operation indicated by the target data item.
[0093] Specifically, continue to execute step S203.
[0094] The target host computer is the host computer corresponding to the target data item in the configuration information.
[0095] Specifically, once the target data item is determined, an execution command is sent to its corresponding target host computer, and the system status is monitored.
[0096] For example, a system status request is sent to the lower computer every 1 millisecond. When the current system status is initialized, the target system status indicated by each data item in the configuration information is checked. It can be determined that when the target system status is initialized, the corresponding target operation is to display the self-test button on the UI interface. At this time, if the user clicks the self-test button, the device will start self-test. After the self-test is completed, the system status will jump to the standby state. At this time, the cyclic detection will detect that the current system status is standby. It can be determined that when the target system status is standby, the corresponding target operation is to display the entry and master-slave control buttons on the UI interface. In this way, by binding the different content displayed on the UI interface under different system states in the configuration information, the effect of dynamic refresh of the UI interface is achieved.
[0097] For example, see Figure 4 , Figure 4 The figure shows how the UI interface dynamically changes based on the ads variable stateMachine. Here, stateMachine represents the ads variable, which we define as the system state machine. buttonList represents the list of action buttons on the UI interface. btnNameCN represents the Chinese name of the button, btnNameEN represents the English name of the button, and funName represents the name of the event executed when the button is pressed. The control host continuously monitors the value of the ads variable stateMachine in a loop thread. When the value of stateMachine is 1, it searches for data items that meet this state and updates the UI interface. At this time, the "Self-Test" button and the "Collaborative Arm Control" button appear on the UI interface. When the value of stateMachine reaches 2, the "Remove Fuse" button and the "Exit Self-Test" button appear on the UI interface. In the loop thread, the values of multiple ads variables are monitored, each of which is bound to a corresponding target operation, enabling data exchange between the control host and host computers such as the image host, master hand host, and UI host.
[0098] As can be seen from the above technical solutions of the embodiments of the present application, the embodiments of the present application abstract the interaction logic of the target system from the traditional hard-coded program and transfer it to the configuration information for management. The configuration information includes data items corresponding to each host computer of the target system, and the data items indicate the execution of target operations under the target system state; the current system state is continuously monitored and compared with the target system state stored in the configuration information. Once the current system state matches the target system state indicated by a data item in the configuration information, the host computer corresponding to the data item will be triggered to execute the target operation indicated by the data item. The control logic is configured, so that the control logic is separated from the actual code implementation, thereby achieving a more flexible and easy-to-maintain system architecture. Especially when developing a complete set of industrial control systems and frequently changing the control logic, changes to the control logic can be quickly implemented by simply adjusting the parameter settings in the configuration file without touching the underlying code, reducing the communication cost between departments. Once the configuration update is completed and passed the review, it can be directly applied to the production environment, greatly reducing the waiting time caused by program modification, compilation and release, and improving overall work efficiency.
[0099] In an exemplary embodiment, in step S209, the target host computer may issue a data acquisition request before executing the target operation indicated by the target data item, specifically including:
[0100] Responding to a data acquisition request sent by a target host computer, acquiring target data; the data acquisition request indicates the data required to perform the target operation indicated by the target data item;
[0101] The target data is sent to the target host computer so that the target host computer performs the target operation indicated by the target data item based on the target data.
[0102] The data acquisition request is sent by the target host computer to request the control host to provide specific data, which is necessary to perform specific operations.
[0103] The target data is the actual data obtained by the control host according to the data acquisition request, such as the status of each device.
[0104] In a specific implementation, the target data can be pre-processed, such as filtering and normalization, before being sent to the target host computer to ensure data quality. The target data can be returned to the target host computer via a data transmission protocol, such as TCP / IP (Transmission Control Protocol / Internet Protocol), ensuring lossless data transmission.
[0105] It can be seen from the above technical solutions of the embodiment of the present application that the embodiment of the present application obtains the data required to perform specific operations by responding to the data acquisition request of the target host computer, and transmits this data to the host computer in a timely manner, so that the host computer can perform predetermined operations based on this data, which not only improves the real-time and response speed of the system, but also enhances the reliability and automation level of the system, so that the system can manage the operating status of the equipment more efficiently and accurately.
[0106] In an exemplary embodiment, the data acquisition request carries a target data identifier; the configuration information includes a communication node identifier, a port identifier, a mapping relationship between a data identifier and a data address; and the step of acquiring the target data may include the following steps:
[0107] Parse the data acquisition request and obtain the target data identifier;
[0108] Determine the communication node identifier, port identifier, and data address corresponding to the target data identifier based on the configuration information;
[0109] Establishing a communication connection with the target communication node based on the communication node identifier and the port identifier corresponding to the target data identifier;
[0110] The data of the target communication node is read based on the data address corresponding to the target data identifier to obtain the target data.
[0111] Among them, the target data identifier refers to a label or index used to uniquely identify a specific data item, which helps to accurately locate and read data.
[0112] The configuration information is a set of information preset by the system, including the mapping relationship between the communication node identifier, port identifier, data identifier and data address, which is used to guide the accurate acquisition of data.
[0113] The communication node identifier is used to identify each device or node participating in the communication in the network, such as an IP address or a MAC address.
[0114] Among them, the port identifier refers to the port number in network communication, which is used to distinguish different services on the same computer.
[0115] The data address refers to the memory location or file path of data stored on a device, which is used to help find the specific data storage location.
[0116] Specifically, when the host computer sends a data acquisition request, the request contains the target data identifier. The recipient needs to parse the request to identify the required data identifier. The parsing process may involve decoding the request format, such as JSON or XML, as well as understanding and implementing the protocol standard.
[0117] Specifically, a connection to the target node is established using the known communication node identifier and port identifier. If the TCP protocol is used, a three-way handshake is required. Once the communication connection is established, the data on the target communication node can be accessed based on the data address. This involves the actual data reading operation, which may require data format conversion, decryption, and other processing to ensure that the data can be used correctly.
[0118] For example, see Figure 5 , Figure 5 The parameter configuration for the control host to communicate with the TwinCAT system is defined in it, including the IP address and the ads variable list. For example, the control host can read and write the address with the port number 851 and the variable name "MAIN.armState2UI" through the alias "armState", and define it as the status of each device. By parsing the defined data, the control host can obtain the status of the device in the program and send it to the UI interface. By parsing the configuration file, we can know that the ads variable for system startup is "systemStartup", the port number is 851, and the corresponding link in the PLC is "MAIN.armState2UI". By assigning a value to "systemStartup", the purpose of notification can be achieved. When the PLC link corresponding to the ads variable "systemStartup" changes, you only need to modify the new variable link, and the code in the program does not need to be changed.
[0119] It can be seen from the above technical solutions of the embodiment of the present application that the embodiment of the present application can identify the target data identifier by parsing the data acquisition request, and determine the communication node, port and data address according to the mapping relationship in the configuration information, and then establish a connection with the correct communication node and read data from the specified address, thereby improving the accuracy and efficiency of data acquisition, simplifying the process of data interaction in a complex network environment, and ensuring the reliability of data transmission.
[0120] In an exemplary embodiment, reloading the configuration information after the configuration information is updated may specifically include:
[0121] In response to an update of the configuration information, loading the updated configuration information;
[0122] The updated configuration information is used as the configuration information of the target system.
[0123] Specifically, when the configuration changes, the latest configuration is loaded into the target system's runtime environment, replacing the old one and becoming the currently valid configuration. This loading process involves parsing the configuration file, updating the configuration object in memory, and reinitializing components.
[0124] In specific implementations, the system may have a cache mechanism to temporarily save configuration information changes until the appropriate time to load them.
[0125] Specifically, configuration information can be modified based on changing requirements, providing scalability for the target system and reducing the rigidity of hard-coding. For example, when the UI needs to be adjusted, it can be done by simply modifying the relevant settings in the configuration information without changing the code. The interface will dynamically adjust according to the configuration. In addition to displaying different images and text, new elements can also be added or deleted.
[0126] For example, see Figure 6 ,and Figure 4 By contrast, modifying the UI configuration parameters can achieve a different UI interface and logic jump. When the stateMachine value is 1, the "Self-Test" button will be displayed on the UI; when the stateMachine value is 10, the "Clear Error" button will be displayed on the UI; when the stateMachine value is 2, 3, 4, or 5, the "Entry" button and "Master-Slave" button will be displayed on the UI.
[0127] As can be seen from the above technical solutions of the embodiments of the present application, by responding to configuration information updates and loading new configuration information, the target system can flexibly adjust its behavior and interface display without changing the core code, thereby providing strong scalability and ease of maintenance. When business needs change, simply modify the relevant settings in the configuration file, and the system can dynamically adjust its presentation and functionality, reducing the cost of software development and maintenance while improving the personalized level of user experience.
[0128] Corresponding to the interaction methods provided in the above-mentioned embodiments, an embodiment of the present application also provides an interaction device. Since the interaction device provided in the embodiment of the present application corresponds to the interaction methods provided in the above-mentioned embodiments, the implementation methods of the aforementioned interaction methods are also applicable to the interaction device provided in this embodiment and will not be described in detail in this embodiment.
[0129] See also Figure 7 , which is a schematic diagram of the structure of an interactive device provided by an embodiment of the present application, the device has the function of implementing the interactive method in the above method embodiment, the function can be implemented by hardware, or by hardware executing corresponding software. Figure 7 As shown, the device may include:
[0130] Information acquisition module 710, used to obtain configuration information of the target system; the configuration information includes data items corresponding to each host computer of the target system; the data items indicate the execution of target operations under the target system state;
[0131] The status acquisition module 720 is used to send a system status request to the lower computer of the target system so that the lower computer returns the current system status of the target system;
[0132] a target determination module 730 configured to, if the current system state does not satisfy the target system state indicated by any data item in the configuration information, continue to obtain the current system state until the current system state obtained further satisfies the target system state indicated by any data item in the configuration information, and then determine that the data item satisfied by the current system state obtained further is the target data item;
[0133] The target instruction module 740 is used to send an instruction to execute the target operation indicated by the target data item to the target host computer corresponding to the target data item, so that the target host computer executes the target operation indicated by the target data item and continues to obtain the current system status.
[0134] In an exemplary embodiment, the information acquisition module includes:
[0135] Configuration loading module, used for loading configuration information in response to the startup of any host computer;
[0136] The variable loading module is used to load the variables of the target system based on the list of variables to be loaded when the target system is started, if the configuration information is loaded successfully;
[0137] A startup success module is used to continue loading the variables of the target system when there are unloaded variables in the list of variables to be loaded, and determine that the target system is successfully started when there are no unloaded variables in the list of variables to be loaded;
[0138] The state machine loading module is used to load the state machine configuration of the target system.
[0139] In an exemplary embodiment, the status acquisition module includes:
[0140] The status request module is used to send a system status request to the lower computer so that the lower computer returns the behavior data of the target system;
[0141] The state transition module is used to execute the state transition logic on the behavior data of the target system based on the state machine configuration to obtain the current system state.
[0142] In an exemplary embodiment, the apparatus further includes a data transfer module for acquiring data required by the target host computer to perform the target operation indicated by the target data item and sending the data to the target host computer. The data transfer module includes:
[0143] A data acquisition module is used to acquire target data in response to a data acquisition request sent by a target host computer; the data acquisition request indicates the data required to perform the target operation indicated by the target data item;
[0144] The data execution module is used to send target data to the target host computer so that the target host computer executes the target operation indicated by the target data item based on the target data.
[0145] In an exemplary embodiment, the data acquisition request carries a target data identifier; the configuration information includes a communication node identifier, a port identifier, and a mapping relationship between a data identifier and a data address; and the data acquisition module includes:
[0146] Request parsing module, used to parse data acquisition request and obtain target data identification;
[0147] A configuration determination module, configured to determine a communication node identifier, a port identifier, and a data address corresponding to a target data identifier based on the configuration information;
[0148] A communication connection module, configured to establish a communication connection with a target communication node based on a communication node identifier and a port identifier corresponding to the target data identifier;
[0149] The data reading module is used to read the data of the target communication node based on the data address corresponding to the target data identifier to obtain the target data.
[0150] In an exemplary embodiment, the apparatus further includes a configuration information updating module for reloading the configuration information of the target system after the configuration information is updated, the configuration information updating module including:
[0151] A configuration update module, configured to load updated configuration information in response to an update of the configuration information;
[0152] The system configuration module is used to use the updated configuration information as the configuration information of the target system.
[0153] It should be noted that the apparatus provided in the above embodiments, when implementing its functions, is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0154] See also Figure 8 , Figure 8 The surgical robot system of this embodiment includes a master operating device 100 (i.e., a master control terminal) and a slave operating device 200 (i.e., a slave control terminal) controlled by the master operating device 100 .
[0155] The master operating device 100 has a control input device that can send control commands to the slave operating device 200 according to the operator's hand and / or foot movements to drive the posture adjustment of the robotic arm assembly of the slave operating device 200 and drive the execution device of the robotic arm assembly to perform corresponding operations.
[0156] like Figure 9 As shown, the slave operating device 200 includes a robotic arm assembly for performing surgical operations, a drive device 220 for driving the robotic arm assembly 210 according to control commands, and a base assembly 230 for adjusting the position of the drive device 220. The robotic arm assembly 210 includes at least one flexible robotic arm, and the end of each flexible robotic arm can be equipped with an instrument for performing different or the same surgical operations. The surgical operations that can be performed by the instrument include but are not limited to clamping, cutting, scissoring, suturing, electrocuting, electrocoagulation, or suctioning. For example, the instrument can be any of the following: needle holders, scissors, graspers, clip appliers, and aspirators. Needle holders are generally used for clamping, suturing, and knotting operations; scissors are generally used for thread cutting, dissection, and cutting operations; graspers are generally used for grasping and pulling operations; and clip appliers are generally used for ligation with ligature clips.
[0157] Optionally, the surgical robot system also includes an imaging device 400, which is used to obtain an image of the surgical field at the target location (referring to the patient's body cavity or tissue surface) photographed by the endoscope, and then image-process the surgical field image and transmit it to the first display device of the imaging device 400 and / or the second display device (not shown in the figure) of the main operating device 100 for display, so that the operator can observe the surgical field image. The surgical field image includes but is not limited to the type, number, position and posture of the performing instrument in the body cavity or on the tissue surface, the target organ tissue to be operated on and the morphology of the surrounding blood vessels, etc. Furthermore, a flexible robotic arm in the robotic arm assembly 210 of the operating device 200 can also be loaded with an endoscope for assisting in collecting images in the surgical field, which can then be displayed through the first display device and / or the second display device. It should be understood that the image displayed by the imaging device 400 can be a two-dimensional or three-dimensional image. The endoscope can include various endoscopes used for surgery, such as a thoracoscope, an arthroscope, and a rhinoscope.
[0158] Optionally, the surgical robot system further includes a supporting device 300 (eg, an operating table) for supporting the surgical object during surgery. The supporting device 300 may also be replaced with other surgical platforms depending on the type of surgery, which is not limited in this embodiment.
[0159] An embodiment of the present application 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 any one of the interaction methods provided in the above method embodiments.
[0160] The memory can be used to store software programs and modules. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory. The memory can mainly include a program storage area and a data storage area. The program storage area can store the operating system, application programs required for functions, etc.; the data storage area can store data created based on the use of the device, etc. In addition, the memory can include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory can also include a memory controller to provide the processor with access to the memory.
[0161] The method embodiments provided in the embodiments of the present application can be executed in a computer terminal, a server or a similar computing device, that is, the above-mentioned electronic device can include a computer terminal, a server or a similar computing device. Figure 10 This is a hardware structure diagram of a computer device that runs an interactive method provided by an embodiment of the present invention, such as Figure 10 As shown, the internal structure of the computer device may include but is not limited to: a processor, a network interface and a memory. The processor, network interface and memory in the computer device may be connected via a bus or other means. Figure 10 The bus connection is taken as an example.
[0162] Among them, the processor (or CPU (Central Processing Unit)) is the computing core and control core of the computer device. The network interface may optionally include a standard wired interface, a wireless interface (such as WI-FI, a mobile communication interface, etc.). Memory is a memory device in a computer device for storing programs and data. It is understandable that the memory here can be a high-speed RAM storage device or a non-volatile memory device (non-volatile memory), such as at least one disk storage device; optionally, it can also be at least one storage device located away from the aforementioned processor. The memory provides a storage space, which stores the operating system of the electronic device, which may include but is not limited to: Windows system (an operating system), Linux (an operating system), Android (Android, a mobile operating system) system, IOS (a mobile operating system) system, etc., and the present invention is not limited to this; and, in the storage space, one or more instructions suitable for being loaded and executed by the processor are also stored. These instructions can be one or more computer programs (including program codes). In the embodiment of this specification, the processor loads and executes one or more instructions stored in the memory to implement the interaction method provided by the above method embodiment.
[0163] An embodiment of the present application also provides a computer-readable storage medium, which can be set in an electronic device to store at least one instruction or at least one program related to implementing an interaction method. The at least one instruction or the at least one program is loaded and executed by the processor to implement any one of the interaction methods provided in the above method embodiments.
[0164] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.
[0165] An embodiment of the present application further provides a surgical robot, which includes a slave control terminal and a master control terminal, wherein:
[0166] The slave control end is used to perform surgical actions, and the slave control end includes at least one surgical robotic arm;
[0167] The master control end is used to control the slave control end, and the slave control end control device includes a master hand robot arm;
[0168] At least one processor, the processor being provided at the master end or the slave end; and
[0169] a memory communicatively connected to at least one processor; wherein,
[0170] The memory stores instructions that can be executed by at least one processor. The instructions are executed by the at least one processor to enable the at least one processor to perform any of the above-mentioned interactive methods.
[0171] It should be noted that the order of the embodiments of the present application described above is for descriptive purposes only and does not represent the superiority or inferiority of the embodiments. The above description is of specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0172] The various embodiments in this specification are described in a progressive manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences from other embodiments. In particular, the device embodiments are generally similar to the method embodiments, so the description is relatively simple. For relevant parts, refer to the description of the method embodiments.
[0173] Those skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or may be accomplished by a program instructing the relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk, or an optical disk, etc.
[0174] The above are only preferred embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application.
Claims
1. An interactive method, characterized in that: The method comprises: Acquire configuration information of the target system; the configuration information includes data items corresponding to each host computer of the target system; the data items indicate that a target operation is to be performed under the target system state; Sending a system status request to a lower computer of the target system so that the lower computer returns the current system status of the target system; If the current system state does not satisfy the target system state indicated by any data item in the configuration information, continue to obtain the current system state until the current system state obtained further satisfies the target system state indicated by any data item in the configuration information, and determine that the data item satisfied by the current system state obtained further is the target data item; An instruction for executing the target operation indicated by the target data item is sent to the target host computer corresponding to the target data item, so that the target host computer executes the target operation indicated by the target data item and continues to obtain the current system status.
2. The interactive method according to claim 1, characterized in that The obtaining of the configuration information of the target system includes: In response to the startup of any of the host computers, loading the configuration information; If the configuration information is loaded successfully, loading the variables of the target system based on the list of variables to be loaded when the target system is started; If there are unloaded variables in the list of variables to be loaded, continue loading the variables of the target system until there are no unloaded variables in the list of variables to be loaded, and determine that the target system is successfully started; The state machine configuration of the target system is loaded.
3. The interactive method according to claim 2, characterized in that: The sending of a system status request to the lower computer of the target system so that the lower computer returns the current system status of the target system includes: Sending a system status request to the lower computer so that the lower computer returns the behavior data of the target system; Based on the state machine configuration, state transition logic is executed on the behavior data of the target system to obtain the current system state.
4. The interactive method according to claim 1, wherein: The method further comprises: Responding to a data acquisition request sent by the target host computer, acquiring target data; the data acquisition request indicates data required to perform a target operation indicated by the target data item; The target data is sent to the target host computer, so that the target host computer performs the target operation indicated by the target data item based on the target data.
5. The interactive method according to claim 4, characterized in that: The data acquisition request carries a target data identifier; the configuration information includes a mapping relationship between a communication node identifier, a port identifier, a data identifier, and a data address; The acquiring target data includes: Parsing the data acquisition request to obtain the target data identifier; Determine the communication node identifier, port identifier, and data address corresponding to the target data identifier based on the configuration information; Establishing a communication connection with a target communication node based on the communication node identifier and the port identifier corresponding to the target data identifier; The data of the target communication node is read based on the data address corresponding to the target data identifier to obtain the target data.
6. The interactive method according to any one of claims 1 to 5, characterized in that: The method further comprises: In response to the update of the configuration information, loading the updated configuration information; The updated configuration information is used as the configuration information of the target system.
7. An interactive device, characterized in that: The device comprises: An information acquisition module is used to acquire configuration information of a target system; the configuration information includes data items corresponding to each host computer of the target system; the data items indicate the execution of a target operation under the target system state; A status acquisition module is used to send a system status request to the lower computer of the target system so that the lower computer returns the current system status of the target system; a target determination module, configured to, if the current system state does not satisfy the target system state indicated by any data item in the configuration information, continue to obtain the current system state until the current system state obtained further satisfies the target system state indicated by any data item in the configuration information, and determine that the data item satisfied by the current system state obtained further is the target data item; The target instruction module is used to send an instruction to the target host computer corresponding to the target data item to execute the target operation indicated by the target data item, so that the target host computer executes the target operation indicated by the target data item and continues to obtain the current system status.
8. An electronic device, characterized in that: The method comprises 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 at least one program is loaded and executed by the processor to implement the interaction method according to any one of claims 1 to 6.
9. A computer-readable storage medium, wherein the storage medium stores at least one instruction or at least one program, wherein the at least one instruction or the at least one program is loaded and executed by a processor to implement the interaction method according to any one of claims 1 to 6.
10. A surgical robot, characterized in that: The surgical robot includes a slave control terminal and a master control terminal, wherein: The slave control end is used to perform surgical operations, and the slave control end includes at least one surgical robotic arm; The master control end is used to control the slave control end, and the slave control end control device includes a master hand mechanical arm; at least one processor, the processor being disposed on the master end or the slave end; and a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the interaction method according to any one of claims 1 to 6.