Off-line simulation method and device, electronic equipment and computer readable storage medium

By establishing the mapping relationship between the underlying driver and the interface layer between the system platforms, processing the source code to generate the execution program, the problem of insufficient flexibility in the offline simulation solution of PLC is solved, and the multi-system platform compatibility simulation and logic of PLC applications is realized The restoration of functions improves testing and debugging efficiency.

CN119227609APending Publication Date: 2024-12-31SHENZHEN INVT ELECTRIC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411318021.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-20
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

The existing PLC offline simulation solutions are less flexible and difficult to be compatible with multiple system platforms, limiting the flexibility and efficiency of engineers when testing and debugging PLC programs.

Method used

By generating simulation running files and programmable logic controller running files, establishing the mapping relationship between the underlying driver and the interface layer corresponding to each system platform, establishing the calling relationship between the application layer and the underlying driver, processing the source code to generate the execution program, and realizing simulation The loading and execution of the executor program and the program running program of the program is supported by the compatibility of multi-system platforms.

Benefits of technology

It realizes simulation of the PLC application operation process, restores the application logic function of the source code to the greatest extent, and has strong flexibility, and can run effectively on multiple system platforms, reducing the time and cost of testing and debugging.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119227609A_ABST
    Figure CN119227609A_ABST
Patent Text Reader

Abstract

The invention discloses an offline simulation method and device, electronic equipment and a computer readable storage medium, and relates to the technical field of simulation, and the method comprises the steps: generating a simulation operation file and a programmable logic controller operation file; establishing a mapping relationship between the bottom driver corresponding to each system platform and the interface layer; establishing a calling relation between an application layer and the bottom layer driving program according to the mapping relation to obtain a source code; processing the source code to obtain an executive program; the execution program comprises a simulation execution program and a programmable logic controller running program; the simulation operation file is loaded by operating the simulation execution program, and corresponding logic is executed; and loading the programmable logic controller operation file through the programmable logic controller operation program and executing corresponding logic. The method can simulate the running process of the application program, is compatible with a multi-system platform, and has higher flexibility.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of simulation technology, and in particular to an offline simulation method, device, electronic device and computer-readable storage medium. Background Art

[0002] PLC (Programmable Logic Controller) offline simulation is to simulate the operation process of PLC through simulation software, which allows engineers to test and debug PLC programs without actual hardware. Before the project file is officially put into use, PLC offline simulation can check whether the logical function, motion control function and communication function of the PLC program are correct. PLC offline simulation helps to reduce the time and cost required for testing and debugging on actual hardware. However, the current PLC offline simulation solution has poor flexibility. Therefore, providing an offline simulation solution that can solve the above technical defects has become a technical problem that needs to be solved urgently by those skilled in the art. Summary of the invention

[0003] The purpose of this application is to provide an offline simulation method, device, electronic device and computer-readable storage medium that can simulate the running process of an application program, is compatible with multiple system platforms, and has greater flexibility.

[0004] In order to solve the above technical problems, the present application provides an offline simulation method, comprising:

[0005] Generate simulation operation files and programmable logic controller operation files;

[0006] Establish a mapping relationship between the underlying driver and the interface layer corresponding to each system platform;

[0007] Establishing a calling relationship between the application layer and the underlying driver according to the mapping relationship to obtain source code;

[0008] Processing the source code to obtain an execution program; the execution program includes a simulation execution program and a programmable logic controller running program;

[0009] Load the simulation execution file by running the simulation execution program and execute corresponding logic;

[0010] The programmable logic controller operation file is loaded through the programmable logic controller operation program and the corresponding logic is executed.

[0011] In some embodiments, processing the source code to obtain an execution program includes:

[0012] Load the corresponding source files and header files according to the type of system platform;

[0013] Determine the corresponding compiler according to the type of system platform;

[0014] Compiling the source file and the header file by the determined compiler to obtain an assembly program;

[0015] Assembling the assembler to obtain a target file;

[0016] The target files are connected through a connector to obtain the execution program.

[0017] In some embodiments, the system platform includes a Windows platform and a Linux platform.

[0018] In some embodiments, determining a corresponding compiler according to the type of the system platform includes:

[0019] If the system platform is Windows platform, determine the x86 gcc cross compiler;

[0020] If the system platform is Linux platform, determine the arm gcc cross compiler.

[0021] In some embodiments, the underlying driver includes an underlying driver for platform driving, an underlying driver for platform system, and an underlying driver for platform file management.

[0022] In some embodiments, it also includes:

[0023] Write low-level drivers corresponding to each system platform.

[0024] In some embodiments, generating a simulation operation file and a programmable logic controller operation file includes:

[0025] Programming user programs;

[0026] The compiler is selected to compile the user program to generate the simulation run file and the programmable logic controller program.

[0027] In order to solve the above technical problems, the present application also provides an offline simulation device, comprising:

[0028] A generation module, used for generating simulation operation files and programmable logic controller operation files;

[0029] The first establishment module is used to establish a mapping relationship between the underlying driver and the interface layer corresponding to each system platform;

[0030] A second establishing module is used to establish a calling relationship between the application layer and the underlying driver according to the mapping relationship to obtain a source code;

[0031] A processing module, used for processing the source code to obtain an execution program; the execution program includes a simulation execution program and a programmable logic controller running program;

[0032] A first running module, used for loading the simulation running file and executing corresponding logic by running the simulation execution program;

[0033] The second operation module is used to load the programmable logic controller operation file through the programmable logic controller operation program and execute corresponding logic.

[0034] In order to solve the above technical problems, the present application also provides an electronic device, including:

[0035] Memory for storing computer programs;

[0036] A processor is used to implement the steps of the above-mentioned off-line simulation method when executing the computer program.

[0037] In order to solve the above technical problems, the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the offline simulation method described above are implemented.

[0038] The offline simulation method provided in the present application includes: generating a simulation running file and a programmable logic controller running file; establishing a mapping relationship between the underlying driver and the interface layer corresponding to each system platform; establishing a calling relationship between the application layer and the underlying driver according to the mapping relationship to obtain a source code; processing the source code to obtain an execution program; the execution program includes a simulation execution program and a programmable logic controller running program; loading the simulation running file and executing corresponding logic by running the simulation execution program; loading the programmable logic controller running file and executing corresponding logic by the programmable logic controller running program.

[0039] It can be seen that the offline simulation method provided by the present application generates a simulation run file and a programmable logic controller run file, and the simulation execution program obtained by processing the source code loads the simulation run file and executes the corresponding logic, and the programmable logic controller run program obtained by processing the source code loads the programmable logic controller run file and executes the corresponding logic, wherein a mapping relationship is established between the underlying driver and the interface layer corresponding to each system platform, and a calling relationship between the application layer and the underlying driver is established according to the mapping relationship to obtain the source code, so that the running process of the PLC application can be simulated, the logical function of the source code application can be restored to the greatest extent, and it can be compatible with multiple system platforms and has strong flexibility.

[0040] The offline simulation device, electronic device and computer-readable storage medium provided in this application all have the above-mentioned technical effects. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0042] Figure 1 A schematic diagram of a flow chart of an offline simulation method provided in an embodiment of the present application;

[0043] Figure 2 A schematic diagram of the calling relationship between an underlying driver, an interface layer, and an application program provided in an embodiment of the present application;

[0044] Figure 3 A schematic diagram of a simulation operation file and a PLC operation file under a Windows system platform provided in an embodiment of the present application;

[0045] Figure 4 A schematic diagram of a simulation operation file and a PLC operation file under a Linux system platform provided in an embodiment of the present application;

[0046] Figure 5 A schematic diagram of source code processing provided in an embodiment of the present application;

[0047] Figure 6 A schematic diagram of an offline simulation provided in an embodiment of the present application;

[0048] Figure 7 A schematic diagram of an offline simulation device provided in an embodiment of the present application;

[0049] Figure 8 A schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0050] The core of this application is to provide an offline simulation method, device, electronic device and computer-readable storage medium, which can simulate the running process of an application, and is compatible with multiple system platforms and has greater flexibility.

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

[0052] Please refer to Figure 1 , Figure 1 A schematic diagram of an offline simulation method provided in an embodiment of the present application, referring to Figure 1 As shown, the method includes:

[0053] S101: Generate a simulation operation file and a programmable logic controller operation file;

[0054] The simulation run file of the user program and the programmable logic controller run file, i.e., the PLC run file, can be generated in the upper computer software supporting the PLC. The purpose of generating the simulation run file is to execute the simulation function. The purpose of generating the PLC run file is to execute the PLC entity function, such as general instructions, logic instructions, encoder axis functions, TCP functions, etc.

[0055] In some embodiments, generating a simulation operation file and a programmable logic controller operation file includes:

[0056] Programming user programs;

[0057] The compiler is selected to compile the user program to generate the simulation run file and the programmable logic controller program.

[0058] Corresponding user programs can be programmed according to different simulation requirements, and then the user programs can be compiled to generate corresponding simulation operation files and programmable logic controller programs, which can improve the diversity of simulation operation files and programmable logic controller programs.

[0059] Program the user program in the upper computer software configured by the PLC. When compiling the user program, select the compiler, compile the user program through the compiler, and generate the simulation operation file and the PLC operation file.

[0060] S102: Establishing a mapping relationship between the underlying driver and the interface layer corresponding to each system platform;

[0061] refer to Figure 2As shown, the system platform may include a Windows system platform, a Linux system platform, etc. By establishing a mapping relationship between the underlying driver and the interface layer corresponding to each system platform, the same interface layer can call the underlying driver corresponding to different system platforms according to different system platforms. For example, when the system platform is a Windows system platform, the interface layer calls the underlying driver corresponding to the Windows system platform; when the system platform is a Linux system platform, the interface layer calls the underlying driver corresponding to the Linux system platform.

[0062] In some embodiments, the system platform includes a Windows platform and a Linux platform.

[0063] DLL type files and txt configuration files under Windows system platform are simulation operation files. exe files executed under Windows system platform are PLC operation files. For example, Figure 3 As shown, under the windows system platform, the generated execution program TS635.exe is imported into the hardware platform PC, and the user program runtime library user.DLL and configuration files generated by the host computer software are imported into the hardware platform PC, so as to load the execution program TS635.exe on the hardware platform PC. The relationship between the execution program TS635.exe and the application and the driver under the windows system platform is: the execution program TS635.exe calls the application, and the application calls the driver under the windows system platform.

[0064] SO type files, psc type files, and executable bin type files under the Linux system platform are PLC operation files. For example, Figure 4 As shown, under the Linux system platform, the generated execution program TS635.bin is imported into the hardware platform TS635-PLC, and the user program runtime library user.so and configuration file generated by the host computer software are imported into the hardware platform TS635-PLC, so as to load the execution program TS635.bin and the like on the hardware platform TS635-PLC. The relationship between the execution program TS635.bin and the application program and the driver program under the Linux system platform is: the execution program TS635.bin calls the application program, and the application program calls the driver program under the Linux system platform.

[0065] In this embodiment, the system platform includes a Windows platform and a Linux platform, and can realize PLC offline simulation compatible with the Windows platform and the Linux platform.

[0066] In some embodiments, the underlying driver includes an underlying driver for platform driving, an underlying driver for platform system, and an underlying driver for platform file management.

[0067] Establish a mapping relationship between the underlying driver corresponding to the platform driver, the underlying driver of the platform system, and the underlying driver of the platform file management and the interface layer.

[0068] In this embodiment, the underlying drivers include the underlying drivers of the platform driver, the underlying drivers of the platform system, and the underlying drivers of the platform file management. A mapping relationship between the underlying drivers corresponding to the system platform, the underlying drivers of the platform system, and the underlying drivers of the platform file management and the interface layer is established. According to the mapping relationship, the underlying drivers of the platform driver, the underlying drivers of the platform system, and the underlying drivers of the platform file management can be accurately called.

[0069] In some embodiments, the method further includes: writing a bottom-level driver corresponding to each system platform, for example, writing a bottom-level driver corresponding to a Windows system platform, and writing a bottom-level driver corresponding to a Linux system platform.

[0070] The underlying drivers can be written as needed to improve the diversity of the underlying drivers.

[0071] S103: establishing a calling relationship between the application layer and the underlying driver according to the mapping relationship to obtain source code;

[0072] The application layer calls the interface layer, and the interface layer calls the underlying driver. On the basis of establishing a mapping relationship between the underlying driver and the interface layer corresponding to each system platform, when the application layer calls the interface layer, it is equivalent to the application layer calling the underlying driver mapped by the interface layer, thereby establishing a calling relationship between the application layer and the underlying driver. After the application and the underlying driver establish a calling relationship, a complete source code is formed.

[0073] S104: Processing the source code to obtain an execution program; the execution program includes a simulation execution program and a programmable logic controller running program;

[0074] The source code is processed to obtain a simulation execution program and a programmable logic controller running program, namely a PLC running program.

[0075] In some embodiments, processing the source code to obtain an execution program includes:

[0076] Load the corresponding source files and header files according to the type of system platform;

[0077] Determine the corresponding compiler according to the type of system platform;

[0078] Compiling the source file and the header file by the determined compiler to obtain an assembly program;

[0079] Assembling the assembler to obtain a target file;

[0080] The target files are connected through a connector to obtain the execution program.

[0081] By loading corresponding source files and header files according to the type of system platform and determining a specific compiler to load source files and header files, source files and header files can be accurately processed to ensure that the generated source files and header files can run correctly on the system platform.

[0082] refer to Figure 5 As shown, the source code is first preprocessed. Preprocessing refers to loading the source files and header files of the actual system platform. The source files and header files are compiled. Among them, when compiling, the compiler is first determined in the Makefile file, i.e., the project management file, according to the type of the system platform, and then the source files and header files are compiled by the determined compiler to obtain an assembler, and the assembler is assembled to obtain a target file. The target file is the result of the assembly process. The target file is finally output as an execution program after being connected by a connector. Figure 5 In the .c file, the source file, the .h file is the header file, the .s file is the assembler, and the .o file is the target file.

[0083] In some embodiments, determining the corresponding compiler according to the type of the system platform includes:

[0084] If the system platform is Windows platform, determine the x86 gcc cross compiler;

[0085] If the system platform is Linux platform, determine the arm gcc cross compiler.

[0086] If the system platform is a Windows platform, the x86 gcc cross compiler is determined, and the source files and header files are compiled by the x86 gcc cross compiler. If the system platform is a Linux platform, the arm gcc cross compiler is determined, and the source files and header files are compiled by the armgcc cross compiler.

[0087] This embodiment determines specific compilers for different system platforms, which can ensure that the generated program or application can run correctly on the system platform.

[0088] S105: Load the simulation execution file by running the simulation execution program and execute corresponding logic;

[0089] S106: Load the programmable logic controller operation file through the programmable logic controller operation program and execute corresponding logic.

[0090] When the simulation execution program is running, the generated simulation run file is loaded and the related logic is executed, such as general instructions, logic instructions, encoder axes, etc. When the programmable logic controller running program, that is, the PLC running program is running, the generated PLC running file is loaded and the related logic is executed, such as through instructions, logic instructions, encoder axes, etc.

[0091] Taking the execution of the mov instruction function as an example, the offline simulation solution can be used to complete the mov instruction simulation in the scenario without a physical PLC. The specific implementation process includes: establishing a user program and writing the user program mov 10 DO. Click the offline simulation function to run the simulation program. Click the user program compile and download function. Click the PLC monitoring button to enable the M0 component. Figure 6 As shown, we can see that the mov instruction is executed and the value of D0 is 10.

[0092] To sum up, the offline simulation method provided by the present application generates a simulation run file and a programmable logic controller run file, and the simulation execution program obtained by processing the source code loads the simulation run file and executes the corresponding logic, and the programmable logic controller run program obtained by processing the source code loads the programmable logic controller run file and executes the corresponding logic, wherein a mapping relationship is established between the underlying driver and the interface layer corresponding to each system platform, and a calling relationship between the application layer and the underlying driver is established according to the mapping relationship to obtain the source code, so that the running process of the PLC application can be simulated, the logical function of the source code application can be restored to the greatest extent, and it can be compatible with multiple system platforms and has strong flexibility.

[0093] The present application also provides an offline simulation device, which can be referred to in correspondence with the method described above. Figure 7 , Figure 7 A schematic diagram of an offline simulation device provided in an embodiment of the present application, combined with Figure 7 As shown, the device comprises:

[0094] A generating module 10 is used to generate a simulation operation file and a programmable logic controller operation file;

[0095] The first establishing module 20 is used to establish a mapping relationship between the underlying driver and the interface layer corresponding to each system platform;

[0096] A second establishing module 30 is used to establish a calling relationship between the application layer and the bottom driver according to the mapping relationship to obtain a source code;

[0097] The processing module 40 is used to process the source code to obtain an execution program; the execution program includes a simulation execution program and a programmable logic controller running program;

[0098] A first running module 50, configured to load the simulation running file and execute corresponding logic by running the simulation execution program;

[0099] The second operation module 60 is used to load the programmable logic controller operation file through the programmable logic controller operation program and execute corresponding logic.

[0100] Based on the above embodiment, as a specific implementation, the processing module 40 includes:

[0101] A loading unit, used to load corresponding source files and header files according to the type of system platform;

[0102] A determination unit, used for determining a corresponding compiler according to a type of a system platform;

[0103] A compiling unit, used for compiling the source file and the header file by the determined compiler to obtain an assembly program;

[0104] An assembly unit, used for assembling the assembly program to obtain a target file;

[0105] The connection unit is used to connect the target file through a connector to obtain the execution program.

[0106] Based on the above embodiment, as a specific implementation method, the system platform includes a Windows platform and a Linux platform.

[0107] Based on the above embodiment, as a specific implementation manner, the determining unit includes:

[0108] The first determination subunit is used to determine the x86 gcc cross compiler if the system platform is a windows platform;

[0109] The second determining subunit is used to determine the arm gcc cross compiler if the system platform is a Linux platform.

[0110] Based on the above embodiment, as a specific implementation method, the bottom-level driver includes a bottom-level driver for platform driving, a bottom-level driver for platform system, and a bottom-level driver for platform file management.

[0111] Based on the above embodiment, as a specific implementation method, it also includes:

[0112] Write low-level drivers corresponding to each system platform.

[0113] Based on the above embodiment, as a specific implementation, the generation module 10 includes:

[0114] A programming unit, used to program user programs;

[0115] The gating unit is used to enable the compiler to compile the user program and generate the simulation operation file and the programmable logic controller program.

[0116] The offline simulation device provided in the present application generates a simulation running file and a programmable logic controller running file, and loads the simulation running file and executes the corresponding logic through the simulation execution program obtained by processing the source code, and loads the programmable logic controller running file and executes the corresponding logic through the programmable logic controller running program obtained by processing the source code, wherein a mapping relationship is established between the underlying driver and the interface layer corresponding to each system platform, and a calling relationship between the application layer and the underlying driver is established according to the mapping relationship to obtain the source code, so that the running process of the PLC application can be simulated, the logical function of the source code application can be restored to the greatest extent, and it can be compatible with multiple system platforms and has strong flexibility.

[0117] The present application also provides an electronic device, referring to Figure 8 As shown, the device includes a memory 1 and a processor 2 .

[0118] Memory 1, used for storing computer programs;

[0119] Processor 2 is used to execute the computer program to implement the following steps:

[0120] Generate simulation operation files and programmable logic controller operation files;

[0121] Establish a mapping relationship between the underlying driver and the interface layer corresponding to each system platform;

[0122] Establishing a calling relationship between the application layer and the underlying driver according to the mapping relationship to obtain source code;

[0123] Processing the source code to obtain an execution program; the execution program includes a simulation execution program and a programmable logic controller running program;

[0124] Load the simulation execution file by running the simulation execution program and execute corresponding logic;

[0125] The programmable logic controller operation file is loaded through the programmable logic controller operation program and the corresponding logic is executed.

[0126] For an introduction to the equipment provided in this application, please refer to the above method embodiments, and this application will not go into details here.

[0127] The electronic device provided in the present application generates a simulation running file and a programmable logic controller running file, and loads the simulation running file and executes the corresponding logic through the simulation execution program obtained by processing the source code, and loads the programmable logic controller running file and executes the corresponding logic through the programmable logic controller running program obtained by processing the source code, wherein a mapping relationship is established between the underlying driver and the interface layer corresponding to each system platform, and a calling relationship between the application layer and the underlying driver is established according to the mapping relationship to obtain the source code, so that the running process of the PLC application can be simulated, the logical function of the source code application can be restored to the greatest extent, and it can be compatible with multiple system platforms and has strong flexibility.

[0128] The present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the following steps can be implemented:

[0129] Generate simulation operation files and programmable logic controller operation files;

[0130] Establish a mapping relationship between the underlying driver and the interface layer corresponding to each system platform;

[0131] Establishing a calling relationship between the application layer and the underlying driver according to the mapping relationship to obtain source code;

[0132] Processing the source code to obtain an execution program; the execution program includes a simulation execution program and a programmable logic controller running program;

[0133] Load the simulation execution file by running the simulation execution program and execute corresponding logic;

[0134] The programmable logic controller operation file is loaded through the programmable logic controller operation program and the corresponding logic is executed.

[0135] The computer-readable storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

[0136] For an introduction to the computer-readable storage medium provided in this application, please refer to the above method embodiment, and this application will not go into details here.

[0137] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. For the devices, equipment, and computer-readable storage media disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method part description.

[0138] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0139] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0140] The above is a detailed introduction to the offline simulation method, device, electronic device and computer-readable storage medium provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application, and the description of the above embodiments is only used to help understand the method and core idea of ​​the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.

Claims

1. An off-line simulation method, characterized in that: include: Generate simulation operation files and programmable logic controller operation files; Establish a mapping relationship between the underlying driver and the interface layer corresponding to each system platform; Establishing a calling relationship between the application layer and the underlying driver according to the mapping relationship to obtain source code; Processing the source code to obtain an execution program; the execution program includes a simulation execution program and a programmable logic controller running program; Load the simulation execution file by running the simulation execution program and execute corresponding logic; The programmable logic controller operation file is loaded through the programmable logic controller operation program and the corresponding logic is executed.

2. The off-line simulation method according to claim 1, characterized in that: The processing of the source code to obtain an execution program includes: Load the corresponding source files and header files according to the type of system platform; Determine the corresponding compiler according to the type of system platform; Compiling the source file and the header file by the determined compiler to obtain an assembly program; Assembling the assembler to obtain a target file; The target files are connected through a connector to obtain the execution program.

3. The off-line simulation method according to claim 2, characterized in that: The system platform includes Windows platform and Linux platform.

4. The off-line simulation method according to claim 3, characterized in that: Determining the corresponding compiler according to the type of the system platform includes: If the system platform is Windows platform, determine the x86 gcc cross compiler; If the system platform is Linux platform, determine the arm gcc cross compiler.

5. The off-line simulation method according to claim 1, characterized in that: The bottom-level drivers include bottom-level drivers for platform driving, bottom-level drivers for platform systems, and bottom-level drivers for platform file management.

6. The off-line simulation method according to claim 1, characterized in that: Also includes: Write low-level drivers corresponding to each system platform.

7. The off-line simulation method according to claim 1, characterized in that: The generating of the simulation operation file and the programmable logic controller operation file comprises: Programming user programs; The compiler is selected to compile the user program to generate the simulation run file and the programmable logic controller program.

8. An off-line simulation device, characterized in that: include: A generation module, used for generating simulation operation files and programmable logic controller operation files; The first establishment module is used to establish a mapping relationship between the underlying driver and the interface layer corresponding to each system platform; A second establishing module is used to establish a calling relationship between the application layer and the underlying driver according to the mapping relationship to obtain a source code; A processing module, used for processing the source code to obtain an execution program; the execution program includes a simulation execution program and a programmable logic controller running program; A first running module, used for loading the simulation running file and executing corresponding logic by running the simulation execution program; The second operation module is used to load the programmable logic controller operation file through the programmable logic controller operation program and execute corresponding logic.

9. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the off-line simulation method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the off-line simulation method according to any one of claims 1 to 7 are implemented.