Data recharging method based on Simulink application layer model

By using .m script programming in Simulink application layer model automatically imports real signals, it solves the cumbersome problems of traditional data repopulation methods, improves simulation efficiency and reliability, and achieves efficient data repopulation and system simulation performance improvement .

CN118963710APending Publication Date: 2024-11-15上海星宇智行技术有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410969322.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-19
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

The traditional data resumption input signal import method based on Simulink application layer model is cumbersome, which brings trouble to simulation engineering and affects simulation efficiency and reliability.

Method used

Automatic import of real signals is realized through .m script programming, the data file is traversed using the exhaustive method, encapsulated into a structure, and imported the Simulink model through the From Workspace module, configure Simulink model parameters, automatically process signal input, cover different conditions and decisions, and provide Manual switching system function module.

Benefits of technology

It improves simulation efficiency and reliability, reduces data processing complexity, simplifies the debugging process, realizes efficient and accurate data recharge, and improves system simulation and verification performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118963710A_ABST
    Figure CN118963710A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of automotive electronics and aerospace, and particularly relates to a data recharge method based on a Simulink application layer model, which comprises the following steps of: step1, judging the type of data needing to be recharged, and completing data encapsulation and type conversion; step2, completing the generation of an input data structural body based on a .M script through a traversal algorithm; step3, configuring codes in the .M script file to realize the link with a Simulink module; step4, configuring Simulink model parameters, and determining the simulation time of data recharge; and step5, correspondingly starting a system function module according to the recharge reproduced signal state. According to the data recharging method based on the Simulink application layer model, the data of the external data source is received through the data interface module, the data is preprocessed through the data processing module, and the data is efficiently and accurately recharged into the Simulink model through the data recharging module, so that the simulation and verification performance of the system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of automobile electronics, and in particular relates to a data re-injection method based on a Simulink application layer model. Background Art

[0002] In the context of social development, the number of cars owned continues to increase. For automakers, how to produce vehicles that are popular with customers has become a key issue. This places higher demands on developers to cope with the ever-changing market competition and consumer demand.

[0003] At this stage, the V-shaped development process has become the mainstream way of application layer development. In this process, Simulink software is widely used. It is a powerful modeling tool with many advantages. Simulink can provide an intuitive graphical interface to facilitate developers to design and simulate models. It supports modular development, so that each component of the system can be developed and tested independently, improving the efficiency and quality of development.

[0004] During the development process, the demand for data re-injection is increasing. Data re-injection can help developers observe the changing state of model signals in actual scenarios during the development process, thereby improving the reliability and security of software simulation. However, the traditional method of importing data re-injection input signals based on Simulink application layer models is relatively cumbersome, which brings great trouble to simulation projects. Summary of the invention

[0005] The purpose of the present invention is to provide a data recharge method based on Simulink application layer model, so as to solve the problem that the traditional data recharge input signal import method based on Simulink application layer model is relatively cumbersome, which brings great trouble to simulation engineering. In order to solve the above technical problems, the present invention provides a data recharge method based on Simulink application layer model, which realizes the automatic import of real signals into Simulink model through .m script programming. This method uses real recorded signals instead of analog signals, which improves the efficiency and reliability of simulation. By writing scripts, various signal inputs can be automatically processed, covering different conditions and decisions in the system, so as to perform data recharge more comprehensively.

[0006] The present invention provides a data re-injection method based on a Simulink application layer model, comprising the following steps:

[0007] S1. Determine the data type that needs to be re-injected, and complete data encapsulation and type conversion;

[0008] S2. Through the traversal algorithm, based on the .m script, the input data structure is generated;

[0009] S3. In the .m script file, configure the code to link with the Simulink module.

[0010] S4, configure the Simulink model parameters and determine the simulation time of data re-injection;

[0011] S5. Enable the corresponding system function module according to the signal status reproduced by the reinjection.

[0012] Furthermore, through the .m script, the data link with the Simulink module is opened, including the following steps:

[0013] S31. In Simulink, configure the parameter information of the From Workspace module and import the structure input signal in the From Workspace into the Simulink file;

[0014] S32. In the .m script file, read the data type of the data in the data file and convert it, and configure the simulation time of the Simulink file;

[0015] S33, run the .m script file, during which the Simulink model is called to obtain the structure information, and the corresponding structure data is automatically generated after the running is completed;

[0016] S34. For the missing structure data in the data file, automatically generate initialization data to complete the structure.

[0017] Furthermore, the data file is traversed through the .m script, and all different value conditions of the input signal are traversed by encapsulating the structure and converting the data of the input signal to complete the data re-injection.

[0018] Furthermore, according to the change of signal status, different functional modules in the model are enabled accordingly while complying with the modeling specifications of MAAB.

[0019] The data re-injection method based on the Simulink application layer model of the present invention, in the data re-injection of the Simulink application layer model, with the help of the powerful data processing ability of the .m script, adopts the exhaustive method, traverses all the data in the data file, and encapsulates it into a structure, imports the data into the Simulink model by the FromWorkspace control, as the input of the application layer model, and configures the parameters of the Simulink model in the .m script, solves the problem of frequent configuration during the debugging process, and the signal change state can be observed in real time during the model operation. In addition, a solution for the manual switch system function is provided to solve the demand for the manual control system function module switch and improve the overall test efficiency. The method receives data from an external data source through a data interface module, the data processing module performs pre-processing, and the data re-injection module efficiently and accurately re-injects the data into the Simulink model, thereby improving the performance of system simulation and verification.

[0020] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0022] Figure 1 It is a flow chart of the data re-injection method based on Simulink application layer model of the present invention;

[0023] Figure 2 is an overall flow chart of an embodiment of the present invention;

[0024] Figure 3 The .m script file of the present invention realizes data processing encapsulation and injects back into the flow chart of the model;

[0025] Figure 4 A diagram of the simulation test environment built for the present invention. DETAILED DESCRIPTION

[0026] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0027] like Figures 1 to 3 As shown, the present invention provides a data re-injection method based on a Simulink application layer model, comprising the following steps:

[0028] S1. Determine the Simulink module to be tested, configure the model and interface, and design the input signal with the same data type in the new model through the definition of module input;

[0029] Specifically, create a new Simulink file, copy the modules to be tested to the new file by right-clicking and dragging, and save it.

[0030] Specifically, you need to add an input module to connect with the model's input. In this solution, the FromWorkspace module is used to implement signal input. The data generated by the .m script is specified to be of double type, so you need to force data type conversion after the FromWorkspace module to avoid errors.

[0031] S2, through the .m script file, by traversing all the data, generating structure data on demand, and saving it to the Workspace;

[0032] Specifically, for some input interfaces that need to inject structure data back, you can traverse all input signals, define the structure according to the input interface, encapsulate multiple signals into a structure data, and convert the signal data type in the structure. Finally, save it to the Workspace.

[0033] S3. In Simulink, configure the parameter information of the From Workspace module, and use it to import the structure input signal in the Workspace into the Simulink file, and configure the sampling period of this test in the Simulink Setting;

[0034] Specifically, since the From Workspace module has type requirements for input data, it is necessary to specify the structure data. In the process of variable generation, the input must also be assigned to the structure, and the structure's timeseries and other formats must be configured. In addition, the input data variable name for this module must match that in the Workspace, and the sampling time must be set.

[0035] S4. In the .m script file, read the dimension of the input data and use the duration of the recorded data file as the simulation time of the Simulink file. The simulation test environment is shown in the figure below. Figure 4 shown.

[0036] Specifically, by reading the dimensions of the data file, assigning the dimension information to variables, and configuring the variables in the Stop Time option box in the Simulink model, the simulation end time can be made consistent with the actual signal sampling time, avoiding the situation where the simulation is not completed.

[0037] S5. After running the script file, run the Simulink model to re-inject data. When the model is running, the signal state changes can be observed in real time. For the missing structure data in the data file, the initialization data is automatically generated to complete the structure. According to the signal state changes, check whether the functional module is running normally.

[0038] Specifically, in the .m script file, configure the file name of the Simulink file to be run, the simulation rate, the simulation end time and other information, run the Simulink file, and inject the data back into the model through the configuration of step S3.

[0039] Specifically, the data information in the data file recorded on the actual vehicle may not be complete or may be missing, and all data must be input into the model during re-injection for the model to operate normally. At this time, it is necessary to automatically complete and initialize the actual input signal based on the data file information.

[0040] Specifically, for some state machine modules, due to logic design issues, it is impossible to reproduce the condition or judgment by re-injecting fragment data. It is necessary to discuss with the developers and provide an explanation for the non-reproduction. According to actual needs, the enabling and disabling of functional modules can be manually controlled to make the re-injection method more reasonable and standardized.

[0041] According to one embodiment of the present invention, the data file is traversed through the .m script to meet the requirements of the data reinjection model for the input signal. By encapsulating the input signal into a structure and converting the data, all different value conditions of the input signal are traversed to complete the data reinjection.

[0042] According to an embodiment of the present invention, different functional modules in the model are enabled as needed according to the change of signal status while complying with the modeling specification of the model MAAB. MAAB (Model-Based Analysis and Design) is a model-based analysis and design method. It uses formalized models to describe the behavior and structure of the system in order to analyze and verify the function and performance of the system.

[0043] Compared with the prior art, the present invention has the following features and beneficial effects:

[0044] (1) The powerful data processing capabilities of the .m script are utilized to automatically encapsulate the structure and initialize the data, and to achieve linkage with the Simulink model, which greatly reduces the complexity of data processing.

[0045] (2) Compared with the previous debugging process, which requires multiple configurations of Simulink related properties, the method of the present invention directly transfers the configuration information of the properties to the Simulink model through variables using a .m script file, eliminating the trouble of manually matching the number of input signals with the simulation time.

[0046] (3) Provide a solution for manually starting and stopping system function modules. In some cases, when certain function modules need to be turned on separately, all other function modules can be blocked through .m script configuration, and the separate testing of the module can be completed directly through the .m script file.

[0047] With this approach, developers can better meet the challenges of the automotive industry and improve the reliability and safety of software. At the same time, this also demonstrates the importance and advantages of Simulink in automotive application development and promotes technological progress and development in related fields.

[0048] The various devices selected in this application are all universal standard parts or parts known to those skilled in the art, and their structures and principles can be known to those skilled in the art through technical manuals or conventional experimental methods.

[0049] In the description of the embodiments of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or a connection; it can be a direct connection or an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0050] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.

[0051] Based on the above ideal embodiments of the present invention, the relevant staff can make various changes and modifications without departing from the technical concept of the present invention through the above description. The technical scope of the present invention is not limited to the contents of the specification, and its technical scope must be determined according to the scope of the claims.

Claims

1. A data re-injection method based on Simulink application layer model, characterized in that: The following steps are involved: S1. Determine the data type that needs to be re-injected, and complete data encapsulation and type conversion; S2. Through the traversal algorithm, based on the .m script, the input data structure is generated; S3. In the .m script file, configure the code to link with the Simulink module; S4, configure the Simulink model parameters and determine the simulation time of data re-injection; S5. Enable the corresponding system function module according to the signal status reproduced by the reinjection.

2. The data re-injection method based on Simulink application layer model according to claim 1 is characterized in that: Through the .m script, open the data link with the Simulink module, including the following steps: S31. In Simulink, configure the parameter information of the From Workspace module and import the structure input signal in the From Workspace into the Simulink file; S32. In the .m script file, read the data type of the data in the data file and convert it, and configure the simulation time of the Simulink file; S33, run the .m script file, during which the Simulink model is called to obtain the structure information, and the corresponding structure data is automatically generated after the running is completed; S34. For the missing structure data in the data file, automatically generate initialization data to complete the structure.

3. The data re-injection method based on Simulink application layer model according to claim 1 is characterized in that: The data file is traversed through the .m script, and all different value situations of the input signal are traversed by structure encapsulation and data conversion of the input signal to complete the data re-injection.

4. The data re-injection method based on Simulink application layer model according to claim 1 is characterized in that: According to the change of signal status, different functional modules in the model are enabled accordingly while complying with the modeling specifications of MAAB.