Medical robot image algorithm deployment method and apparatus, medical robot image algorithm scheduling method and apparatus, and system

By building and managing image algorithm mirror files in medical robots and using container technology to achieve execution environment isolation, the problems of low image algorithm deployment efficiency and execution environment conflicts are solved, and deployment efficiency and resource utilization are improved.

WO2025051231A1PCT designated stage expired Publication Date: 2025-03-13HANGLOK-TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/117402
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-09-07
Filing Date
2024-09-06
Publication Date
2025-03-13

AI Technical Summary

Technical Problem

The deployment efficiency of image algorithms in existing medical robots is low, and deep learning algorithms have high hardware requirements, resulting in problems such as conflicts in execution environments and inconsistent resource requirements.

Method used

By developing image algorithms using programming languages, building algorithm image files and configuring an independent execution environment, using container technology to achieve isolation of the algorithm execution environment, and using algorithm management modules and scheduling modules to perform interface management and task scheduling.

Benefits of technology

It improves the deployment efficiency of image algorithms, reduces the difficulty of scheduling, avoids the problems of execution environment conflicts and inconsistent resource requirements, and reduces hardware requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024117402_13032025_PF_FP_ABST
    Figure CN2024117402_13032025_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the present invention are a medical robot image algorithm deployment method and apparatus, a medical robot image algorithm scheduling method and apparatus, and a system. The deployment method comprises: using a programming language in advance to complete the development of an image algorithm, so as to obtain an image algorithm execution program; constructing the image algorithm execution program to form an algorithm mirror image file by means of a Dockerfile; setting algorithm information for the algorithm mirror image file in an associating manner, wherein the algorithm information at least comprises an algorithm name that is unique; sending, by means of a protocol interface, the algorithm mirror image file and the algorithm information associated thereto to an algorithm management module pre-built by a medical robot system; and the algorithm management module storing the algorithm mirror image file in an object storage server of a storage module and storing the algorithm information in a relational database of the storage module. In the present invention, an algorithm deployment interface is provided to solve the problem of code coupling between services and algorithms, and a container technique is used to resolve environmental conflicts between algorithms.
Need to check novelty before this filing date? Find Prior Art

Description

Medical robot image algorithm deployment method, scheduling method, device and system Technical Field

[0001] The present invention relates to the field of medical intelligent system integration, and in particular to a medical robot image algorithm deployment method, scheduling method, device and system. Background Art

[0002] When deploying an image algorithm into a medical robot, it is necessary to use the medical robot's development language to implement the image algorithm and directly introduce the algorithm code into the robot software. The robot software is also entirely responsible for scheduling the algorithm, and the algorithm code program and the robot software are strongly coupled together, which often leads to incompatibility issues.

[0003] Furthermore, as the number of image algorithms to be developed increases, deploying multiple functional algorithms may lead to inconsistent execution environments. Currently, deep learning algorithms are used as tools for developing image algorithms, but this approach suffers from at least two drawbacks: low deployment efficiency and an inability to effectively resolve conflicts in algorithm execution environments.

[0004] In addition, deep learning algorithms have high hardware requirements. Introducing algorithm code into robot software and executing it will increase the robot software's requirements for machine configuration.

[0005] The disclosure of the above background technology content is only used to assist in understanding the inventive concept and technical solution of the present invention. It does not necessarily belong to the prior art of this patent application, nor does it necessarily provide technical guidance. In the absence of clear evidence that the above content has been disclosed before the filing date of this patent application, the above background technology should not be used to evaluate the novelty and creativity of this application.

[0006] Summary of the Invention

[0007] The purpose of this invention is to provide an improved medical robot image algorithm deployment method and scheduling method, which realizes code decoupling at the algorithm and business levels, improves the algorithm deployment efficiency, and thus reduces the difficulty of algorithm scheduling.

[0008] In order to achieve the above object, the technical solution adopted by the present invention is as follows:

[0009] A method for deploying an image algorithm for a medical robot includes the following steps:

[0010] Complete the development of the image algorithm using a programming language in advance and obtain the image algorithm execution program;

[0011] The image algorithm execution program is constructed into an algorithm image file by means of Dockerfile, wherein an independent execution environment is configured for the algorithm image file by means of container technology;

[0012] Associating and setting algorithm information for the algorithm image file, the algorithm information at least including a unique algorithm name;

[0013] Sending the algorithm image file and its associated algorithm information to a pre-established algorithm management module of the medical robot system through a protocol interface;

[0014] The algorithm management module stores the algorithm image file in a storage module capable of performing data interaction with the algorithm management module, and stores the algorithm information in the storage module.

[0015] Furthermore, based on any one of the above-mentioned technical solutions or a combination of multiple technical solutions, the algorithm image file is constructed in the following manner:

[0016] Creating an algorithm data file, wherein the algorithm data file includes algorithm weight parameters;

[0017] Put the algorithm data file and the image algorithm execution program into the algorithm image building directory, and write a Dockerfile in the directory, the file content of which includes the basic environment required by the algorithm and / or the program or toolkit required by the algorithm execution environment;

[0018] Execute the algorithm image generation script so that the algorithm image generation script generates an environment image according to the Dockerfile, and copies the algorithm data file and the image algorithm execution program in the algorithm image construction directory into the environment image to obtain an algorithm image including the image algorithm execution program and the execution environment;

[0019] The algorithm image generation script saves the algorithm image as an algorithm image file of a compressed package type.

[0020] Further, based on any one of the above technical solutions or a combination of multiple technical solutions, after the algorithm management module stores the algorithm image file in the storage module, the method further includes: adding a corresponding storage path to the algorithm information, and storing the algorithm information in the storage module;

[0021] And / or, the algorithm information also includes one or more of algorithm version information, a statement defining the format of algorithm input data and output data, and algorithm system resource requirement information.

[0022] Furthermore, based on any one of the technical solutions or a combination of multiple technical solutions described above, the algorithm image file and its associated algorithm information are configured to be sent to the algorithm management module of the medical robot system through an HTTP interface;

[0023] And / or, the algorithm management module stores the algorithm image file in the object storage server of the storage module, and the object storage server is MinIO cloud storage;

[0024] And / or, the algorithm management module stores the algorithm information in a relational database of the storage module, and the relational database is MySQL.

[0025] Furthermore, based on any one of the above technical solutions or a combination of multiple technical solutions, the same medical robot system is configured to allow the deployment of multiple imaging algorithms;

[0026] Different imaging algorithms are configured to allow development to be done using different programming languages.

[0027] According to another aspect of the present invention, a method for scheduling an image algorithm for a medical robot is provided, comprising the following steps:

[0028] Based on the above-mentioned image algorithm deployment method, the image algorithm is pre-deployed in the medical robot system, and the medical robot system is configured with an algorithm management module, a storage module, an algorithm scheduling module and an algorithm execution module, wherein the algorithm execution module is configured with multiple execution instances;

[0029] Sending an algorithm execution request to the algorithm scheduling module through a protocol interface, wherein the information of the algorithm execution request includes at least the algorithm name;

[0030] The algorithm management module searches the storage module for algorithm information matching the algorithm name according to the algorithm execution request, obtains a download link of the algorithm image file associated with the algorithm information, and returns the algorithm information and the download link of the algorithm image file to the algorithm scheduling module;

[0031] The algorithm scheduling module obtains a task instance according to the algorithm information and the download link package, and allocates it to the execution instance of the executable task in the algorithm execution module;

[0032] The execution instance downloads the corresponding algorithm image file from the storage module through the download link;

[0033] The execution instance implements the algorithm execution of the algorithm image file in an independent execution environment based on container technology to obtain an algorithm execution result;

[0034] The execution instance returns the algorithm execution result to the algorithm scheduling module.

[0035] Furthermore, based on any one of the above technical solutions or a combination of multiple technical solutions, the algorithm scheduling module determines the execution instance of the executable task by:

[0036] Obtain information about all execution instances of the algorithm execution module through the list, and determine the working status of each execution instance in turn:

[0037] If the working status of all execution instances is in the executing state, the task instance allocation of the algorithm scheduling module is blocked and waits for an idle execution instance to appear;

[0038] If there are idle execution instances, an execution instance whose system resources meet the resource requirements of the task instance is selected.

[0039] Further, based on any one of the above technical solutions or a combination of multiple technical solutions, the algorithm scheduling module is configured to maintain N ready queues, and the ready queues read and write task instances in a FIFO manner, wherein N is an integer greater than or equal to 2;

[0040] Add a queue number field for each task instance, which stores the sequence number of the ready queue that the task instance will enter;

[0041] After the first ready queue, each task instance in the other ready queues enters the first ready queue after a different waiting time, wherein the waiting time corresponding to the second ready queue to the Nth ready queue gradually becomes longer; the algorithm scheduling module obtains the task instance from the first ready queue;

[0042] The initial value of the queue number field of each task instance is 1;

[0043] When there is an idle execution instance and the system resources of the execution instance do not meet the resource requirements of the current task instance, if the sequence number of the queue number field of the current task instance is not N, the sequence number of the queue number field of the current task instance is incremented by 1, and the current task is sent to the ready queue of the next level; if the sequence number of the queue number field of the current task instance is N, the task instance allocation of the algorithm scheduling module is blocked, and waits for the emergence of an idle execution instance whose system resources meet the resource requirements.

[0044] Further, based on any one of the above technical solutions or a combination of multiple technical solutions, the algorithm scheduling module is configured to maintain an information list of all execution instances of the algorithm execution module, wherein the list item information of each execution instance includes its working status, system resources, and information of its currently executing task;

[0045] The algorithm scheduling module determines whether there is an execution instance of the executable task that can execute the task instance based on the information list;

[0046] When the execution instance in the algorithm execution module is started, a copy of the list item information of the execution instance is added to the list according to the registration information of the execution instance, and heartbeat information is reported during the execution of the task instance by the execution instance. If the last update completion time of the heartbeat information is greater than the preset time period, the copy of the list item information of the execution instance is deleted from the list.

[0047] Further, based on any one of the above technical solutions or a combination of multiple technical solutions, the algorithm information matching the algorithm name queried by the algorithm management module in the storage module also includes a declaration defining the algorithm input data and output data formats, algorithm system resource requirement information, and a storage path of the algorithm image file;

[0048] The algorithm management module obtains a download link to the algorithm image file according to the storage path of the algorithm image file;

[0049] The information of the algorithm execution request also includes algorithm execution parameters, the format of which is determined by the declaration defining the algorithm input data and output data formats;

[0050] The algorithm scheduling module encapsulates the algorithm information, algorithm execution parameters and a download link of the algorithm image file into a task instance.

[0051] Further, based on any one of the technical solutions or a combination of multiple technical solutions described above, after receiving the task instance, the algorithm execution module verifies the algorithm execution parameters according to the declaration defining the algorithm input data and output data format in the algorithm information encapsulated therein;

[0052] If the verification passes, the algorithm execution module allocates an exclusive storage path for the task instance, and mounts the storage path of the task instance as a data volume to the execution container of the algorithm image file, thereby realizing the algorithm execution of the algorithm image file in an independent execution environment.

[0053] Furthermore, based on any one of the above technical solutions or a combination of multiple technical solutions, in the process of implementing the algorithm execution of the algorithm image file in an independent execution environment based on the container technology, the execution instance further includes executing the following steps:

[0054] Monitoring the execution environment status of the medical robot system, including one or more of CPU usage, memory usage, and graphics card usage;

[0055] The execution environment status data obtained through monitoring is saved in a memory, and the execution environment status data obtained through monitoring is fed back in a visual form.

[0056] Furthermore, based on any one of the above technical solutions or a combination of multiple technical solutions, during the process of the execution instance implementing the algorithm execution of the algorithm image file in an independent execution environment based on the container technology, or after obtaining the algorithm execution result, the following steps are further performed:

[0057] Print content according to the preset development program;

[0058] A log is generated according to the printed content and stored.

[0059] According to another aspect of the present invention, a medical robot image algorithm deployment device is provided, comprising the following modules:

[0060] An image algorithm development module is configured to use a programming language to complete the development of an image algorithm and obtain an image algorithm execution program. Different image algorithms are configured to allow the use of different programming languages ​​for development.

[0061] An image building module is configured to build an image algorithm execution program into an algorithm image file by means of a Dockerfile, wherein an independent execution environment is configured for the algorithm image file by means of container technology;

[0062] an algorithm information module configured to associate and set algorithm information with the algorithm image file, wherein the algorithm information at least includes a unique algorithm name;

[0063] The medical robot system has a pre-established algorithm management module and a storage module, wherein the algorithm management module is configured to store the algorithm image file in the storage module and store the algorithm information in the storage module.

[0064] Furthermore, based on any one of the above technical solutions or a combination of multiple technical solutions, the image construction module constructs the algorithm image file in the following manner:

[0065] Creating an algorithm data file, wherein the algorithm data file includes algorithm weight parameters;

[0066] Put the algorithm data file and the image algorithm execution program into the algorithm image building directory, and write a Dockerfile in the directory, the file content of which includes the basic environment required by the algorithm and / or the program or toolkit required by the algorithm execution environment;

[0067] Execute the algorithm image generation script so that the algorithm image generation script generates an environment image according to the Dockerfile, and copies the algorithm data file and the image algorithm execution program in the algorithm image construction directory into the environment image to obtain an algorithm image including the image algorithm execution program and the execution environment;

[0068] The algorithm image generation script saves the algorithm image as an algorithm image file of a compressed package type.

[0069] Further, based on any one of the above technical solutions or a combination of multiple technical solutions, after the algorithm management module stores the algorithm image file in the storage module, the method further includes: adding a corresponding storage path to the algorithm information, and storing the algorithm information in the storage module;

[0070] And / or, the algorithm information also includes one or more of algorithm version information, a statement defining the format of algorithm input data and output data, and algorithm system resource requirement information.

[0071] According to another aspect of the present invention, a medical robot image algorithm scheduling device is provided, comprising the image algorithm deployment device as described above and an algorithm scheduling module and an algorithm execution module pre-established in a medical robot system, wherein the algorithm execution module is configured with multiple execution instances;

[0072] The image algorithm scheduling device also includes the following modules:

[0073] a request module configured to send an algorithm execution request to the algorithm scheduling module through a protocol interface, wherein information of the algorithm execution request includes at least an algorithm name;

[0074] The algorithm management module of the image algorithm deployment device is configured to query the storage module for algorithm information matching the algorithm name according to the algorithm execution request, thereby obtaining a download link of the algorithm image file associated with the algorithm information, and returning the algorithm information and the download link of the algorithm image file to the algorithm scheduling module;

[0075] The algorithm scheduling module obtains a task instance according to the algorithm information and the download link package, and allocates it to the execution instance of the executable task in the algorithm execution module;

[0076] The execution instance downloads the corresponding algorithm image file from the storage module through the download link;

[0077] The execution instance implements the algorithm execution of the algorithm image file in an independent execution environment based on container technology to obtain an algorithm execution result;

[0078] The execution instance returns the algorithm execution result to the algorithm scheduling module.

[0079] Furthermore, based on any one of the above technical solutions or a combination of multiple technical solutions, the algorithm scheduling module determines the execution instance of the executable task by:

[0080] Obtain information about all execution instances of the algorithm execution module through the list, and determine the working status of each execution instance in turn:

[0081] If the working status of all execution instances is in the executing state, the task instance allocation of the algorithm scheduling module is blocked and waits for an idle execution instance to appear;

[0082] If there are idle execution instances, an execution instance whose system resources meet the resource requirements of the task instance is selected.

[0083] Further, based on any one of the above technical solutions or a combination of multiple technical solutions, the algorithm scheduling module is configured to maintain N ready queues, and the ready queues read and write task instances in a FIFO manner, wherein N is an integer greater than or equal to 2;

[0084] Add a queue number field for each task instance, which stores the sequence number of the ready queue that the task instance will enter;

[0085] After the first ready queue, each task instance in the other ready queues enters the first ready queue after a different waiting time, wherein the waiting time corresponding to the second ready queue to the Nth ready queue gradually becomes longer; the algorithm scheduling module obtains the task instance from the first ready queue;

[0086] The initial value of the queue number field of each task instance is 1;

[0087] When there is an idle execution instance and the system resources of the execution instance do not meet the resource requirements of the current task instance, if the sequence number of the queue number field of the current task instance is not N, the sequence number of the queue number field of the current task instance is incremented by 1, and the current task is sent to the ready queue of the next level; if the sequence number of the queue number field of the current task instance is N, the task instance allocation of the algorithm scheduling module is blocked, and waits for the emergence of an idle execution instance whose system resources meet the resource requirements.

[0088] Further, based on any one of the above technical solutions or a combination of multiple technical solutions, the algorithm scheduling module is configured to maintain an information list of all execution instances of the algorithm execution module, wherein the list item information of each execution instance includes its working status, system resources, and information of its currently executing task;

[0089] The algorithm scheduling module determines whether there is an execution instance of the executable task that can execute the task instance based on the information list;

[0090] When the execution instance in the algorithm execution module is started, a copy of the list item information of the execution instance is added to the list according to the registration information of the execution instance, and heartbeat information is reported during the execution of the task instance by the execution instance. If the last update completion time of the heartbeat information is greater than the preset time period, the copy of the list item information of the execution instance is deleted from the list.

[0091] Further, based on any one of the technical solutions or a combination of multiple technical solutions described above, after receiving the task instance, the algorithm execution module verifies the algorithm execution parameters according to the declaration defining the algorithm input data and output data format in the algorithm information encapsulated therein;

[0092] If the verification passes, the algorithm execution module allocates an exclusive storage path for the task instance, and mounts the storage path of the task instance as a data volume to the execution container of the algorithm image file, thereby realizing the algorithm execution of the algorithm image file in an independent execution environment.

[0093] Further, based on any one of the above technical solutions or a combination of multiple technical solutions, the algorithm information matching the algorithm name queried by the algorithm management module in the storage module also includes a declaration defining the algorithm input data and output data formats, algorithm system resource requirement information, and a storage path of the algorithm image file;

[0094] The algorithm management module obtains a download link to the algorithm image file according to the storage path of the algorithm image file;

[0095] The information of the algorithm execution request also includes algorithm execution parameters, the format of which is determined by the declaration defining the algorithm input data and output data formats;

[0096] The algorithm scheduling module encapsulates the algorithm information, algorithm execution parameters and a download link of the algorithm image file into a task instance.

[0097] Furthermore, based on any one of the above technical solutions or a combination of multiple technical solutions, the image algorithm scheduling device further includes the following modules:

[0098] A monitoring module configured to monitor the execution environment status of the medical robot system, including one or more of CPU usage, memory usage, and graphics card usage;

[0099] An execution environment state memory, configured to store information about the execution environment state monitored by the monitoring module;

[0100] The visual feedback module is configured to provide feedback of the monitored execution environment status data in a visual form.

[0101] Furthermore, based on any one of the above technical solutions or a combination of multiple technical solutions, the image algorithm scheduling device further includes a printing module and a log module, wherein:

[0102] The printing module is configured to print content according to a preset development program and send the printed content to the log module;

[0103] The log module is configured to generate and store a log according to the print content of the print module.

[0104] According to another aspect of the present invention, a medical robot system is provided, comprising the medical robot image algorithm scheduling device as described above, wherein the modules in the system communicate with each other via an RPC interface.

[0105] According to another aspect of the present invention, a computer-readable storage medium is provided for storing program instructions, wherein the program instructions are configured to be executed to perform the steps of the above method.

[0106] According to another aspect of the present invention, an electronic device is provided, comprising a processor and a memory, wherein the memory is used to store program instructions, and the processor is configured to run the program instructions, and the program instructions are run to perform the steps of the above method.

[0107] The beneficial effects brought about by the technical solution provided by the present invention are as follows:

[0108] a. Provide an algorithm deployment interface to decouple code at the algorithm and business levels, improving algorithm deployment efficiency;

[0109] b. Using container technology, an independent execution environment is configured for the algorithm image file. The isolated nature of the container execution environment prevents conflicts due to inconsistent execution environments even when developing a large number of image function algorithms.

[0110] c. Compared with deep learning algorithms, robot hardware requirements are lower. BRIEF DESCRIPTION OF THE DRAWINGS

[0111] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments recorded in this application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0112] FIG1 is a flow chart of an image algorithm deployment method provided by an exemplary embodiment of the present invention;

[0113] FIG2 is a schematic diagram of interaction between a development device and a deployment device for completing image algorithm deployment according to an exemplary embodiment of the present invention;

[0114] FIG3 is a flow chart of a method for constructing an algorithm image file provided by an exemplary embodiment of the present invention;

[0115] FIG4 is a flow chart of an image algorithm scheduling method provided by an exemplary embodiment of the present invention;

[0116] FIG5 is a flowchart of maintaining three ready queues provided by an exemplary embodiment of the present invention;

[0117] FIG6 is a schematic diagram of a first execution scenario of an algorithm according to an exemplary embodiment of the present invention;

[0118] FIG7 is a schematic diagram of a second execution scenario of an algorithm according to an exemplary embodiment of the present invention;

[0119] FIG8 is a schematic diagram of a third execution scenario of an algorithm according to an exemplary embodiment of the present invention;

[0120] FIG9 is a schematic diagram of a fourth execution scenario of an algorithm according to an exemplary embodiment of the present invention;

[0121] FIG10 is a schematic diagram of the architecture of an image algorithm scheduling device provided with an image algorithm deployment device according to an exemplary embodiment of the present invention;

[0122] FIG11 is a hardware structure diagram of an electronic device provided by an exemplary embodiment of the present invention. DETAILED DESCRIPTION

[0123] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.

[0124] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention 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 numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention 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, apparatus, product or device 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.

[0125] In one embodiment of the present invention, a method for deploying an image algorithm for a medical robot is provided. Referring to FIG. 1 , FIG. 2 , and FIG. 10 , the method includes the following steps:

[0126] The first step is to use a programming language to complete the development of the image algorithm in advance by the algorithm development device to obtain the image algorithm execution program;

[0127] The second step is to build the image algorithm execution program into an algorithm image file through Dockerfile, wherein an independent execution environment is configured for the algorithm image file through container technology;

[0128] Container technology (also known as container virtualization technology) is a virtualization technology that improves resource utilization. Specifically, it divides the resources of a single operating system into independent groups to better balance conflicting resource usage requirements between independent groups. Container technologies include Docker, CoreOS, and other container technologies. The following uses Docker as an example to illustrate:

[0129] The method of constructing the algorithm image file is shown in Figure 3:

[0130] Creating an algorithm data file, wherein the algorithm data file includes algorithm weight parameters;

[0131] Put the algorithm data file and the image algorithm execution program into the algorithm image build directory, and write a Dockerfile in this directory. The file content includes the basic environment required by the algorithm (i.e., the system environment required for algorithm execution, such as Ubuntu, CUDA, PyTorch) and / or the programs or toolkits required by the algorithm execution environment (i.e., the software that the algorithm execution depends on);

[0132] Execute the algorithm image generation script so that the algorithm image generation script generates an environment image according to the Dockerfile, and copies the algorithm data file and the image algorithm execution program in the algorithm image construction directory into the environment image to obtain an algorithm image including the image algorithm execution program and the execution environment;

[0133] The algorithm image generation script saves the algorithm image as an algorithm image file of a compressed package type (such as a .tar.gz suffix).

[0134] The third step is to associate the algorithm image file with the algorithm information, where the algorithm information includes at least a unique algorithm name. In one embodiment, the algorithm information may also include the algorithm version, a declaration defining the algorithm input and output data formats, and algorithm system resource requirements (such as CPU, memory, and GPU).

[0135] Step 4: The algorithm development device sends the algorithm image file and its associated algorithm information to the deployment device of the medical robot system through a protocol interface (such as HTTP, Hypertext Transfer Protocol). Specifically, the deployment device includes an algorithm management module and a storage module.

[0136] In step 5, the algorithm management module stores the algorithm image file and algorithm information in the storage module. This embodiment uses partitioned storage, specifically storing the algorithm image file in an image storage (an object storage server, such as MinIO) and the algorithm information in an algorithm information storage (a relational database, such as MySQL). When the algorithm is executed, the algorithm information and image file are retrieved from the storage module to execute the algorithm. For details, see the image algorithm scheduling embodiment below.

[0137] After the algorithm management module saves the algorithm image file in the object storage server, it also adds the corresponding storage path information to the algorithm information and saves the algorithm information in a relational database, which provides a basis for downloading the algorithm image file for subsequent algorithm scheduling.

[0138] This embodiment makes it easier for algorithm developers to deploy algorithms. Algorithm developers only need to focus on developing algorithm functions. After submitting the algorithm information and algorithm image file, the algorithm deployment is completed. The same medical robot system is configured to allow the deployment of multiple imaging algorithms, and different imaging algorithms are configured to allow development using different programming languages. This solves the problem of code coupling between business and algorithms. Algorithm developers do not need to use the programming language used by the business to implement the algorithm. Different developers can focus on the development of their own imaging algorithms, improving development efficiency.

[0139] At the same time, an algorithm deployment interface is provided to reduce manual operations in the deployment process and improve deployment efficiency.

[0140] After completing the above image algorithm deployment, an embodiment of the present invention provides a medical robot image algorithm scheduling method, which requires the participation of an algorithm scheduling module and an algorithm execution module pre-established in the medical robot system, wherein the algorithm execution module is configured with multiple execution instances; the process of each execution instance maintains its own state, and the algorithm execution module is responsible for algorithm input and output processing, as well as the management of the execution container of the algorithm image through the encapsulated docker controller, and solves the problem of algorithm execution environment conflict through the isolation feature of the container execution environment.

[0141] As shown in FIG4 , the image algorithm scheduling method includes the following steps:

[0142] Step A: Send an algorithm execution request to the algorithm scheduling module through a protocol (HTTP, Hypertext Transfer Protocol) interface. The information of the algorithm execution request includes the algorithm name and algorithm execution parameters. The format of the algorithm execution parameters is determined by the aforementioned declaration defining the algorithm input data and output data format;

[0143] Step B: the algorithm management module searches the storage module for algorithm information that matches the algorithm name according to the algorithm execution request, where the algorithm information also includes a declaration defining the algorithm input data and output data formats, algorithm system resource requirement information, and a storage path for the algorithm image file;

[0144] Step C, the algorithm management module obtains a download link to the algorithm image file according to the storage path of the algorithm image file;

[0145] Step D: The algorithm management module returns the download link and algorithm information to the algorithm scheduling module;

[0146] Step E: The algorithm scheduling module obtains a task instance based on the algorithm information, algorithm execution parameters, and download link package, and assigns it to an execution instance of the executable task in the algorithm execution module; the specific method for determining the execution instance of the executable task is as follows:

[0147] The algorithm scheduling module is configured to maintain an information list of all execution instances of the algorithm execution module, wherein the list item information of each execution instance includes its working status, system resources, and information of the currently executing task;

[0148] When the execution instance in the algorithm execution module is started, a copy of the list item information of the execution instance is added to the list according to the registration information of the execution instance, and heartbeat information is reported during the execution of the task instance by the execution instance. If the last update completion time of the heartbeat information is greater than the preset time period, the copy of the list item information of the execution instance is deleted from the list.

[0149] Since the list contains the working status and system resources of the execution instance, if the working status is in the executing state, the algorithm scheduling module determines that the execution instance is an execution instance of an unexecutable task;

[0150] If the working state is an idle state and the system resources can meet the resource requirements of the task instance, the algorithm scheduling module determines that the execution instance is an execution instance of the executable task.

[0151] An embodiment of the present invention provides an efficient scheduling rule for executing task instances. Referring to FIG5 , the algorithm scheduling module maintains N ready queues, which read and write task instances in a FIFO manner, where N is an integer greater than or equal to 2. A queue number field is added to each task instance, and the queue number field stores the sequence number of the ready queue that the task instance will enter. Taking N=3 as an example, when a task instance is encapsulated, the initial sequence number value of its queue number field is 1, that is, it enters the first ready queue. The first ready queue reads the task instance to the algorithm scheduling module according to the FIFO rule. According to the above content, after the algorithm scheduling module queries the list, there are the following four execution situations:

[0152] Case 1, referring to FIG6 , if it is determined that there is an execution instance (execution instance 2 in FIG6 ) that can execute the task, the execution instance 2 is assigned to execute the current task (for specific steps, see steps F, G, and H below);

[0153] Case 2, referring to FIG7 , after traversing the list, it is determined that all execution instances (execution instance 1 to execution instance m in FIG7 ) are in the executing working state, then the task instance allocation of the algorithm scheduling module is blocked and waits for an idle execution instance to appear and the system resources meet the resource requirements;

[0154] Case 3, see Figure 8. Different from the state in which all execution instances are in execution in Case 2, in Case 3, at least one execution instance (execution instance 2 in Figure 8) is in an idle state, but due to insufficient system resources, the current task cannot be executed. The queue number of the current task instance is incremented by 1, and it is sent to the next level ready queue (i.e., the second ready queue); see Figure 5. After the task instance enters the second ready queue, it enters the first ready queue again after the duration S2, but its queue number remains 2 at this time; if it is the turn of this task instance to be read out to the algorithm scheduling module next time, and Case 3 is met again, its queue number is incremented by 1 to 3, and it is sent to the third ready queue;

[0155] Case 4, see Figure 9 and Figure 5. The task instance sent to the third ready queue in case 3 enters the first ready queue again after S3, but its queue number remains 3 at this time; if it is the turn of this task instance to be read out to the algorithm scheduling module next time, at least one execution instance (execution instance 2 in Figure 9) is idle, but the current task cannot be executed due to insufficient system resources. At this time, the queue number of the task instance is 3, then the task instance allocation of the algorithm scheduling module is blocked, and waits for an idle execution instance whose system resources meet the resource requirements to execute this task instance with queue number 3.

[0156] The scheduling method in case three allows tasks with low resource requirements to be executed first, while the scheduling method in case four prevents tasks with high resource requirements from being starved for a long time, fully utilizing system resources and improving scheduling efficiency. Obviously, the present invention does not limit the number of ready queues to three; the number of ready queues can be increased, thereby extending the time that tasks with high resource requirements can tolerate starvation and making tasks with low resource requirements more prioritized.

[0157] Step F, the execution instance downloads the corresponding algorithm image file from the storage module through the download link;

[0158] Specifically, after receiving the task instance, the algorithm execution module verifies the algorithm execution parameters according to the declaration defining the algorithm input data and output data format in the algorithm information encapsulated therein;

[0159] If the verification passes, the algorithm execution module allocates a dedicated storage path for the task instance and mounts the storage path of the task instance as a data volume into the execution container of the algorithm image file.

[0160] In step G, the execution instance executes the algorithm image file in an independent execution environment based on container technology to obtain an algorithm execution result. The task instance's storage path is mounted as a data volume into the execution container of the algorithm image file, and the algorithm image file is then executed in the independent execution environment to obtain an algorithm execution result. Container technology provides an independent execution environment for each algorithm, resolving the issue of environment conflicts between algorithms.

[0161] Step H: The execution instance returns the algorithm execution result to the algorithm scheduling module.

[0162] In one embodiment of the present invention, during the execution of step G, the execution environment status of the medical robot system is also monitored, such as CPU usage, memory usage, graphics card usage, etc., and the monitored execution environment status data is saved to a memory, such as a dedicated InfluxDB database-type execution environment status memory; and the monitored execution environment status data is fed back in a visual form, such as local display on a display screen or remote display via communication technology. This allows developers to evaluate the health of the execution environment during algorithm execution and, in the event of a poor execution environment, such as detecting excessive usage of a particular item, further adjust the system's resource allocation, specifically by allocating resources toward the object detected to have excessive usage.

[0163] In one embodiment, a logging function is also provided: the algorithm development module of the medical robot system includes a pre-set printing module, whose specific printed content is set by the program during the development phase. The printed content of the printing module can be obtained during the algorithm execution process or after the algorithm execution is completed and the results are obtained. A log is then generated and saved based on the printed content. This allows developers to access the log to view the printed content, especially when a system failure occurs, so they can try to locate the fault by viewing the log.

[0164] This embodiment provides an algorithm scheduling interface for executing the above-mentioned algorithm scheduling method, which includes both an algorithm execution interface and a stop execution interface. When executing an algorithm, the task will be sent to the appropriate process in the algorithm execution module for processing according to the current system status; when stopping the algorithm, the execution process of the task will be found, a stop instruction will be sent, and the algorithm execution will be stopped. Executing an algorithm task will add an algorithm task and assign an execution instance to it to execute the algorithm task; stopping an algorithm task will find the algorithm execution instance that executes the task through the task ID and send a stop command task; updating an algorithm task is for the purpose of calling back the interface to implement the task update after the algorithm execution module task is completed; obtaining an algorithm task and providing it to the task initiator to obtain the execution status of the task; registering an execution instance and providing it to the algorithm execution module. When the execution strength in the algorithm execution module is started, the algorithm execution instance is registered to the algorithm execution instance list in the algorithm scheduling module through the interface; sending an execution instance heartbeat to the algorithm execution instance to periodically notify the algorithm scheduling module to update the status of the algorithm execution instance. The algorithm scheduling module saves a list of algorithm execution instances, which records the execution status, IP, port, start time, and last update time of the algorithm execution instance. The algorithm execution module will periodically clear instances that have not been updated within a certain time range based on the last update time. Through this list, the algorithm task scheduling is realized.

[0165] A data volume is a special directory that can be read by containers. The file system of the algorithm execution container is independent of the deployment machine file system. The storage of the container and the deployment machine is shared by mounting data volumes. The algorithm parameters are passed to the algorithm through data volumes, and the algorithm output and generated data files are saved. The algorithm execution module uses the encapsulated Docker controller to create, monitor the status of the algorithm container, and destroy the container. The algorithm execution container is recreated before each execution, and the container status is monitored asynchronously. When the container status changes to ended, the algorithm execution module is responsible for destroying and saving the algorithm task results. Through container technology, the independence of the algorithm execution environment and the uniformity of the execution environment are ensured.

[0166] In one embodiment of the present invention, a medical robot image algorithm deployment device is provided, comprising the following modules:

[0167] An image algorithm development module is configured to use a programming language to complete the development of an image algorithm and obtain an image algorithm execution program. Different image algorithms are configured to allow the use of different programming languages ​​for development.

[0168] An image building module is configured to build an image algorithm execution program into an algorithm image file by means of a Dockerfile, wherein an independent execution environment is configured for the algorithm image file by means of container technology;

[0169] an algorithm information module configured to associate and set algorithm information with the algorithm image file, wherein the algorithm information at least includes a unique algorithm name;

[0170] The medical robot system has a pre-established algorithm management module and storage module. The algorithm management module is configured to store the algorithm image file in the object storage server of the storage module and to store the algorithm information in the relational database of the storage module.

[0171] The image building module builds the algorithm image file in the following way:

[0172] Creating an algorithm data file, wherein the algorithm data file includes algorithm weight parameters;

[0173] Put the algorithm data file and the image algorithm execution program into the algorithm image building directory, and write a Dockerfile in the directory, the file content of which includes the basic environment required by the algorithm and / or the program or toolkit required by the algorithm execution environment;

[0174] Execute the algorithm image generation script so that the algorithm image generation script generates an environment image according to the Dockerfile, and copies the algorithm data file and the image algorithm execution program in the algorithm image construction directory into the environment image to obtain an algorithm image including the image algorithm execution program and the execution environment;

[0175] The algorithm image generation script saves the algorithm image as an algorithm image file of a compressed package type.

[0176] After the algorithm management module stores the algorithm image file in the object storage server, the method further includes: adding the corresponding storage path to the algorithm information, and storing the algorithm information in a relational database;

[0177] And / or, the algorithm information also includes one or more of algorithm version information, a statement defining the format of algorithm input data and output data, and algorithm system resource requirement information.

[0178] The present embodiment of the image algorithm deployment device and the above-mentioned embodiment of the image algorithm deployment method have the same concept, and the entire contents of the embodiment of the image algorithm deployment method are incorporated into the present embodiment of the image algorithm deployment device by reference.

[0179] In one embodiment of the present invention, a medical robot image algorithm scheduling device is provided. As shown in FIG10 , the scheduling device includes the image algorithm deployment device described above and an algorithm scheduling module and an algorithm execution module pre-established in the medical robot system. The algorithm execution module is configured with multiple execution instances.

[0180] The image algorithm scheduling device also includes the following modules:

[0181] a request module configured to send an algorithm execution request to the algorithm scheduling module through a protocol interface, wherein information of the algorithm execution request includes at least an algorithm name;

[0182] The algorithm management module of the image algorithm deployment device is configured to query the storage module for algorithm information matching the algorithm name according to the algorithm execution request, thereby obtaining a download link of the algorithm image file associated with the algorithm information, and returning the algorithm information and the download link of the algorithm image file to the algorithm scheduling module;

[0183] The algorithm scheduling module obtains a task instance according to the algorithm information and the download link package, and allocates it to the execution instance of the executable task in the algorithm execution module;

[0184] The execution instance downloads the corresponding algorithm image file from the storage module through the download link;

[0185] The execution instance implements the algorithm execution of the algorithm image file in an independent execution environment based on container technology to obtain an algorithm execution result;

[0186] The execution instance returns the algorithm execution result to the algorithm scheduling module.

[0187] The algorithm scheduling module determines the execution instance of the executable task in the following manner:

[0188] Obtain information about all execution instances of the algorithm execution module through the list, and determine the working status of each execution instance in turn:

[0189] If the working status of all execution instances is in the executing state, the task instance allocation of the algorithm scheduling module is blocked and waits for an idle execution instance to appear;

[0190] If there are idle execution instances, an execution instance whose system resources meet the resource requirements of the task instance is selected.

[0191] The algorithm scheduling module is configured to maintain N ready queues, and the ready queues read and write task instances in a FIFO manner;

[0192] Add a queue number field for each task instance, which stores the sequence number of the ready queue that the task instance will enter;

[0193] After the first ready queue, each task instance in the other ready queues enters the first ready queue after a different waiting time, wherein the waiting time corresponding to the second ready queue to the Nth ready queue gradually becomes longer; the algorithm scheduling module obtains the task instance from the first ready queue;

[0194] The initial value of the queue number field of each task instance is 1;

[0195] When there is an idle execution instance and the system resources of the execution instance do not meet the resource requirements of the current task instance, if the sequence number of the queue number field of the current task instance is not N, the sequence number of the queue number field of the current task instance is incremented by 1, and the current task is sent to the ready queue of the next level; if the sequence number of the queue number field of the current task instance is N, the task instance allocation of the algorithm scheduling module is blocked, and waits for the emergence of an idle execution instance whose system resources meet the resource requirements.

[0196] The algorithm scheduling module is configured to maintain an information list of all execution instances of the algorithm execution module, wherein the list item information of each execution instance includes its working status, system resources, and information of its currently executing task;

[0197] The algorithm scheduling module determines whether there is an execution instance of the executable task that can execute the task instance based on the information list;

[0198] When the execution instance in the algorithm execution module is started, a copy of the list item information of the execution instance is added to the list according to the registration information of the execution instance, and heartbeat information is reported during the execution of the task instance by the execution instance. If the last update completion time of the heartbeat information is greater than the preset time period, the copy of the list item information of the execution instance is deleted from the list.

[0199] After receiving the task instance, the algorithm execution module verifies the algorithm execution parameters according to the declaration defining the algorithm input data and output data formats in the algorithm information encapsulated therein;

[0200] If the verification passes, the algorithm execution module allocates an exclusive storage path for the task instance, and mounts the storage path of the task instance as a data volume to the execution container of the algorithm image file, thereby realizing the algorithm execution of the algorithm image file in an independent execution environment.

[0201] The algorithm information matching the algorithm name found by the algorithm management module in the storage module further includes a statement defining the format of algorithm input data and output data, information on algorithm system resources requirements, and a storage path for the algorithm image file;

[0202] The algorithm management module obtains a download link to the algorithm image file according to the storage path of the algorithm image file;

[0203] The information of the algorithm execution request also includes algorithm execution parameters, the format of which is determined by the declaration defining the algorithm input data and output data formats;

[0204] The algorithm scheduling module encapsulates the algorithm information, algorithm execution parameters and a download link of the algorithm image file into a task instance.

[0205] As shown in FIG10 , in one embodiment, the image algorithm scheduling device further includes the following modules:

[0206] A monitoring module configured to monitor the execution environment status of the medical robot system, including one or more of CPU usage, memory usage, and graphics card usage;

[0207] An execution environment state memory configured to store information about the execution environment state monitored by the monitoring module, such as an InfluxDB database type memory;

[0208] The visual feedback module is configured to provide feedback of the monitored execution environment status data in a visual form.

[0209] In one embodiment, the image algorithm scheduling device further includes a printing module and a log module, wherein:

[0210] The printing module is configured to print content according to a preset development program and send the printed content to the log module;

[0211] The log module is configured to generate and store a log according to the print content of the print module.

[0212] The present embodiment of the image algorithm scheduling device and the above-mentioned embodiment of the image algorithm scheduling method have the same concept, and the entire contents of the embodiment of the image algorithm scheduling method are incorporated into the present embodiment of the image algorithm scheduling device by reference.

[0213] An embodiment of the present invention further provides a medical robot system, including the medical robot image algorithm scheduling device as described above, wherein the modules in the system (such as the algorithm management module and the algorithm scheduling module, and the algorithm scheduling module and the algorithm execution module) communicate through an RPC interface. RPC transmits data through a binary protocol, which is more efficient than the text protocol of HTTP. It can also use encoding and decoding technology to improve data transmission efficiency. RPC can also use connection pool technology to avoid the overhead of HTTP establishing and disconnecting connections, improve concurrent processing capabilities and response speed, and have higher performance and efficiency. In addition, RPC can also customize protocols and transmission methods to meet the needs of different scenarios, with better customization and scalability.

[0214] One embodiment of the present invention further provides a computer-readable storage medium for storing program instructions, wherein the program instructions are configured to run and execute the steps of the method described above. The above-mentioned computer-readable storage medium can be an internal storage unit on the corresponding device of the apparatus provided by any of the aforementioned embodiments, such as a hard disk or memory of a computer device. The computer-readable storage medium can also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the computer device. Furthermore, the computer-readable storage medium can also include both an internal storage unit of the computer device and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium can also be used to temporarily store data that has been output or is to be output.

[0215] An embodiment of the present invention further provides an electronic device, including a processor and a memory, as shown in FIG11 , wherein the memory is used to store program instructions, and the processor is configured to execute the program instructions, and the program instructions are executed to perform the steps of the method described above. It will be understood by those skilled in the art that the composition structure of the electronic device shown in FIG11 does not constitute a limitation of the electronic device, and may include more or fewer components than shown, or combine certain components, or arrange the components differently. Among them:

[0216] The processor is the control center of the electronic device, connecting the various parts of the entire electronic device using various interfaces and circuits. It performs various functions of the electronic device and processes data by running or executing software programs and / or modules stored in the memory and accessing data stored in the memory. Optionally, the processor may include one or more processing cores; preferably, the processor may integrate an application processor and a modem processor, wherein the application processor primarily handles the operating system, user interface, and application programs, while the modem processor primarily handles wireless communications. It is understood that the modem processor does not need to be integrated into the processor.

[0217] 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 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device. Accordingly, the memory may also include a memory controller to provide the processor with access to the memory.

[0218] Electronic devices also include a power supply for supplying power to various components. Preferably, the power supply can be logically connected to the processor via a power management system, thereby enabling the power management system to manage charging, discharging, and power consumption. The power supply can also include one or more DC or AC power supplies, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and other arbitrary components.

[0219] The electronic device may further include an input unit, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0220] Although not shown, the electronic device may further include a display unit, etc., which will not be described in detail herein. Specifically, in this embodiment, the processor in the electronic device loads the executable files corresponding to the processes of one or more application programs into the memory according to the following instructions, and the processor runs the application programs stored in the memory.

[0221] In summary, the technical solution of this patent has the following advantages:

[0222] First, independence and uniformity: Container technology is used to achieve independence of the algorithm execution environment and uniformity of each execution environment, avoiding inconsistent algorithm execution results caused by factors such as environment variables and library versions.

[0223] Second, scalability and concurrency: By maintaining a list of algorithm execution instances, algorithm tasks can be scheduled and executed concurrently. Furthermore, by increasing the number of algorithm execution instances, the number of concurrent algorithm tasks can be horizontally expanded, provided that the performance of the deployed devices is sufficient, thereby improving the utilization efficiency of machine performance.

[0224] Third, flexibility and controllability: The RPC interface is used to implement the scheduling and allocation of algorithm tasks, and an HTTP interface is provided to implement operations such as algorithm task execution, stop, and acquisition, making it easier for users to manage and control algorithm tasks.

[0225] Fourth, security and stability: Container technology is used to isolate and sandbox the algorithm environment, avoiding the impact of the algorithm on deployed devices and improving security and stability.

[0226] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.

[0227] The above is only a specific implementation method of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A medical robot image algorithm deployment method, characterized in that: The following steps are involved: Complete the development of the image algorithm using a programming language in advance to obtain the image algorithm execution program; The image algorithm execution program is constructed into an algorithm image file by means of Dockerfile, wherein an independent execution environment is configured for the algorithm image file by means of container technology; Associating and setting algorithm information for the algorithm image file, the algorithm information at least including a unique algorithm name; Sending the algorithm image file and its associated algorithm information to a pre-established algorithm management module of the medical robot system through a protocol interface; The algorithm management module stores the algorithm image file in a storage module capable of data interaction with the algorithm management module, and stores the algorithm information in the storage module.

2. The medical robot image algorithm deployment method according to claim 1, characterized in that: Construct the algorithm image file in the following way: Creating an algorithm data file, wherein the algorithm data file includes algorithm weight parameters; Put the algorithm data file and the image algorithm execution program into the algorithm image building directory, and write a Dockerfile in the directory, the file content of which includes the basic environment required by the algorithm and / or the program or toolkit required by the algorithm execution environment; Execute the algorithm image generation script, so that the algorithm image generation script generates an environment image according to the Dockerfile, and copies the algorithm data file and the image algorithm execution program under the algorithm image construction directory to the environment image, to obtain an algorithm image including the image algorithm execution program and the execution environment; The algorithm image generation script saves the algorithm image as an algorithm image file of a compressed package type.

3. The medical robot image algorithm deployment method according to claim 1, characterized in that: After the algorithm management module stores the algorithm image file in the storage module, the method further includes: adding the corresponding storage path to the algorithm information, and storing the algorithm information in the storage module; And / or, the algorithm information also includes one or more of algorithm version information, a declaration defining the format of algorithm input data and output data, and algorithm system resource requirement information.

4. The medical robot image algorithm deployment method according to claim 1, characterized in that: The algorithm image file and its associated algorithm information are configured to be sent to the algorithm management module of the medical robot system via an HTTP interface; And / or, the algorithm management module stores the algorithm image file in an object storage server of the storage module, and the object storage server is a MinIO cloud storage; And / or, the algorithm management module stores the algorithm information in a relational database of the storage module, and the relational database is MySQL.

5. The medical robot image algorithm deployment method according to any one of claims 1 to 4, characterized in that: The same medical robotic system is configured to allow for the deployment of multiple imaging algorithms; Different image algorithms are configured to allow development to be done using different programming languages.

6. A medical robot image algorithm scheduling method, characterized in that: The following steps are involved: Based on the image algorithm deployment method according to any one of claims 1 to 5, the image algorithm is pre-deployed in the medical robot system, the medical robot system is configured with an algorithm management module, a storage module, an algorithm scheduling module and an algorithm execution module, wherein the algorithm execution module is configured with multiple execution instances; Sending an algorithm execution request to the algorithm scheduling module through a protocol interface, wherein information of the algorithm execution request includes at least an algorithm name; The algorithm management module searches the storage module for algorithm information matching the algorithm name according to the algorithm execution request, thereby obtaining a download link of an algorithm image file associated with the algorithm information, and returns the algorithm information and the download link of the algorithm image file to the algorithm scheduling module; The algorithm scheduling module obtains a task instance according to the algorithm information and the download link package, and distributes it to the execution instance of the executable task in the algorithm execution module; The execution instance downloads the corresponding algorithm image file from the storage module through the download link; The execution instance implements the algorithm execution of the algorithm image file in an independent execution environment based on container technology to obtain an algorithm execution result; The execution instance returns the algorithm execution result to the algorithm scheduling module.

7. The image algorithm scheduling method according to claim 6, characterized in that: The algorithm scheduling module is configured to maintain an information list of all execution instances of the algorithm execution module, wherein the list item information of each execution instance includes its working status, system resources, and its currently executing task information; the algorithm scheduling module determines whether there is an execution instance that can execute the task instance based on the information list; when the execution instance in the algorithm execution module is started, a copy of the list item information of the execution instance is added to the list according to the registration information of the execution instance, and heartbeat information is reported during the execution of the task instance by the execution instance; if the last update completion time of the heartbeat information is greater than a preset time period, the copy of the list item information of the execution instance is deleted from the list; The algorithm scheduling module determines the execution instance of the executable task in the following manner: obtains information of all execution instances of the algorithm execution module through a list, and judges the working status of each execution instance in turn: if the working status of all execution instances is in the executing state, the task instance allocation of the algorithm scheduling module is blocked, and waits for an idle execution instance to appear; if there is an idle execution instance, selects an execution instance whose system resources meet the resource requirements of the task instance; The algorithm scheduling module is configured to maintain N ready queues, which read and write task instances in a FIFO manner, wherein N is an integer greater than or equal to 2; a queue number field is added to each task instance, and the queue number field stores the sequence number of the ready queue that the task instance will enter; except for the first ready queue, the task instances in each of the other ready queues enter the first ready queue after their respective corresponding waiting times; the algorithm scheduling module obtains the task instance from the first ready queue; the initial value of the sequence number of the queue number field of each task instance is 1; when there is an idle execution instance and the system resources of the execution instance do not meet the resource requirements of the current task instance, if the sequence number of the queue number field of the current task instance is not N, the sequence number of the queue number field of the current task instance is incremented by 1, and the current task is sent to the ready queue of the next level; if the sequence number of the queue number field of the current task instance is N, the task instance allocation of the algorithm scheduling module is blocked, and waits for the appearance of an idle execution instance whose system resources meet the resource requirements.

8. The image algorithm scheduling method according to claim 6, characterized in that: The algorithm information matching the algorithm name queried by the algorithm management module in the storage module also includes a statement defining the format of algorithm input data and output data, demand information of algorithm system resources, and a storage path of the algorithm image file; The algorithm management module obtains a download link to the algorithm image file according to the storage path of the algorithm image file; The information of the algorithm execution request also includes algorithm execution parameters, whose format is determined by the declaration defining the algorithm input data and output data formats; The algorithm scheduling module encapsulates the algorithm information, algorithm execution parameters and a download link of the algorithm image file into a task instance.

9. The image algorithm scheduling method according to any one of claims 6 to 8, characterized in that: After receiving the task instance, the algorithm execution module verifies the algorithm execution parameters according to the declaration defining the algorithm input data and output data format in the algorithm information encapsulated therein; If the verification passes, the algorithm execution module allocates an exclusive storage path for the task instance, and mounts the storage path of the task instance as a data volume to the execution container of the algorithm image file, thereby implementing the algorithm execution of the algorithm image file in an independent execution environment.

10. The image algorithm scheduling method according to claim 6, characterized in that: In the process of implementing the algorithm execution of the algorithm image file in an independent execution environment based on the container technology, the execution instance further includes executing the following steps: Monitoring the execution environment status of the medical robot system, including one or more of CPU usage, memory usage, and graphics card usage; The monitored execution environment status data is saved in the memory, and the monitored execution environment status data is fed back in a visual form.

11. The image algorithm scheduling method according to claim 6, characterized in that: In the process of implementing the algorithm execution of the algorithm image file in an independent execution environment based on the container technology, or after obtaining the algorithm execution result, the following steps are also performed: Print content according to the preset development program; A log is generated according to the printed content and stored.

12. A medical robot image algorithm deployment device, characterized in that: Includes the following modules: An image algorithm development module is configured to use a programming language to complete the development of an image algorithm and obtain an image algorithm execution program. Different image algorithms are configured to allow the development to be completed using different programming languages; An image building module is configured to build an image algorithm execution program into an algorithm image file by means of Dockerfile, wherein an independent execution environment is configured for the algorithm image file by means of container technology; An algorithm information module, configured to associate and set algorithm information with the algorithm image file, wherein the algorithm information at least includes a unique algorithm name; The medical robot system has a pre-established algorithm management module and a storage module, wherein the algorithm management module is configured to store the algorithm image file in the storage module and to store the algorithm information in the storage module.

13. The image algorithm deployment device according to claim 12, characterized in that: The algorithm information also includes one or more of algorithm version information, a statement defining the format of algorithm input data and output data, and algorithm system resource requirement information. After the algorithm management module saves the algorithm image file in the storage module, the method further includes: adding a corresponding storage path to the algorithm information, and saving the algorithm information in the storage module; The image building module builds the algorithm image file in the following way: Creating an algorithm data file, wherein the algorithm data file includes algorithm weight parameters; Put the algorithm data file and the image algorithm execution program into the algorithm image building directory, and write a Dockerfile in the directory, the file content of which includes the basic environment required by the algorithm and / or the program or toolkit required by the algorithm execution environment; Execute the algorithm image generation script, so that the algorithm image generation script generates an environment image according to the Dockerfile, and copies the algorithm data file and the image algorithm execution program under the algorithm image construction directory to the environment image, to obtain an algorithm image including the image algorithm execution program and the execution environment; The algorithm image generation script saves the algorithm image as an algorithm image file of a compressed package type.

14. A medical robot image algorithm scheduling device, characterized in that: It comprises the image algorithm deployment device as claimed in claim 12 or 13 and an algorithm scheduling module and an algorithm execution module pre-established by the medical robot system, wherein the algorithm execution module is configured with multiple execution instances; The image algorithm scheduling device also includes the following modules: The request module is configured to send an algorithm execution request to the algorithm scheduling module through a protocol interface. The requested information includes at least the algorithm name; The algorithm management module of the image algorithm deployment device is configured to query the storage module for algorithm information matching the algorithm name according to the algorithm execution request, thereby obtaining a download link of an algorithm image file associated with the algorithm information, and return the algorithm information and the download link of the algorithm image file to the algorithm scheduling module; The algorithm scheduling module obtains a task instance according to the algorithm information and the download link package, and distributes it to the execution instance of the executable task in the algorithm execution module; The execution instance downloads the corresponding algorithm image file from the storage module through the download link; The execution instance implements the algorithm execution of the algorithm image file in an independent execution environment based on container technology to obtain an algorithm execution result; The execution instance returns the algorithm execution result to the algorithm scheduling module.

15. The image algorithm scheduling device according to claim 14, characterized in that: The algorithm scheduling module is configured to maintain an information list of all execution instances of the algorithm execution module, wherein the list item information of each execution instance includes its working status, system resources, and its currently executing task information; the algorithm scheduling module determines whether there is an execution instance that can execute the task instance based on the information list; when the execution instance in the algorithm execution module is started, a copy of the list item information of the execution instance is added to the list according to the registration information of the execution instance, and heartbeat information is reported during the execution of the task instance by the execution instance; if the last update completion time of the heartbeat information is greater than a preset time period, the copy of the list item information of the execution instance is deleted from the list; The algorithm scheduling module determines the execution instance of the executable task in the following manner: obtains information of all execution instances of the algorithm execution module through a list, and judges the working status of each execution instance in turn: if the working status of all execution instances is in the executing state, the task instance allocation of the algorithm scheduling module is blocked, and waits for an idle execution instance to appear; if there is an idle execution instance, selects an execution instance whose system resources meet the resource requirements of the task instance; The algorithm scheduling module is configured to maintain N ready queues, which read and write task instances in a FIFO manner, wherein N is an integer greater than or equal to 2; a queue number field is added to each task instance, and the queue number field stores the sequence number of the ready queue that the task instance will enter; except for the first ready queue, the task instances in each of the other ready queues enter the first ready queue after their respective waiting times, wherein the waiting times corresponding to the second ready queue to the Nth ready queue gradually become longer; the algorithm scheduling module starts from the first ready queue. The task instance is obtained from the thread queue; the initial value of the sequence number of the queue number field of each task instance is 1; when there is an idle execution instance and the system resources of the execution instance do not meet the resource requirements of the current task instance, if the sequence number of the queue number field of the current task instance is not N, the sequence number of the queue number field of the current task instance is incremented by 1, and the current task is sent to the ready queue of the next level; if the sequence number of the queue number field of the current task instance is N, the task instance allocation of the algorithm scheduling module is blocked, and waits for the appearance of an idle execution instance whose system resources meet the resource requirements.

16. The image algorithm scheduling device according to claim 14, characterized in that: After receiving the task instance, the algorithm execution module verifies the algorithm execution parameters according to the declaration defining the algorithm input data and output data format in the algorithm information encapsulated therein; If the verification passes, the algorithm execution module allocates an exclusive storage path for the task instance, and mounts the storage path of the task instance as a data volume to the execution container of the algorithm image file, thereby implementing the algorithm execution of the algorithm image file in an independent execution environment.

17. The image algorithm scheduling device according to any one of claims 14 to 16, characterized in that: The algorithm information matching the algorithm name queried by the algorithm management module in the storage module also includes a statement defining the format of algorithm input data and output data, demand information of algorithm system resources, and a storage path of the algorithm image file; The algorithm management module obtains a download link to the algorithm image file according to the storage path of the algorithm image file; The information of the algorithm execution request also includes algorithm execution parameters, whose format is determined by the declaration defining the algorithm input data and output data formats; The algorithm scheduling module encapsulates the algorithm information, algorithm execution parameters and a download link of the algorithm image file into a task instance.

18. The image algorithm scheduling device according to claim 14, characterized in that: Also includes the following modules: A monitoring module, which is configured to monitor the execution environment status of the medical robot system, including one or more of CPU usage, memory usage, and graphics card usage; An execution environment state memory, configured to store information of the execution environment state monitored by the monitoring module; The visual feedback module is configured to feedback the monitored execution environment status data in a visual form.

19. The image algorithm scheduling device according to claim 14, characterized in that: It also includes a printing module and a log module, where: The printing module is configured to print content according to a preset development program and send the printed content to the log module; The log module is configured to generate and store a log according to the print content of the print module.

20. A medical robot system, characterized in that: It comprises a medical robot image algorithm scheduling device as described in any one of claims 14 to 19, wherein the modules in the system communicate with each other via an RPC interface.

21. A computer-readable storage medium for storing program instructions, characterized in that: The program instructions are configured to be executed to perform the steps of the method according to any one of claims 1 to 11.

22. An electronic device comprising a processor and a memory, wherein: The memory is used to store program instructions, and the processor is configured to execute the program instructions, wherein the program instructions are executed to perform the steps of the method according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Container-based application system deployment method and related device

    CN112230946A

  • Container-based image recognition algorithm deployment method and system, and medium

    CN112506668A

  • Algorithm service processing method and device, electronic equipment and storage medium

    CN113849287A

  • Deployment operation method and device of AI algorithm and medium

    CN116048540A

  • Medical robot image algorithm deployment method, scheduling method, device and system

    CN117252750A