Code generation method, system and equipment applied to model intermediate signal and medium

By generating codes for model intermediate signals, the problem of being unable to determine the intermediate state of the model is solved, monitoring and management of model signals is realized, and system debugging efficiency and stability are improved.

CN118860416APending Publication Date: 2024-10-29CGN DIGITAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410907712.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-08
Publication Date
2024-10-29

AI Technical Summary

Technical Problem

The existing technology cannot generate the code for the intermediate signals of the model, resulting in the inability to determine the intermediate state of the model, making it difficult to monitor the system and locate problems.

Method used

By obtaining the connection lines of the target model, establishing the corresponding relationship between the connection lines and global variables, generating the target language code, including the intermediate signals of the model, and realizing the monitoring and management of all signals.

Benefits of technology

It reduces system debugging time, improves problem location efficiency, and improves system stability and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118860416A_ABST
    Figure CN118860416A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of road surface recognition, and discloses a code generation method, system and device applied to a model intermediate signal and a medium, and the method comprises the steps: obtaining a target model, and recognizing a connecting line of the target model; generating a corresponding relation according to the connecting line and a pre-constructed global variable; and obtaining an original language code generated by the target model, and performing code conversion on the original language code according to the corresponding relationship to obtain a target language code containing the intermediate signal of the target model. The language code representation of all signals (an input signal, an intermediate signal and an output signal) of the target model is realized by pre-constructing the global variable and establishing the corresponding relationship between the connecting line and the global variable in the target model, and the monitoring and management of all signals of the model are realized, so that the system debugging time is shortened, and the system debugging efficiency is improved. The positioning efficiency when problems occur is improved, and the stability and reliability of the system can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of road surface recognition, and in particular to a code generation method, system, device and medium applied to a model intermediate signal. Background Art

[0002] In recent years, model-based design has gradually become the main development method for wind power master control strategy development. The basic process of model-based design in the wind power industry is: wind power master control strategy designers use simulink models to model wind turbines, and then generate C language code or ST (Structured Text) language code through the model, and then compile and download it to the PLC (programmable logic controller) controller through PLC programming software to run, and use simulink models to monitor the controller to complete the confirmation of the correctness of the model.

[0003] Although C language has high running efficiency, ST language is compliant with the IEC (International Electrotechnical Commission) standard language of PLC and is familiar to engineering designers. Therefore, most models in actual work are generated as ST language codes. However, if the model currently generates ST language codes, it can only generate codes corresponding to input signals and output signals, and cannot generate codes for the intermediate signals of the model. As a result, users cannot view the intermediate states of the model during system debugging and integrated debugging. Especially when there are many intermediate states, the user can only modify the model, lead out the intermediate signals as output signals, and then determine the intermediate states, which causes great inconvenience to problem location.

[0004] In summary, the prior art has codes that cannot generate intermediate signals of the model, resulting in the problem that the intermediate state of the model cannot be determined and thus the system monitoring and problem location cannot be achieved. Summary of the invention

[0005] The present invention provides a code generation method, system, electronic device and computer-readable storage medium for model intermediate signals, the main purpose of which is to solve the problem that the code of the model intermediate signal cannot be generated, resulting in the inability to determine the model intermediate state and thus achieve system monitoring and problem location.

[0006] To achieve the above object, the present invention provides a code generation method for a model intermediate signal, comprising:

[0007] Acquire a target model, and identify connection lines of the target model;

[0008] Generate a corresponding relationship according to the connection line and the pre-built global variables;

[0009] The original language code generated by the target model is acquired, and the original language code is converted into a code according to the corresponding relationship to obtain the target language code containing the intermediate signal of the target model.

[0010] In one embodiment of the present invention, the step of identifying the connection lines of the target model includes:

[0011] Extracting initial connection lines one by one from the target model;

[0012] The initial connection lines are numbered using a preset traversal rule to obtain connection lines corresponding to the target model.

[0013] In one embodiment of the present invention, generating a corresponding relationship according to the connection line and the pre-built global variable includes:

[0014] Generate a corresponding target global variable according to the connecting line and the global variable;

[0015] The corresponding relationship is generated according to the connection relationship of the connection lines and the target global variable.

[0016] In one embodiment of the present invention, generating the corresponding relationship according to the connection relationship of the connection line and the target global variable includes:

[0017] Extracting the model block corresponding to the connecting line;

[0018] A corresponding relationship is established according to the model block and the target global variable.

[0019] In one embodiment of the present invention, the step of constructing a corresponding relationship according to the model block and the target global variable includes:

[0020] Constructing a model graph using the model blocks as nodes and the connection lines as edges;

[0021] Each node and the corresponding edge in the model graph is traversed, and the corresponding edge is type-marked according to the node to obtain the type of the target global variable.

[0022] In one embodiment of the present invention, after generating the corresponding relationship according to the connecting lines and the pre-constructed global variables, the method further includes: saving the corresponding relationship in a preset hash table to monitor all signals in the target model.

[0023] In one embodiment of the present invention, the code conversion of the original language code according to the corresponding relationship to obtain the target language code containing the target model intermediate signal includes:

[0024] Determine the target conversion code in the original language according to the corresponding relationship;

[0025] The target conversion code is subjected to code content replacement according to the corresponding relationship to obtain the target language code.

[0026] In order to solve the above problem, the present invention also provides a code generation system applied to a model intermediate signal, the system comprising:

[0027] A connection line identification module, used to obtain a target model and identify connection lines of the target model;

[0028] A corresponding relationship generating module, used for generating a corresponding relationship according to the connecting lines and pre-built global variables;

[0029] The target language code generation module is used to obtain the original language code generated by the target model, and perform code conversion on the original language code according to the corresponding relationship to obtain the target language code containing the intermediate signal of the target model.

[0030] In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:

[0031] at least one processor; and,

[0032] a memory communicatively connected to the at least one processor; wherein,

[0033] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the steps of the code generation method applied to the model intermediate signal as described above.

[0034] In order to solve the above problem, the present invention also provides a computer-readable storage medium, in which at least one computer program is stored. The at least one computer program is executed by a processor in an electronic device to implement the steps of the code generation method applied to the model intermediate signal as described above.

[0035] The present invention realizes the language code representation of all signals (input signals, intermediate signals, output signals) of the target model by pre-building global variables and establishing the corresponding relationship between the connecting lines in the target model and the global variables, realizes the monitoring and management of all signals of the model, thereby reducing the system debugging time, improving the efficiency of locating problems when problems occur, and helping to improve the stability and reliability of the system. Therefore, the code generation method, system, electronic device and computer-readable storage medium applied to the intermediate signal of the model proposed in the present invention can solve the problem that the code of the intermediate signal of the model cannot be generated, resulting in the inability to determine the intermediate state of the model and thus realize system monitoring and problem location. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 A schematic flow chart of a code generation method for a model intermediate signal provided by an embodiment of the present invention;

[0037] Figure 2 A schematic diagram of a portion of the structure of a Simulink model provided in one embodiment of the present invention;

[0038] Figure 3 A schematic diagram of a flow chart of generating a corresponding relationship according to the connecting lines and pre-built global variables provided in one embodiment of the present invention;

[0039] Figure 4 A functional module diagram of a code generation system for model intermediate signals provided by an embodiment of the present invention;

[0040] Figure 5 A schematic structural diagram of an electronic device for implementing the code generation method applied to a model intermediate signal provided by an embodiment of the present invention.

[0041] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0042] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0043] The embodiment of the present application provides a code generation method applied to the intermediate signal of the model. The execution subject of the code generation method applied to the intermediate signal of the model includes but is not limited to at least one of the electronic devices such as the server, the terminal, etc. that can be configured to execute the method provided by the embodiment of the present application. In other words, the code generation method applied to the intermediate signal of the model can be executed by software or hardware installed in the terminal device or the server device. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc. The server can be an independent server, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms.

[0044] Reference Figure 1 FIG. 1 is a flow chart of a code generation method for a model intermediate signal provided by an embodiment of the present invention. In this embodiment, the code generation method for a model intermediate signal includes:

[0045] S1. Obtain a target model and identify connection lines of the target model.

[0046] In the embodiment of the present invention, the target model is a simulink model. Simulink is a module diagram environment and a multi-domain simulation and model design software based on MATLAB. It supports system design, simulation, automatic code generation, and continuous testing and verification of embedded systems, and can perform dynamic system modeling, simulation and analysis.

[0047] Simulink provides a graphical programming environment where users can use predefined modules to quickly build complex dynamic system models; it supports modeling in multiple fields, including control systems, signal processing, communications, etc.; Simulink can also be seamlessly integrated with MATLAB, allowing users to perform simulation, analysis and code generation in the same environment; Simulink has a rich module library, and users can choose appropriate modules for modeling according to their needs. It also supports the development of custom modules.

[0048] In an embodiment of the present invention, the constructed target model includes multiple modules, inputs, outputs, etc.; when compiled into ST language code, only the codes corresponding to the input signal and the intermediate function module, the intermediate function module and the output signal, or the input signal and the output signal can be displayed, and the intermediate state between the input signal and the intermediate function module, the intermediate function module and the output signal, or the input signal and the output signal cannot be known. However, in the target model, the connection relationship between the input signal and the intermediate function module, the intermediate function module and the output signal, or the input signal and the output signal can be represented by a connecting line. Therefore, by identifying the connecting line, the intermediate state relationship between the input signal and the intermediate function module, the intermediate function module and the output signal, or the input signal and the output signal can be preliminarily confirmed.

[0049] See also Figure 2 As shown in the figure, for input In1, input In2 and input In3 in the target model, they are input into the intermediate function module and then output to output Out1, which is displayed as follows in the ST language code:

[0050] PROGRAM PLC PRGVAR

[0051] VAR

[0052] tbinstance:TestBench;

[0053] END VAR

[0054] tblnstance();

[0055] END PROGRAM

[0056] FUNCTION BLOCK Subsystem

[0057] VAR INPUT

[0058] In1: LREAL;

[0059] In2:LREAL;

[0060] In3:LREAL;

[0061] END VAR

[0062] VAR OUTPUT

[0063] Out1:LREAL;

[0064] END VAR

[0065] (*Outport:' <root> / Out1'incorporates;

[0066] *Sqrt:' <s1> / Sqrt

[0067] *Sum:' <s1> / Add'*)

[0068] Out1:=(In1+In2)+SQRT(In3);

[0069] END FUNCTION BLOCK

[0070] In the above code display, only the status of input In1, input In2, input In3 and output Out1 can be reflected, and the intermediate status between input In1, input In2, input In3 and the intermediate functional module, or between the intermediate functional module and output Out1 cannot be reflected.

[0071] Specifically, the identifying the connection lines of the target model includes: extracting initial connection lines one by one from the target model; and numbering the initial connection lines using a preset traversal rule to obtain connection lines corresponding to the target model.

[0072] Among them, the connection lines between the input signal and the intermediate functional module, the intermediate functional module and the output signal, or the input signal and the output signal in the target model can be extracted as the initial connection lines; then according to the traversal rule of "from top to bottom, from left to right" on the model diagram page, the initial connection lines are numbered in the order of 1, 2, ..., n, and connection lines with unique numbers can be obtained.

[0073] S2. Generate a corresponding relationship according to the connection line and the pre-built global variables.

[0074] In the embodiment of the present invention, the intermediate signal of the target model is processed and represented as a global variable (G_Ln) in the ST language so as to be monitored and managed in the code.

[0075] Furthermore, after extracting the connection lines, a connection relationship between the connection lines and pre-built global variables may be established to implement declaration of global variables for all connection lines.

[0076] It should be noted that global variables can be created by an object function or anywhere in the program. Global variables can be referenced by all objects or functions in the program and are accessible from anywhere in the program. Global variables can be declared by defining them in the outermost layer of the code, usually at the beginning of the program. In programming languages, keywords can be used to explicitly declare variables as global variables.

[0077] See also Figure 3 As shown, specifically, generating a corresponding relationship according to the connecting line and the pre-constructed global variable includes: S31, generating a corresponding target global variable according to the connecting line and the global variable; S32, generating the corresponding relationship according to the connection relationship of the connecting line and the target global variable.

[0078] Furthermore, generating the corresponding relationship according to the connection relationship of the connecting line and the target global variable includes: extracting the model block corresponding to the connecting line; and constructing the corresponding relationship according to the model block and the target global variable.

[0079] Among them, the model blocks can be input signals, intermediate functional modules, and output signals; for example, the model blocks corresponding to the connecting line G_L1 are input signal In1 and output signal Out1, respectively, and the original corresponding relationship is Out1=In1, and the corresponding relationship constructed through the target global variable is expressed as G_L1=In1; Out1=G_L1.

[0080] Furthermore, the constructing of the corresponding relationship according to the model block and the target global variable further includes: determining the type of the target global variable according to the model block.

[0081] Specifically, determining the type of the target global variable based on the model block includes: constructing a model graph with the model block as a node and the connecting line as an edge; traversing each node and corresponding edge in the model graph, and marking the corresponding edge with a type according to the node to obtain the type of the target global variable.

[0082] In the embodiment of the present invention, the type of the connection line can be derived by the graph traversal algorithm so as to distinguish and manage it in the subsequent code generation and other processing processes. Specifically, the intermediate function blocks, input signals, and output signals in the Simulink model are first regarded as nodes of the model graph, and the connection lines connecting them are regarded as edges of the model graph; then the breadth-first search is used to start from the upper left corner of the Simulink model graph as the starting node, and the entire model graph is traversed; during the traversal process, each edge is marked to determine its type, for example, character types such as int and string.

[0083] Among them, in the process of marking each edge, if the connecting line connects an input signal or an output signal, the type of the input signal or the output signal can be used as the type of the target global variable corresponding to the connecting line; if the connecting line connects the pin of an intermediate functional module, the pin type of the intermediate functional module can be used as the type of the target global variable corresponding to the connecting line.

[0084] It should be noted that after the type of the target global variable is determined, when converting the language code, the target global variable is preceded by an identifier of its corresponding data type.

[0085] In another optional embodiment of the present invention, after generating the corresponding relationship according to the connecting lines and the pre-built global variables, it also includes: saving the corresponding relationship in a preset hash table to realize monitoring of all signals in the target model; querying the corresponding relationship between the input signal and the intermediate functional module, the intermediate functional module and the output signal, or the input signal and the output signal when monitoring the system in the subsequent processing process.

[0086] In detail, the global variables of all connection lines can be managed uniformly in the form of a structure, which is convenient for subsequent calling and management in the code.

[0087] S3. Acquire the original language code generated by the target model, and perform code conversion on the original language code according to the corresponding relationship to obtain the target language code containing the intermediate signal of the target model.

[0088] In an embodiment of the present invention, in Simulink, different modules can be used to build a model, and then ST language code is generated by specifying the target language as ST (Structured Text), and the target path for generating the ST language is set to a directory readable by the PLC controller programming software. When the model is ready and configured correctly, the Simulink Coder tool (code generator) can be used to generate the ST language code in the specified directory; the PLC controller programming software reads the generated ST language code for compilation, and downloads it to the PLC controller.

[0089] In another optional embodiment of the present invention, the target language can also be specified as C language to generate C language code. When the model is ready and configured correctly, the Simulink Coder tool (code generator) can be used to generate C language code in a specified directory, and then the generated C language code can be compiled into an executable file and then deployed to the target device for execution.

[0090] In an embodiment of the present invention, the code conversion of the original language code according to the corresponding relationship to obtain the target language code containing the intermediate signal of the target model includes: determining the target conversion code in the original language according to the corresponding relationship; and replacing the code content of the target conversion code according to the corresponding relationship to obtain the target language code.

[0091] For example, it is determined that the original statement form of the target conversion code is "Out1=In1", and according to the corresponding relationship, the content that needs to be replaced is the two statements "G_L1=In1; Out1=G_L1". "Out1=In1" is replaced by "G_L1=In1; Out1=G_L1", and the language code after replacement is the target language code containing the intermediate signal of the target model, thereby realizing the generation and monitoring of the intermediate signal.

[0092] Furthermore, after the target language code is generated, the PLC controller programming software reads the generated ST language code for compilation and downloads it to the PLC controller. Simulink can be used to monitor the PLC controller to view all signal states (input signal state, intermediate signal state and output signal state).

[0093] In an actual application scenario of the present invention, the target model can be applied to the design of wind turbine generator master control systems, DCS (Distributed Control System) industrial control and other fields. The code generation method of the present invention can realize the monitoring of intermediate signals, and the intermediate state plays a role in improving the efficiency of problem solving for the entire wind power control strategy debugging, thereby greatly shortening the system debugging time of the wind turbine master control system, improving the efficiency of problem locating, and providing engineering designers with more convenient and quick debugging and management means, which helps to improve the stability and reliability of the wind power system.

[0094] The present invention realizes the language code representation of all signals (input signals, intermediate signals, output signals) of the target model by pre-building global variables and establishing the corresponding relationship between the connecting lines in the target model and the global variables, realizes the monitoring and management of all signals of the model, thereby reducing the system debugging time, improving the efficiency of locating problems when problems occur, and helping to improve the stability and reliability of the system. Therefore, the code generation method applied to the intermediate signal of the model proposed by the present invention can solve the problem that the code of the intermediate signal of the model cannot be generated, resulting in the inability to determine the intermediate state of the model and thus realize system monitoring and problem location.

[0095] like Figure 4 As shown, it is a functional module diagram of a code generation system 100 applied to a model intermediate signal provided by an embodiment of the present invention. According to the implemented functions, the code generation system applied to the model intermediate signal may include a connection line identification module 101, a corresponding relationship generation module 102 and a target language code generation module 103. The module described in the present invention may also be referred to as a unit, which refers to a series of computer program segments that can be executed by a processor of the code generation system applied to the model intermediate signal and can complete fixed functions, which are stored in the memory of the code generation system applied to the model intermediate signal.

[0096] In this embodiment, the functions of each module / unit are as follows:

[0097] The connection line identification module 101 is used to obtain a target model and identify connection lines of the target model;

[0098] The corresponding relationship generating module 102 is used to generate a corresponding relationship according to the connecting line and the pre-built global variables;

[0099] The target language code generating module 103 is used to obtain the original language code generated by the target model, and perform code conversion on the original language code according to the corresponding relationship to obtain the target language code containing the intermediate signal of the target model.

[0100] In detail, each module described in the code generation system 100 applied to the model intermediate signal described in the embodiment of the present invention adopts the same technical means as the code generation method applied to the model intermediate signal described in the accompanying drawings when used, and can produce the same technical effects, which will not be repeated here.

[0101] like Figure 5 , which is a schematic diagram of the structure of an electronic device for implementing a code generation method applied to a model intermediate signal provided by an embodiment of the present invention.

[0102] The electronic device 200 may include a processor 201 , a memory 202 , a communication bus 203 , and a communication interface 204 , and may also include a computer program stored in the memory 202 and executable on the processor 201 , such as a code generation program applied to a model intermediate signal.

[0103] In some embodiments, the processor 201 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and a combination of various control chips.

[0104] In some embodiments, the memory 202 may be an internal storage unit of the electronic device, such as a mobile hard disk of the electronic device. In other embodiments, the memory 202 may also be an external storage device of the electronic device. Furthermore, the memory 202 may include both an internal storage unit of the electronic device and an external storage device. The memory 202 may be used not only to store application software and various data installed in the electronic device, such as the code of the code generation program applied to the model intermediate signal, but also to temporarily store data that has been output or is to be output.

[0105] The communication bus 203 can be divided into an address bus, a data bus, a control bus, etc. The bus is configured to realize connection and communication between the memory 202 and at least one processor 201, etc.

[0106] The communication interface 204 is used for communication between the electronic device and other devices, and includes a network interface and a user interface.

[0107] Figure 5 Only an electronic device with components is shown, and those skilled in the art will understand that Figure 5 The structure shown does not constitute a limitation on the electronic device 200 , and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.

[0108] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.

[0109] The code generation program for the model intermediate signal stored in the memory 202 in the electronic device 200 is a combination of multiple instructions. When running in the processor 201, it can achieve:

[0110] Acquire a target model, and identify connection lines of the target model;

[0111] Generate a corresponding relationship according to the connection line and the pre-built global variables;

[0112] The original language code generated by the target model is acquired, and the original language code is converted into a code according to the corresponding relationship to obtain the target language code containing the intermediate signal of the target model.

[0113] Specifically, the specific implementation method of the processor 201 for the above instructions can refer to the description of the relevant steps in the corresponding embodiment of the accompanying drawings, which will not be repeated here.

[0114] Furthermore, if the modules / units integrated in the electronic device 200 are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile.

[0115] The present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of an electronic device, the computer program can implement:

[0116] Acquire a target model, and identify connection lines of the target model;

[0117] Generate a corresponding relationship according to the connection line and the pre-built global variables;

[0118] The original language code generated by the target model is acquired, and the original language code is converted into a code according to the corresponding relationship to obtain the target language code containing the intermediate signal of the target model.

[0119] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, systems and methods can be implemented in other ways. For example, the system embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.

[0120] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0121] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0122] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or systems stated in a system claim can also be implemented by one unit or system through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.

[0123] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention. < / root>

Claims

1. A code generation method applied to an intermediate signal of a model, characterized in that: The method comprises: Acquire a target model, and identify connection lines of the target model; Generate a corresponding relationship according to the connection line and the pre-built global variables; The original language code generated by the target model is acquired, and the original language code is converted into a code according to the corresponding relationship to obtain the target language code containing the intermediate signal of the target model.

2. The code generation method applied to the model intermediate signal according to claim 1, characterized in that: The identifying the connection lines of the target model includes: Extracting initial connection lines one by one from the target model; The initial connection lines are numbered using a preset traversal rule to obtain connection lines corresponding to the target model.

3. The code generation method applied to the model intermediate signal according to claim 1, characterized in that: The generating a corresponding relationship according to the connecting line and the pre-built global variable includes: Generate a corresponding target global variable according to the connecting line and the global variable; The corresponding relationship is generated according to the connection relationship of the connection lines and the target global variable.

4. The code generation method applied to the model intermediate signal according to claim 3, characterized in that: The generating the corresponding relationship according to the connection relationship of the connection line and the target global variable includes: Extracting the model block corresponding to the connecting line; A corresponding relationship is established according to the model block and the target global variable.

5. The code generation method applied to the model intermediate signal according to claim 3, characterized in that: The constructing a corresponding relationship according to the model block and the target global variable includes: Constructing a model graph using the model blocks as nodes and the connection lines as edges; Each node and the corresponding edge in the model graph is traversed, and the corresponding edge is type-marked according to the node to obtain the type of the target global variable.

6. The code generation method applied to the model intermediate signal according to claim 1, characterized in that: After generating the corresponding relationship according to the connecting lines and the pre-built global variables, the method further includes: saving the corresponding relationship in a preset hash table to realize monitoring of all signals in the target model.

7. The code generation method applied to the model intermediate signal according to claim 1, characterized in that: The code conversion of the original language code according to the corresponding relationship to obtain the target language code containing the target model intermediate signal includes: Determine the target conversion code in the original language according to the corresponding relationship; The target conversion code is subjected to code content replacement according to the corresponding relationship to obtain the target language code.

8. A code generation system for model intermediate signals, characterized in that: The system comprises: A connection line identification module, used to obtain a target model and identify connection lines of the target model; A corresponding relationship generating module, used for generating a corresponding relationship according to the connecting lines and pre-built global variables; The target language code generation module is used to obtain the original language code generated by the target model, and perform code conversion on the original language code according to the corresponding relationship to obtain the target language code containing the intermediate signal of the target model.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to perform the steps of the code generation method applied to the model intermediate signal according to any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the code generation method applied to a model intermediate signal according to any one of claims 1 to 7 are implemented.