METHOD FOR RUNNING A COMPUTER PROGRAM IN A COMPUTER CENTER FOR CONTROLLING A MICROSCOPE
Patent Information
- Application Number
- DE502019014197
- Authority / Receiving Office
- DE · DE
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2018-03-01
- Filing Date
- 2019-02-28
- Publication Date
- 2025-12-24
- Estimated Expiration
- 2039-02-28
AI Technical Summary
Existing computer program execution methods in a network are inflexible, leading to rigid processes and inefficiencies, making development and execution cumbersome.
Implementing a method that allows multiple return values from preceding function calls as separate parameters, with temporary storage and conditional program flow control, and utilizing a database for execution environments and interface definitions to enable flexible function calls and static typing, reducing runtime errors.
Enhances flexibility and simplifies the development and execution of computer programs, reducing energy consumption and development time by allowing for more complex and adaptable workflows.
Description
[0001] The invention relates to the execution of computer programs in a computer network, in particular for controlling a microscope. Such a computer network can also be referred to as a computing cloud. Naturally, the invention relates not only to a computer network provided by a service provider ("public cloud"), but also to a computer network operated exclusively for the organization executing the computer program ("private cloud") or hybrid forms thereof.
[0002] For the purposes of the invention, a computer program is a sequence of calculation instructions, which may in particular be function calls.
[0003] In a computer network, physical or virtual computers can be connected to each other, for example via a network such as "Ethernet" (IEEE 802.3) and "WLAN" (IEEE 802.11) or bus systems such as "CAN" (ISO 11898) and "Firewire" (IEEE 1394). A virtual computer can, for example, be connected via a virtual network interface.
[0004] In a computer network, the individual functions of a computer program can be implemented as separately executable program files (hereinafter also referred to as executable modules) in different execution environments, for example, exactly one function (and thus one executable module) per execution environment. Calling the function then starts the corresponding executable module in its execution environment. An execution environment can be a virtual machine or a (virtual) container.
[0005] A virtual machine contains, in addition to the executable module, including any library files for dynamic linking to the executable, a core operating system. A virtual machine can also contain other files or data (such as a database) necessary for the module's execution and simulates the presence of a physical computer through software. This computer is virtual.
[0006] A container, on the other hand, does not contain an operating system kernel. Virtualization here occurs at the application environment level, i.e., the runtime environment of the executable module. Modules running in different containers on the same computer use the same operating system kernel—that of the computer. The remaining resources of the computer can be distributed among several containers or shared by them. However, the containers are isolated from each other and, fundamentally, from the rest of the computer. Access from within a container is limited to defined resources of the computer, such as specific files or directories. This environment, isolated from other containers and other system resources, is called a namespace. The libraries, files, and other data contained within a namespace can only be used by the module(s) contained within that same namespace.However, they are not reachable from containers outside the namespace.
[0007] Containers and namespaces are provided by operating systems such as Linux via the interfaces "LXC", "LXD", or "runc" and control groups (cgroups). Container management is provided, for example, by the software "Docker" (http: / / www.docker.com).
[0008] The state of the art, as presented in the "dray" project (http: / / dray.it), reveals an automated execution of a computer program within a network of computers using Docker-managed containers. Multiple functions, each contained in a separate container as an executable program file, are called sequentially, similar to an anonymous pipe. The return value of each called function is passed as an input parameter to the subsequent function. For this purpose, returned values are optionally read from a) the standard output channel (stdout), b) the standard error output channel (stderr), or c) a pre-specified file and automatically passed to the immediately following function via its standard input channel (stdin). The containers are automatically started and stopped as needed (e.g., when a contained function is called).See also: Anonymous: "GitHub - CenturyLinkLabs / dray: An engine for managing the execution of container-based workflows", February 16, 2016 (2016-02-16), found on the internet: URL: https: / / web.archive.org / web / 20160216145257 / https: / / github.com / CenturyLinkLabs / dray.
[0009] Furthermore, US 2017 / 163518 A1 discloses the definition of virtual machine-based workflows in a cloud environment, as well as input and output parameters of elements in a workflow.
[0010] Encapsulating functions as executable modules in isolated containers offers several advantages over an anonymous pipe. Besides increased security, stability, and scalability, it also allows for easier maintenance of a module, including its dependencies (libraries), independently of the dependencies of other modules.
[0011] However, the well-known solution has the disadvantage that only rigid processes are possible. The executable computer programs are therefore inflexible.
[0012] The invention is based on the objective of improving a method of the type mentioned above and a corresponding device so that computer programs can be designed and executed more flexibly. In particular, the development of computer programs should also be simplified and accelerated.
[0013] This problem is solved by a method having the features specified in claim 1 and by a device having the features specified in claim 11.
[0014] Advantageous embodiments of the invention are specified in the dependent claims. Within the scope of the invention, it was recognized that greater flexibility in the execution of a computer program in a computer network can be achieved by allowing multiple return values from several preceding function calls to be passed as separate parameters in at least one function call of the function in question. Preferably, a container is loaded as an execution environment for each function call and unloaded again after the called function has finished.
[0015] For example, while the current state of the art involves closing a container after a first function has finished and its return value has been read, copying the read value exclusively into the standard input channel of a second function, and then discarding it, the more flexible approach proposed here requires temporary storage of each return value. This can be done either explicitly in a variable specified in the computer program or, if the first function is directly included as a parameter (function argument) in the call to a second function within the executing computer program, implicitly in memory inaccessible to explicit instructions from the computer program. This allows for significantly more complex and flexible function calls.
[0016] Other functions called within the computer program can be passed either one or more parameters (function arguments) or they can be parameterless. Each function can either return one or more values or it can be returnless. A value returned by a function can be explicitly stored as the content of a variable and / or passed directly within a function call as a parameter to another function. The contents of variables can be passed as parameters in subsequent function calls.
[0017] Within the scope of the invention, it was also recognized that greater flexibility in the execution of a computer program in a computer network can be achieved by the computer program having instructions for controlling the program flow in addition to function calls, for example instructions for the conditional execution of program sections and jump instructions (conditional or unconditional).
[0018] According to a particular aspect, it was also recognized within the scope of the invention that the development of computer programs can be simplified and accelerated by providing a database in the computer network in which the computer program is to be executed, which contains the execution environments of the function modules and also their interface definitions, wherein the interface definition of an execution environment (or of the module contained therein) includes the data type of the result value of the contained module and also the data type(s) of the parameter(s) of the contained module.
[0019] This allows for the implementation and verification of static typing of variables and function arguments. This avoids run-time errors in favor of compile-time errors, simplifying and accelerating the entire development process. In current technology, incorrect data types can only be detected at runtime, resulting in significantly longer correction cycles.
[0020] The database containing the execution environments can advantageously be provided such that, in addition to the first interface definition with the data types of the result values and parameters for each module, it contains a second, separate interface definition that describes the user input expected interactively by the respective module, expediently also including the respective data type of the user input(s). In this way, user input can be received at any time during execution. In particular, however, the computer program can advantageously be executed in such a way that all user input for all modules is queried and received before the computer program starts running, so that the execution is not interrupted indefinitely by user queries.Another advantage is that one and the same module can be used in a large number of different computer programs without any changes to its content. This is achieved through the two interface definitions (data types of the result value and parameters, as well as interactively received parameters).
[0021] Conveniently, the database can contain the execution environments in the form of a reference and / or an image, respectively.
[0022] Accordingly, the following steps are provided for translating a computer program from one representation to another, in particular to a machine-executable representation: Providing a computer network comprising at least two computers connected to each other via a network, each with its own working memory; providing a database containing several different execution environments, each comprising a respective executable module, each of which provides a function (returning at least one result value), and the execution environment containing this module being executable on at least one of the computers in its own namespace, wherein the module invokes an operating system kernel of the computer in question, and this working environment returns a value output by this module as a result of the function it provides, wherein the database, in addition to each of the modules, contains its own interface definition describing the function provided by the respective module and is connected to the network.Reading a computer program that has at least a) a first instruction calling a first function which returns a result value, and b) a second instruction calling a second function with the received result value of the first function as a parameter; reading a first interface definition of a first module that provides the first function, wherein the first interface definition describes the first function by containing at least one data type of its result value, from the database; reading a second interface definition of a second module that provides the second function, wherein the second interface definition describes the second function by containing at least one data type of a parameter of the second function, from the database; and comparing the data type of the result value of the first function with the data type of the parameter of the second function.Detecting an inequality between the two data types and sending an error to an input device and / or aborting the translation process.
[0023] The first and second instructions can be identical if the result of the first function is passed as a parameter to the second function. In particular, the first and second functions can be identical if the second function is called recursively.
[0024] When the translated computer program is executed, the instructions contained in the translated representation are carried out, and it is advantageously determined that for one of the instructions a function called in this instruction is provided by one of the execution environments contained in the database, and then i) the relevant execution environment is loaded on one of the computers, ii) the module contained therein is executed on the relevant computer, and iii) the value output by this module is read as the result value of the function provided by this module.
[0025] After reading the result value, the relevant execution environment can be unloaded in step iv). Loading on demand and unloading after a function call has finished reduces the energy consumption of the computer network and the associated costs.
[0026] In a particularly advantageous embodiment, a microscope is connected to the network via a control computer, and when one of the instructions contained in the translated representation is executed, a control instruction is transmitted from the executing computer to the microscope, in particular to trigger an image acquisition at the microscope, wherein the acquired image is transferred from the control computer to one of the other computers. In this way, an image acquisition can be repeated without delay due to user interaction, especially if, during the execution of the computer program, it is determined that an image previously acquired with the microscope and transferred in the computer network does not meet a predefined criterion. Such a criterion can, for example, be a threshold value for an image quality measure or for a number of identifiable fluorescent markers.
[0027] According to the prior art, in such a case the execution of the computer program must be aborted and the entire process repeated after a new, manually triggered image capture. Advantageously, with the embodiment according to the invention, only the image capture and the instructions of the computer program directly or indirectly derived from the captured image need to be repeated.
[0028] Advantageously, the execution environments do not contain an operating system kernel that can be called by the respective module. The modules are then advantageously provided exclusively through container virtualization. Furthermore, it can be advantageous to provide the execution environments contained in the database in a stateless manner.
[0029] In a further advantageous embodiment, before the instructions contained in the computer program are executed, the estimated computing time and frequency of each function in the computer program can be predicted. In this way, the estimated total computing time and the estimated duration of the execution can be determined. One or both of these values can be displayed to the user before the execution begins, along with a control to cancel the execution, so that the user can terminate the execution in a timely manner.
[0030] The invention also includes a computer network configured to carry out one of the previously described methods, in particular with a microscope connected to the computer network via a control computer, wherein the control computer is configured to receive a control instruction for the microscope from one of the other computers and to control the microscope according to the instruction.
[0031] The invention allows complex workflows in microscopy to be largely simplified and automated, without the user needing to know the details of the process. The user simply needs to position the sample to be examined in the microscope and start a workflow in the form of a computer program that runs in the cloud. If necessary, the user will then be prompted for predetermined inputs.
[0032] The invention will now be explained in more detail using exemplary embodiments.
[0033] The drawings show: Fig. 1 a computer network with a microscope Fig. 2 three modules and their interfaces provided in a respective execution environment and Fig. 3 A flowchart of a computer program executed on the computer network.
[0034] In all drawings, matching parts bear the same reference symbols.
[0035] Fig. 1Figure 1 schematically depicts a computer network V in the form of a computer cloud, comprising, purely as an example, three computers 1 / 2 / 3, a database server 4, and an access point server 5, all interconnected via an Ethernet switch 6. The access point server 5 is accessible from the internet 7. A microscope 8, equipped with a control computer 9, is connected to the access point server 5 via the internet 7 and thus linked to the computer network V. Alternatively, another computer can be positioned between the control computer 9 and the internet 7. This additional computer provides a user interface and serves as an input device. In this way, a computer program can, in particular, contain instructions with image data that trigger the display of this image data on the additional computer.
[0036] Each of the computers 1 / 2 / 3 / 4 / 5 has its own processor and RAM. These are therefore physical computers. For clarity, only the processor 1.1 and RAM 1.2 of the first computer 1 are referenced. The Linux operating system with containers and control groups is deployed on each of the computers 1 / 2 / 3 / 4 / 5. Together, the computers 1 / 2 / 3 form a Docker swarm.
[0037] Database Server 4 contains numerous container images as execution environments for an identical number of executable modules. Each module provides exactly one function that accepts a non-negative integer number of parameters and returns a result value at the end of its execution. The database also contains a first interface definition for each of these functions, which describes the number of parameters and their data types. Furthermore, the database contains a second interface definition for each function, which describes the number of user inputs expected interactively by the respective module and their data types. In addition, the database can contain a version number for each execution environment. This makes it possible to deploy different versions of the same module in parallel.This makes it possible to release new versions of a module without having to modify existing computer programs. For this purpose, a required version of the function can be specified as a meta-parameter when calling the function.
[0038] The execution environments are run on machines 1 / 2 / 3 in their own separate namespaces. They invoke the operating system kernel of the respective machine, as they themselves, being containers, do not contain an operating system kernel. They can be created and started using Docker. The Docker swarm automatically decides on which machine (1 / 2 / 3) a runtime environment is loaded (created from its image) and executed. In each runtime environment, the parameters required by the contained executable module to perform its function are set, for example, as environment variables. The executable module can then read these variables as its own parameters. At the end of its execution, it outputs the result of the function, for example, to a file specified as a parameter or to the standard output channel.
[0039] The modules can be written in any (even different) programming languages and use any program libraries. They only need to behave according to the interface definitions regarding parameter acceptance and result return. A different image containing a version of the module can be installed in the database with minimal effort. For this purpose, the following is done in the database:
[0040] To execute a computer program in the computer network V, the access point server 5 receives the computer program in machine-executable form, for example from the control computer 9 or from a web server (not shown), which may in particular be part of the computer network V.
[0041] The user can, for example, first enter a computer program in an editor, such as on the aforementioned additional computer or on the aforementioned web server, in an application-specific language (domain-specific language), or load it from a storage device. The editor can then display the computer program graphically in the application-specific language, for example, in text form and / or as a flowchart. The user can edit the computer program either in text form or graphically. Changes to the flowchart are automatically reflected in the text form of the computer program by the editor. Conversely, changes to the text form are also automatically reflected in the flowchart.Before the computer program is executed, it is translated within the computer network V, for example on the control computer 9 or the aforementioned web server, from its representation in the application-specific language into a machine-executable representation. An intermediate translation from the application-specific language into another programming language may occur before this is translated into a machine-executable representation.
[0042] To translate, the computer program is first read in the application-specific language. If a first instruction, which calls a first function that returns a result value, and a second instruction, which calls a second function with the received result value of the first function as a parameter, are identified, the interface definitions of the modules providing the two functions are read from the database, and the data types described therein for the result value of the first function and the corresponding parameter of the second function are compared. If a discrepancy is found, a check is first performed to determine whether both are image data types. If so, an instruction is inserted into the translated representation of the computer program that calls a function to convert the result value into the image data type of the corresponding parameter.This function call, like other function calls in the computer program, can be executed by running a module contained in the database within an execution environment. Instead of such an implicit type conversion through a transparent function call, the computer program could therefore contain an explicit call to the same function.
[0043] If the data types identified as differing are not two image data types, an error is sent to the user's input device—in this example, to the aforementioned additional computer or web server, specifically to the editor—and / or the translation process is aborted. The editor can visually alert the user to the differing data types, allowing them to correct the program error without having to first execute the computer program up to the erroneous instruction, which is time-consuming.
[0044] The computer network V is configured to log, for example, the loading of all required execution environments and the execution of all modules contained within them, including their parameters, during the execution of a computer program. This logging is recorded in the database of database server 4. This allows execution to resume with the last incompletely or not at all executed module after a system stoppage, whether due to a crash or routine maintenance, without having to repeat previously successful function calls. This also applies when multiple computer programs are executed in parallel. Each computer program executed on the computer network is logged separately.
[0045] The logged actual computing times can be used in particular to predict the expected computing times.
[0046] Advantageously, a computer program that has already been executed can be re-run more quickly after only partial changes to its instructions or input data. For this purpose, the execution log is used to determine which instructions, both in the computer program itself and in all function modules it calls, including their parameters, have remained unchanged. Since files located outside the computer program can also be passed as parameters to functions within the program (for example, via a file path or URL), this is also taken into account. Only those instructions identified as having changed are actually executed when the computer program is run again. For all instructions identified as having changed, the return value of the previous call is loaded from the database instead.
[0047] One or more of the functions called by a computer program can trigger an image acquisition at the microscope 8 by transmitting a corresponding command to the control computer 9 via the internet 7. The control computer then sends the image data acquired during the image acquisition via the internet 7 to the computer network V. There, it can be stored, for example, on the database server 4. After receiving all the image data, the module providing the relevant function returns an object as a result value, which represents the image data and can be specified as a parameter in a subsequent call to an image processing function.
[0048] Fig. 2 schematically shows three different modules contained in execution environments, whose images and interface definitions are, for example, in the database according to Fig. 1 are included.
[0049] Figure 2A shows a module with a function "FunkA" that accepts no input parameters, requires no interactive user input, but returns exactly one result value OUT1, for example, an image data object type. The function provided by the module triggers, for example, an image acquisition in a connected microscope 8 and returns the acquired image as the result value.
[0050] Figure 2B shows a module with a function "FunkB" that accepts exactly one parameter IN1, for example, another image data object type, requires two interactive user inputs, and returns exactly one result value OUT2, for example, another image data object type. The user inputs must be, for example, a floating-point number and a color value. The function provided by the module performs a segmentation of the received image data based on the two numerical values entered by the user, which, for example, define a threshold and a dye. The identified segments are returned as the result value OUT2 of the data type object list.
[0051] Figure 2C shows a module with a function "FunkC" that accepts exactly two parameters, IN2 (for example, an image data object type) and IN3 (for example, an object list type). It requires no interactive user input but returns exactly one result value, OUT3 (here, for example, of type integer). The function provided by the module performs a classification for each object in the received object list IN2 that represents an image segment, based on the image data in that segment. The function then returns an object list OUT3 containing a class for each segment in IN3.
[0052] A computer program using these three modules can be structured as follows, for example: img:=FunkA() sgm:=FunkB(img) cls:=FunkC(img,sgm)
[0053] Here, "img", "sgm", and "cls" are variable identifiers to which memory locations are assigned. The returned result values are stored in the corresponding memory locations and, when a variable is used as a function parameter, are read back and passed to the respective function.
[0054] Fig. 3The diagram schematically illustrates the execution of a compiled computer program in steps S1-S7, where each step involves calling a function by starting an executable module contained in the database within a specific execution environment. The computer program contains several instructions, each comprising a condition dependent on a previously determined result value from one of the aforementioned functions. During program execution, upon reaching a conditional instruction, such as a conditional jump, the condition is checked, and the conditional instruction is executed only if the check confirms that the condition is met.
[0055] In this way, conditional jumps after step S3 can provide an execution loop or, alternatively, a branch. Similarly, a further branch can be achieved by a conditional jump after step S5. Reference symbol list
[0056] VR Computer Network 1 First Computer 1.1 Processor 1.2 RAM 2 Second Computer 3 Third Computer 4 Database Server 5 Access Point Server 6 Switch 7 Internet 8 Microscope 9 Control Computer
Claims
1. Method for automating a complex workflow in microscopy by executing a computer program in a computer network for controlling a microscope, comprising the following steps: - providing the computer network that comprises at least two computers connected to one another via a network, each having its own main memory per computer, - a user positioning a sample to be examined in the microscope, which is connected to the computer network via a control computer, - providing at least three different images of execution environments, each of which comprises a respective executable module, wherein each of these modules provides a respective function, and the execution environment containing this module is executable on at least one of the computers in a namespace of its own, wherein the module calls an operating system core of the relevant computer, and this work environment returns a value that is output by this module as the result of the function provided thereby, - the computer network receiving the computer program, which has at least a) a first instruction, which calls a first function that returns a first result value, b) a second instruction, which calls a second function that returns a second result value, and c) a third instruction, which calls a third function with the first result value as a first parameter and with the second result value as a second parameter, - the user starting the workflow in the form of the computer program, - the computer network starting one of the provided execution environments with the module providing the first function, and receiving the return value thereof as first result value, - the computer network starting one of the provided execution environments with the module providing the second function, and receiving the return value thereof as second result value, - the computer network starting one of the provided execution environments with the module providing the third function, wherein the first result value and the second result value are transferred to the module as parameters.
2. Method according to the preceding claim, additionally comprising: - providing a database that contains the execution environments, wherein the database contains, in addition to each of the modules, an interface definition of its own that describes the function provided by the relevant module, and is connected to the network.
3. Method according to the preceding claim, additionally comprising: - providing the database that contains the execution environments such that the database contains, in addition to each of the modules, a second interface definition of its own that describes user inputs interactively expected by the relevant module.
4. Method according to one of the preceding claims, wherein, when it is executed, a control instruction is transferred from the executing computer to the microscope, in particular for triggering an image acquisition on the microscope, the recorded image being transmitted from the control computer to one of the other computers.
5. Method according to one of the preceding claims, wherein none of the execution environments contain an operating system core callable by the relevant module.
6. Method according to one of Claims 2 to 5, wherein the database contains the execution environments in the form of a respective reference and / or image.
7. Method according to one of Claims 2 to 6, wherein the interface definitions, contained in the database, of the functions provided by the modules contain the data types of the input parameters and the data type of the result value of the respective function.
8. Method according to one of Claims 2 to 7, wherein the execution environments contained in the database are stateless.
9. Method according to one of Claims 1 to 8, wherein before the instructions contained in the computer program are executed, a probable computing time and a frequency of being called is forecast for each function contained in the computer program.
10. Method according to one of Claims 3 to 9, wherein all interactive user inputs for all modules are queried and received before execution of the computer program actually starts.
11. Computer network configured to perform a method according to one of the preceding claims, in particular having a microscope connected to the computer network via a control computer, wherein the control computer is configured such that it receives a control instruction for the microscope from one of the other computers and controls the microscope in accordance with the instruction.