COMPUTER-IMPLEMENTED METHOD FOR PRODUCING A SOFTWARE IMAGE SUITABLE FOR NUMERICAL SIMULATION OF AT LEAST PART OF A REAL CONTROL DEVICE
Patent Information
- Application Number
- DE502021010918
- Authority / Receiving Office
- DE · DE
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2021-07-30
- Filing Date
- 2021-11-23
- Publication Date
- 2026-09-03
- Estimated Expiration
- 2041-11-23
AI Technical Summary
Existing methods for developing and testing electronic control unit (ECU) software lack an efficient way to create a software image that accurately represents the functionality of a real control unit for numerical simulation, requiring multiple physical ECUs and lacking sufficient high-quality training data for neural networks.
A method using supervised or reinforcement learning to train a software image with input and output vectors derived from a real control unit's operation, allowing the creation of a software image that mimics the control unit's functionality, using either online or offline training methods to generate training data.
Enables the use of a single software image for multiple simulations, reducing the need for multiple physical ECUs and providing high-quality training data, thus enhancing efficiency and cost-effectiveness in ECU development.
Description
[0001] The invention relates to a computer-implemented method for producing a software image suitable for numerical simulation of at least a part of a real control unit, wherein the real control unit, during operation, maps an input vector of control unit input variables to an output vector of control unit output variables. Furthermore, the invention relates to a computer program with instructions which, when executed by a computer for training an artificial neural network or a support vector machine, cause the computer to execute the prescribed method.
[0002] Methods of the type described above are used in the field of electronic control unit (ECU) development, more precisely in the development and testing of ECU software. ECUs are small computers with an I / O interface. The ECU communicates with a technical-physical process via this I / O interface, receiving information from this process, for example, in the form of sensor measurement data, and in turn influencing the process by outputting actuator signals. Signal processing takes place within the ECU; the ECU input variables are prepared, analyzed, and further processed, for example, by a control algorithm. The resulting calculated variables are then output via the I / O interface.The application areas are diverse, including automotive, aerospace, and general industrial applications such as the process industry. Control unit input and output signals can take many different forms. These can be analog signals (e.g., a 4 to 20 mA interface), digital signals (e.g., PWM signals), modulated signals, or complex signals such as fieldbus messages based on a bus protocol (e.g., CAN, FlexRay, etc.). Signals can also be in different physical forms, such as electrical signals (current, voltage), electromagnetic signals in the form of radio waves, or optical signals, although the latter is less common; however, the specific form is not crucial.
[0003] Software development for electronic control units (ECUs) is represented in the so-called V-cycle. The V-cycle involves various development stages, starting with an abstract functional test, for example, of a control algorithm without any reference to the later ECU hardware (Model-in-the-Loop). This is followed by testing program code for the later production ECU, where the actual production ECU is not physically present but only represented in software as a virtual ECU (Software-in-the-Loop, SIL). Next, the physically existing production ECU is tested with the production ECU program code in a fully or partially simulated environment (Hardware-in-the-Loop, HIL), and finally, the production ECU is tested in its actual physical environment. During Hardware-in-the-Loop testing (HIL testing), the production ECU under test is accessible via its I / O interface (or, if applicable, a separate interface).(even just a portion of its I / O interface) is connected to a HIL simulator, where the environment of the control unit is (at least partially) simulated. For example, if the control unit is an engine control unit, the HIL simulator will simulate the engine to be controlled and, if necessary, more extensive environmental components such as the powertrain, chassis, and even 3D simulations of road scenes. The environment of the control unit under test does not need to be completely simulated in the HIL simulator; some components of the environment can also exist physically, such as other control units in a control unit cluster.
[0004] Even in software-in-the-loop testing, it can happen that the virtual control unit under test interacts with other control units, so the functionality of these other, peripheral control units must also be mapped in order to perform a meaningful test of the virtual control unit.
[0005] Methods for producing a software image for a logic controller using a trained model are known in the prior art, e.g., in the disclosure for patent application WO2019125519A1. Methods in which neural networks are trained by means of a simulation to control systems are also known. A corresponding example of controlling a robot arm is presented in the prior art in the disclosure for patent application DE102019122790A1. The object of the present invention is, among other things, to provide a method for the applications mentioned above, by which it is possible, in the case of an existing real control unit, to provide a software image of at least a part of this real control unit, wherein it is possible to perform a numerical simulation of the real control unit using this software image. The invention is defined in the claims.
[0006] The method according to the invention, which solves the problem derived and described above, is characterized firstly in that the software image maps the functionality of the real control unit within the framework of a numerical simulation, wherein the software image is formed by an artificial neural network or by a support vector machine, wherein the software image comprises an input vector of second image input variables and an output vector of second image output variables, wherein the input vector of first control unit input variables includes third control unit input variables that are used as second image input variables, and the output vector of first control unit output variables includes third control unit output variables that are used as second image output variables.wherein the software image is trained by supervised learning or by reinforcement learning with a plurality of training input vectors of the third control unit input variables and with a plurality of corresponding training output vectors of the third control unit output variables, wherein the training input vectors and the corresponding training output vectors are generated from the first control unit input variables and the first control unit output variables during the actual operation of the real control unit, characterized in thatthat the software image is trained by supervised learning or reinforcement learning during the operation of the real control unit using training input vectors and corresponding training output vectors acquired during this operation of the real control unit, and that only when the training of the software image with the last training input vector and corresponding training output vector used for training is completed, and any intervening input vector and output vector pairs acquired in the meantime are discarded.
[0007] According to the invention, the software image is further provided for by means of supervised learning or reinforcement learning with a plurality of training input vectors of the control unit input variables of interest, and in the case of supervised learning also with a plurality of corresponding training output vectors of the control unit output variables of interest. As a prerequisite, the functionality of the real control unit consists of mapping an input vector of control unit input variables to an output vector of control unit output variables; thus, the control unit output variables depend in some way on the control unit input variables. This is therefore a typical regression problem.
[0008] In the case of reinforcement learning, a training output vector does not necessarily have to be captured and used, although it could be. The quality of the output vector generated by the software image does not need to be assessed by comparing calculated and expected outputs in the case of reinforcement learning, but can be evaluated in other ways. A training output vector can be used for this purpose, but it is not required. In supervised learning, the capture and use of the training output vector is mandatory. The following explanations, which do not constantly distinguish between supervised and reinforcement learning, should be understood in this context. If reinforcement learning is to be used, a training output vector is not mandatory.
[0009] To train the software model, the training input vectors and corresponding training output vectors are derived from the operation of the real control unit (ECU), i.e., from the ECU input and output variables. These training input and output vectors are "error-free" because they originate from the operation of the real ECU. The resulting pairs of training input and output vectors are suitable both for training the artificial neural network or support vector machine and for validating the software model's behavior in the form of the artificial neural network or support vector machine. The software model of the real ECU can therefore also be understood as a behavioral model.
[0010] Supervised learning involves optimizing the freely adjustable parameters of the software image during the learning process by maximizing a quality function or minimizing an error function. This is achieved by continuously comparing the output vector of image variables calculated by the software image with the actual output vector of the control unit's output variables of interest. Reinforcement learning, on the other hand, continuously determines and optimizes the quality of the output vector of image variables calculated by the software image, which does not necessarily require the use of a training output vector.
[0011] The proposed method makes it possible to create a software image of a real control unit (ECU) that can then be used in other numerical simulations. This allows, for example, the software representation of the real ECU's behavior in the area of interest, and the use of multiple such software images in parallel hardware-in-the-loop (HIL) simulations or software-in-the-loop (SIL) simulations, where peripheral ECUs can be integrated into the simulation via such a software image. This offers significant advantages—both technically and in terms of cost—because it eliminates the need for multiple real ECUs; only a single one is required, whose functionality is imitated in the software image.
[0012] According to a preferred embodiment of the method, training takes place during the operation of the real control unit (ECU) using training input vectors acquired during this operation, and, in the case of supervised learning, also corresponding training output vectors. This is the "online" case, where the currently available and generated ECU input variables and corresponding ECU output variables are used as training input vectors and corresponding training output vectors. These can be acquired in the application case of the real ECU installed in the actual physical process; however, preferably the operation of the real ECU takes place within the framework of a hardware-in-the-loop simulation.
[0013] Many real-world electronic control units (ECUs) operate as time-deterministic sampling systems, often with sampling rates in the millisecond or even microsecond range. Even if the ECU inputs are not acquired and processed at a fixed rate, and the ECU outputs are not calculated and output at a fixed rate—for example, if the ECU operates in an event-driven manner—the software image may not be able to be trained with new training input vectors and corresponding training output vectors at the rate at which these training vectors are generated.Therefore, in a further advantageous embodiment of the method, a new pair of input vectors of control unit input variables and output vectors of control unit output variables is only used as training input vectors and corresponding training output vectors for training the software image once the training of the software image with the last training input vector and corresponding training output vector used for training has been completed. This means that any input vector and output vector pairs generated in the interim are discarded.
[0014] Another preferred embodiment of the method is characterized by the fact that a plurality of input vector pairs of first control unit input variables and corresponding output vector pairs of first control unit output variables are recorded during the operation of the real control unit, and the training of the software image is carried out independently of the operation of the real control unit using training input vector pairs and corresponding training output vector pairs derived from the recorded input vector pairs of first control unit input variables and corresponding output vector pairs. This is therefore the "offline" case of training the software image.
[0015] Using recorded pairs of input vectors from control unit input variables and corresponding output vectors from control variables offers several advantages. For example, it's possible to train different software images based on various artificial neural networks or support vector machines using an identical training dataset, even simultaneously, to later select the best software image. At the same time, the training of the software image is no longer dependent on the generation rate of training input vectors and corresponding training output vectors; the training can be performed faster or slower, depending on the available resources.
[0016] Regardless of whether the process is "online" or "offline," a preferred embodiment of the method provides that the training of the software representation of the real control unit is carried out using pairs of training input vectors and corresponding training output vectors derived from temporally equidistant, consecutive pairs of control unit input vectors and corresponding control unit output vectors. Particularly preferably, the training is performed using a series of several pairs of training input vectors and corresponding training output vectors derived from temporally uninterrupted, consecutive pairs of control unit input vectors and corresponding control unit output vectors.In the "online" case, whether this requirement can be met depends on the sampling rate of the real control unit and the maximum training speed of the software image.
[0017] According to further preferred embodiments of the method, the training input vectors and corresponding training output vectors obtained from the operation of the real control unit are accepted or rejected for training the software image in a selection step based on a selection criterion. The selection criterion could consist of a predefined range of values for at least some of the relevant control unit input variables and / or some of the relevant control unit output variables. This allows, for example, control over whether marginal control unit input variables or control unit output variables are considered during training.
[0018] Another method for influencing the training of the software image, in an advantageous embodiment of the procedure, involves operating the real control unit to obtain the training input vectors and the corresponding training output vectors in such a way that at least some of the control unit input variables and at least some of the control unit output variables assume values that cover at least a predefined interval of the theoretically possible value range. According to this procedure, care is taken to ensure that a specific value range is actually covered by the training input vectors and corresponding training output vectors, thus guaranteeing that training data is indeed available in the desired value range.
[0019] Preferably, an interval covering at least 70% of the theoretically possible range of values is covered, more preferably an interval covering at least 80% of the theoretically possible range of values, and more preferably an interval covering at least 90% of the theoretically possible range of values.
[0020] Preferably, the artificial neural network is implemented with an input layer comprising at least a number of input neurons corresponding to the number of third control unit input variables for inputting the control unit input variables of interest, and with an output layer comprising at least a number of output neurons corresponding to the number of third control unit output variables for outputting the third control unit output variables, wherein each input neuron is connected to at least one neuron of the intermediate layer via a directed and weighted signal path, and wherein at least one neuron of the intermediate layer is connected to the output neuron of the output layer via a directed and weighted signal path. This is the usual structure of an artificial neural network.The connections between the different layers must be complete enough to ensure a continuous signal path between an input neuron and an output neuron; otherwise, the influence of inputs on outputs is not possible. Preferably, a fully connected neural network is trained first, in which each input neuron is connected to each neuron in the intermediate layer via directed and weighted signal pathways, and each neuron in the intermediate layer is connected to the output neuron in the output layer via a directed and weighted signal pathway.
[0021] As already explained, the task derived at the beginning is also solved by a computer program with instructions which, when executed with a computer to train an artificial neural network or a support vector machine, cause the computer to perform the procedure described above.
[0022] In detail, there are numerous possibilities for designing and further developing the inventive method and the inventive computer program. Reference is made, on the one hand, to the claims subordinate to the independent claims, and on the other hand, to the following description of exemplary embodiments in conjunction with the drawing. The drawing shows Fig. 1 shows a first variant of a computer-implemented method according to the invention for producing a software image of a real control unit suitable for numerical simulation, Fig. 2 shows a further variant of a computer-implemented method according to the invention for producing a software image of a real control unit suitable for numerical simulation, and Fig. 3 shows an artificial neural network as a software image of a real control unit.
[0023] In the Fig. 1 and 2Each figure depicts a computer-implemented method 1 for producing a software image 2 suitable for numerical simulation of at least a part of a real control unit 3, wherein the real control unit 3, during operation, maps an input vector of control unit input variables 4a to an output vector of control unit output variables 4b. This means that the real control unit 3 determines control unit output variables 4b from the control unit input variables 4a received via its I / O interface (not shown separately here) through various calculations and also outputs them via its I / O interface. This is the mapping of input variables to output variables.
[0024] In the two Fig. 1 and 2Each figure shows an application case in which the control unit 3 is connected to a hardware-in-the-loop simulator. The hardware-in-the-loop simulator, which is not shown in detail here, has one or more processing units and I / O interfaces 10. The environment model 11 is calculated on the processing units, which are in the form of various processor boards, and the physical model quantities are then converted into the corresponding physical quantities of the sensor signals 12, or the electrical physical signals are converted into corresponding model signals of the environment model 11 12.
[0025] How the Fig. 1 and 2As can be seen, no distinction is made here—nor is it necessary—whether the control unit input variables 4a and the control unit output variables 4b are the actual electrical signals at the input pins and output pins of the real control unit 3 itself, or the corresponding numerical form of these control unit input variables or the corresponding control unit output variables. In the embodiments shown in the figures, the control unit input variables 4a and the control unit output variables 4b are understood to be the numerical equivalent of the electrical input and output variables, which is also sensible, since the software image 2 represents the functionality of the real control unit 3 within the framework of a numerical simulation; thus, it deals with the corresponding numerical values for the electrical input and output variables of the real control unit 3.
[0026] Both described methods 1 have in common that the software image 2 is formed by an artificial neural network 5 with an input vector of image input variables 6a with relevant control unit input variables 7a and with an output vector of image output variables 6b with relevant control unit output variables 7b. The figures show that the input vector of control unit input variables 4a comprises four signal lines, whereas only three relevant control unit input variables 7a are of interest and are used as image input variables 6a. The same applies to the relevant control unit output variables 7b, which are used as image output variables 6b.
[0027] The software image 2 is trained using supervised learning 8 with a plurality of training input vectors 9a of the control unit input variables 7a of interest and with a plurality of corresponding training output vectors 9b of the control unit output variables 7b of interest. The common problem with training software images created by an artificial neural network or a support vector machine, namely the insufficient availability of high-quality training data, does not exist in this case, since a real control unit 3 is available, which can generate a perfectly adequate and practically inexhaustible number of training vectors 9 during real-world operation.In any case, the required training input vectors 9a and the corresponding training output vectors 9b are derived from the operation of the real control unit 3, i.e., from the control unit input variables 4a and the control unit output variables 4b. Through the training 8 of the software image 2, a behavioral image of the functionality of interest of the real control unit 3 is obtained.
[0028] The case of training 8 of the software image 2 using reinforcement learning, which is not shown here, differs from the case of supervised learning in that a training output vector 9b does not necessarily have to be determined and used for training 8 of the software image 2 - but it could be used.
[0029] In Fig. 1 It is shown that the software image 2 is trained by supervised learning during the operation of the real control unit 3 with training input vectors 9a and corresponding training output vectors 9b acquired during this operation of the real control unit 3, wherein the operation of the real control unit 3 takes place within the framework of a hardware-in-the-loop simulation. Fig. 1 This illustrates the "online" case of procedure 1. Here, a new pair of input vectors (control unit input variables 4a) and output vectors (control unit output variables 4b) is only used as training input vectors 9a and corresponding training output vectors 9b for training software image 2 once training 8 of software image 2 has finished with the last training input vector 9a and corresponding training output vector 9b used for training 8. Any input vectors (control unit input variables 4a) and output vectors (control unit output variables 4b) that have accumulated in the meantime are dropped for training 8. In this way, software image 2 is supplied with new training data as quickly as possible, but not faster than possible within the scope of the "online" use case.
[0030] In Fig. 2 It is shown that the method 1 is operated such that a plurality of pairs of input vectors of control unit input variables 4a and corresponding output vectors of control unit output variables 4b are recorded 13 during the operation of the real control unit 3, using a data storage device 14 provided for this purpose. The training 8 of the software image 2 is carried out independently of the operation of the real control unit 3 with pairs of training input vector 9a and corresponding training output vector 9b, which are derived from the recorded pairs of input vectors of control unit input variables 4a and corresponding output vectors of control unit output variables 4b. This is the so-called "offline" case, in which there is no need to carry out the training 8 of the software image 2 simultaneously with the operation of the real control unit 2.
[0031] In the exemplary embodiments according to the Fig. 1 and 2The real control unit 3 is a deterministic sampling system with equidistant sampling points. The training 8 of the software image 2 of the real control unit 3 is performed using pairs of training input vector 9a and corresponding training output vector 9b, which are derived from temporally equidistant pairs of input vectors of control unit input variables 4a and corresponding output vectors of control unit output variables 4b. In the case of Fig. 2 , where training 8 of the software image 2 does not need to be done in real time, training 8 is carried out with a series of several pairs of training input vector 9a and corresponding training output vector 9b, which are obtained from temporally seamlessly successive pairs of input vector of control unit input variables 4a and corresponding output vector of control unit output variables 4b.
[0032] In Fig. 3Finally, it is shown how the artificial neural network 5 is implemented in embodiments 1 and 2, namely with an input layer 15 with at least one number – here three – of input neurons 16 corresponding to the number of control unit input variables 7a of interest for feeding the control unit input variables 7a of interest into the network. The artificial neural network 5 further comprises an output layer 17 with a number of output neurons 18 – here two – corresponding to the number of control unit output variables 7b of interest for outputting the control unit output variables 7b of interest. An intermediate layer 19 with three neurons 20 is also provided, wherein, in the present case, each input neuron 16 is connected to each neuron 20 of the intermediate layer 19 via directed and weighted signal paths 21, the weightings of the signal paths being implemented by multipliers in the signal path (not shown in detail).Furthermore, each neuron 20 of intermediate layer 19 is connected to both output neurons 18 of output layer 17 via a directed and weighted signaling pathway 21. The training 8 of the artificial neural network 5 consists of adjusting the multipliers of the weighted signaling pathways 21 between the different layers 15, 17, 19 of the artificial neural network 5. Reference sign
[0033] 1. Method 2. Software image 3. Real ECU 4a. ECU input variable 4b. ECU output variable 5. Artificial neural network 6a. Image input variable 6b. Image output variable 7a. ECU input variable of interest 7b. ECU output variable of interest 8. Training the software image 9a. Training input vector 9b. Training output vector 10. I / O interfaces of a hardware-in-the-loop simulator 11. Environment model 12. Conversion of model signals / physical signal 13. Recording of training vectors 14. Data storage 15. Input layer of the artificial neural network 16. Input neurons 17. Output layer of the artificial neural network 18. Output neurons 19. Intermediate layer of the artificial neural network 20. Intermediate layer neurons 21 directed and weighted signal paths
Claims
1. A computer-implemented method (1) for generating a software model (2) suitable for numerical simulation of at least a portion of a real control unit (3), wherein the real control unit (3), during operation, maps an input vector of first control unit input variables (4a) to an output vector of first control unit output variables (4b), wherein the software model (2) replicates the functionality of the real control unit (3) within the context of a numerical simulation, wherein the software model (2) is formed by an artificial neural network (5) or by a support vector machine, wherein the software model (2) comprises an input vector of second model input variables (6a) and an output vector of second model output variables (6b), wherein the input vector of first control unit input variables (4a) comprises third control unit input variables (7a), which are used as second map input variables (6a), and the output vector comprises first control unit output variables (4b) and third control unit output variables (7b), which are used as second map output variables (6b), wherein the software model (2) is trained (8) by means of supervised learning or by means of reinforcement learning using a plurality of training input vectors (9a) of the third control unit input quantities (7a) and with a plurality of corresponding training output vectors (9b) of the third control unit output variables (7b), wherein the training input vectors (9a) and the corresponding training output vectors (9b) are generated from the first control unit input variables (4a) and the first control unit output variables (4b) during the actual operation of the actual control unit (3), characterized in that the software image (2) is trained (8) by means of supervised learning or by means of reinforcement learning during the operation of the real control unit (3) using training input vectors (9a) and corresponding training output vectors (9b) obtained during this operation of the real control unit (3), and that only then is a new pair consisting of an input vector of first control unit input variables (4a) and an output vector of first control unit output variables (4b) used as a training input vector (9a) and a corresponding training output vector (9b) for the training (8) of the software model (2) only when the training (8) of the software image (2) using the last pair of training input vector (9a) and the corresponding training output vector (9b) used for the training (8) of the software image (2) is completed, and pairs of input vectors from first control unit input variables (4a) and output vectors from first control unit output variables (4b) that have been generated in the meantime are discarded.
2. Method (1) according to claim 1, characterized in that the operation of the real control unit (3) takes place within the framework of a hardware-in-the-loop simulation.
3. Method (1) according to claim 1, characterized in that a plurality of pairs of input vectors of first control unit input variables (4a) and corresponding output vectors of first control unit output variables (4b) are recorded (13) during the operation of the real control unit (3), and the training (8) of the software model (2) is performed independently of the operation of the real control unit (3) using pairs of training input vectors (9a) and corresponding training output vectors (9b), which are derived from the recorded pairs of input vectors of first control unit input quantities (4a) and corresponding output vectors of first control unit output quantities (4b).
4. Method (1) according to any one of claims 1 through 3, characterized in that the training (8) of the software model (2) of the actual control unit (3) is performed using pairs of training input vectors (9a) and corresponding training output vectors (9b), which are obtained from temporally equidistant successive pairs of input vectors of first control unit input variables (4a) and corresponding output vectors of first control unit output variables (4b), in particular with a series of several pairs of training input vectors (9a) and corresponding training output vectors (9b), which are obtained from pairs of input vectors of first control unit input variables (4a) and corresponding output vectors of first control unit output variables (4b) that follow one another without any time gaps.
5. Method (1) according to any one of claims 1 through 4, characterized in that the training input vectors (9a) and the corresponding training output vectors (9b) are accepted or rejected in a selection step based on a selection criterion for the training (8) of the software model (2).
6. The method (1) according to claim 5, characterized in that the selection criterion consists of a predetermined range of values for at least a portion of the third control unit input variables (7a) and / or a portion of the third control unit output variables (7b).
7. Method (1) according to any one of claims 1 through 6, characterized in that the operation of the real control unit for obtaining the training input vectors (9a) and the corresponding training output vectors (9b) is carried out such that at least a portion of the first control unit input variables (4a) and at least a portion of the first control unit output variables (4b) assume values that cover at least a predetermined interval of the theoretically possible range of values, in particular, covering an interval comprising at least 70% of the theoretically possible range of values, preferably covering an interval comprising at least 80% of the theoretically possible range of values, and most preferably covering an interval comprising at least 90% of the theoretically possible range of values.
8. Method (1) according to any one of claims 1 through 7, characterized in that the artificial neural network (5) is implemented with an input layer (15) having at least a number of input neurons (16) corresponding to the number of third control unit input variables (7a) for feeding in the third control unit input variables (7a), an output layer (17) with at least a number of output neurons (18) corresponding to the number of third control unit output variables (7b) for outputting the third control unit output variables (7b), and comprising at least one hidden layer (19) with at least two neurons (20), wherein each input neuron (16) is connected to at least one neuron of the hidden layer (19) via directed and weighted signal paths (21), and wherein each neuron of the intermediate layer (19) is connected via a directed and weighted signal path (21) to at least one output neuron (18) of the output layer (17).
9. A computer program comprising instructions which, when executed by a computer to train an artificial neural network (5), cause the computer to perform the method (1) according to one of claims 1 through 8.