Compilation Method, Device, Electronic Device and Storage Medium of Area Controller

By automatically obtaining and processing source files and configuration files for compilation, and using virtual machines to automatically compile the area controller, the problem of manual data entry and code is solved, and the compilation efficiency and automation are improved.

CN113553053BActive Publication Date: 2025-07-25CRSC URBAN RAIL TRANSIT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110720846.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-28
Publication Date
2025-07-25
Estimated Expiration
2041-06-28

AI Technical Summary

Technical Problem

In the prior art, the compilation process of regional controllers requires manual participation in the entry of data and code, and the degree of automation is low.

Method used

By obtaining the code and configuration files to be compiled from the server, using the virtual machine for automated compilation, including automatic control of the decompression, configuration and compilation process, using microservice architecture and command line operations, avoiding manual intervention.

Benefits of technology

The automatic compilation of regional controllers is realized, the level of automated compilation is improved, and the production cost and human resources requirements are reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113553053B_ABST
    Figure CN113553053B_ABST
Patent Text Reader

Abstract

The present invention provides a compilation method, device, electronic device and storage medium for a regional controller. The compilation method for the regional controller includes: obtaining code to be compiled from a server, decompressing the code to be compiled to obtain source files for compilation, and sending the source files for compilation to a first folder; obtaining a compilation configuration file from the server and sending the compilation configuration file to the first folder to obtain configured source files based on the source files for compilation and the compilation configuration file; sending the configured source files to a second folder corresponding to a virtual machine, and sending a compilation instruction to the virtual machine to control the virtual machine to compile the configured source files. The compilation method for the regional controller provided by the present invention can solve the defect that manual participation is required for data and code entry in the prior art for the regional controller, and achieve automatic compilation of the regional controller.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information technology, and in particular, to a compilation method, device, electronic device and storage medium for a zone controller. Background Art

[0002] CBTC (Communication Based Train Control) is the main product in the market. CBTC consists of various products such as on-board ATP (i.e., train automatic protection subsystem), on-board ATO (i.e., train automatic operation subsystem), ATS (i.e., train automatic supervision subsystem), ZC (i.e., zone controller), CI (i.e., computer interlocking subsystem), simulation test environment, etc. Each product needs to be equipped with corresponding auxiliary tools, including data configuration tools and automatic compilation tools.

[0003] ZC is a software product, and the automatic compilation of this product is not yet perfect. The collation of data and code directories for compilation and the compilation process need to be completed manually by personnel, with low automation. Summary of the Invention

[0004] The present invention provides a compilation method, device, electronic device and storage medium for a zone controller, so as to solve the defect in the prior art that the zone controller requires manual participation in inputting data and code, and realize the automatic compilation of the zone controller.

[0005] The present invention provides a compilation method for a zone controller, including:

[0006] Obtaining the code to be compiled from a server, decompressing the code to be compiled to obtain source files for compilation, and sending the source files for compilation to a first folder;

[0007] Obtaining a compilation configuration file from the server and sending the compilation configuration file to the first folder, so as to obtain configured source files based on the source files for compilation and the compilation configuration file;

[0008] Sending the configured source files to a second folder corresponding to a virtual machine, and sending a compilation instruction to the virtual machine to control the virtual machine to compile the configured source files.

[0009] According to the compilation method for a zone controller provided by the present invention, it further includes:

[0010] When the compilation of the configured source files is completed, storing the compilation result files corresponding to the configured source files in the second folder;

[0011] Before sending the compilation instruction to the virtual machine, send a cleaning instruction to the virtual machine to control the virtual machine to clean the previous compilation result file in the second folder.

[0012] According to the compilation method of the area controller provided by the present invention, obtaining the configured source file based on the compilation source file and the compilation configuration file includes:

[0013] Based on the compilation configuration file, replace the file with the same name as the compilation configuration file in the first folder to obtain the configured source file.

[0014] According to the compilation method of the area controller provided by the present invention, it further includes:

[0015] When the target machine is detected in the second folder, it is determined that the compilation of the configured source file is completed.

[0016] According to the compilation method of the area controller provided by the present invention, it further includes:

[0017] Before sending the configured source file to the second folder, send an emptying instruction to the virtual machine to control the virtual machine to empty the files in the second folder.

[0018] According to the compilation method of the area controller provided by the present invention, it further includes:

[0019] Before sending the emptying instruction to the virtual machine, run the.bat instruction to enter the cmd mode; wherein, both the compilation instruction and the emptying instruction are instructions in the cmd mode.

[0020] According to the compilation method of the area controller provided by the present invention, it further includes:

[0021] When the compilation of the configured source file is completed, package and send the compilation result file corresponding to the configured source file to the third folder;

[0022] When there is a previous compilation result file in the third folder, delete the previous compilation result file.

[0023] The present invention also provides a compilation device for an area controller, including:

[0024] A first acquisition module, configured to acquire the code to be compiled from a server, decompress the code to be compiled to obtain a compilation source file, and further send the compilation source file to the first folder;

[0025] A second acquisition module, configured to acquire a compilation configuration file from the server and send the compilation configuration file to the first folder, so as to obtain a configured source file based on the source file for compilation and the compilation configuration file;

[0026] A compilation module, configured to send the configured source file to a second folder corresponding to a virtual machine and send a compilation instruction to the virtual machine, so as to control the virtual machine to compile the configured source file.

[0027] The present invention further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the steps of the compilation method of the area controller as described in any one of the above are implemented.

[0028] The present invention further provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the compilation method of the area controller as described in any one of the above are implemented.

[0029] The compilation method, device, electronic device, and storage medium of the area controller provided by the present invention can automatically acquire the source file for compilation and the compilation configuration file, and then send the source file for compilation and the compilation configuration file to the virtual machine for compilation, so as to solve the defect that manual participation in data and code entry is required for the area controller in the prior art, realize the automatic compilation of the area controller, greatly improve the automation compilation level of the area controller software product of CBTC (Communication Based Train Control), improve the compilation efficiency, and reduce the production cost. Description of the Drawings

[0030] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0031] Figure 1 is a flowchart of the compilation method of the area controller provided by the present invention;

[0032] Figure 2 is a compilation principle diagram corresponding to the compilation method of the area controller provided by the present invention;

[0033] Figure 3 is a system architecture diagram corresponding to the compilation method of the area controller provided by the present invention;

[0034] Figure 4 is a schematic block diagram of a compilation device for a regional controller provided by the present invention;

[0035] Figure 5 is a schematic structural diagram of an electronic device provided by the present invention. Specific embodiments

[0036] To make the objectives, technical solutions and advantages of the present invention clearer, the technical solutions in the present invention will be clearly and completely described below with reference to the accompanying drawings in the present invention. Apparently, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present invention without making creative efforts shall fall within the protection scope of the present invention.

[0037] The following will be combined with Figures 1 - 5 describe the compilation method, device, electronic device and storage medium of the regional controller of the present invention.

[0038] The present invention provides a compilation method for a regional controller. The compilation method of the regional controller is implemented based on a microservices architecture. As Figure 1 shown, the compilation method of the regional controller includes:

[0039] Step 110: Obtain the code to be compiled from the server, decompress the code to be compiled to obtain the source file for compilation, and send the source file for compilation to the first folder.

[0040] It should be noted that obtaining the code to be compiled from the server may be downloading the code to be compiled from the server through an SVN tool or a Git tool. The code to be compiled is also called the basic code before compilation.

[0041] Further, the code to be compiled downloaded by the SVN tool is stored in a folder with the local directory "source file / basic code before compilation", and then the code file to be compiled in this folder is decompressed and copied to the folders with the directories "basic code for compilation / AB machine" and "basic code for compilation / C machine" according to the file format requirements.

[0042] The folder with the directory "basic code for compilation / AB machine" can store the source code for compilation corresponding to the AB machine of the regional controller (i.e., ZC) product; the folder with the directory "basic code for compilation / C machine" can store the source code for compilation corresponding to the ZC product.

[0043] It can be understood that the AB machine and the C machine of the regional controller product are two different versions of the regional controller, and their corresponding product functions are different.

[0044] After completing the above steps, copy the files in the folder with the directory "basic code for compilation / AB machine" to the folder with the directory "source files for compilation / AB machine", and / or copy the files in the folder with the directory "basic code for compilation / C machine / modules" to the folder with the directory "source files for compilation / C machine / modules". In this way, the path change of the source code for compilation is completed.

[0045] It should be noted that the first folder refers to the folder used to store the source files for compilation.

[0046] Among them, the number of the first folders can be one or more, that is, the first folder can contain multiple folders with different directory paths, such as the folders with the directories "source files for compilation / AB machine" and "source files for compilation / C machine / modules".

[0047] Step 120: Obtain the compilation configuration file from the server and send the compilation configuration file to the first folder, so as to obtain the configured source file based on the source file for compilation and the compilation configuration file.

[0048] It can be understood that through the SVN tool or Git tool, download the compilation configuration file from the server, store the downloaded compilation configuration file in the folder with the directory "source files for compilation / configuration data", and then copy the files in this folder to the folder with the directory "source files for compilation / AB machine" or copy them to the folder with the directory "source files for compilation / C machine / modules" to overwrite the previous source files for compilation.

[0049] The compilation configuration file corresponding to the AB machine is as follows:

[0050]

[0051] The compilation configuration file corresponding to the C machine is as follows:

[0052] Table of Contents Configuration Data Subdirectory Included Configuration Data Files C Machine\modules I_PSR RSSPIICfg.c

[0053] Step 130: Send the configured source file to the second folder corresponding to the virtual machine and send a compilation instruction to the virtual machine to control the virtual machine to compile the configured source file.

[0054] It can be understood that the virtual machine is the virtual machine for the compiled configured source file.

[0055] The compilation schematic diagram corresponding to the compilation method of the area controller provided by the present invention is as Figure 2 shown, and the system architecture diagram corresponding to the implementation of the compilation method of the area controller is as Figure 3 shown.

[0056] Figure 3 The system architecture shown is a microservices architecture. The construction of the microservices architecture is based on the Spring Cloud + JpaRepository architecture to complete the segmentation of the components of the compilation task, split the task compilation process, and design the program running logic in task compilation.

[0057] It can be understood that for the AB machine, the configured source file is copied from the folder with the directory "compilation source file / AB machine / src" to the folder with the directory "src\workspace\ZC80_1\src". It should be noted that the folder with the directory "src\workspace\ZC80_1\src" is also the second folder. Before copying, the folder "src\workspace\ZC80_1\src" is emptied.

[0058] Alternatively, for the C machine, the files in the folder with the directory "compilation source file / C machine / modules" are copied to the folder with the directory "src\workspace\dtsApp\modules". Before copying, the folder with the directory "src\workspace\dtsApp\modules" is emptied.

[0059] It should be noted that the compilation method of the area controller also includes: managing the server (specifically the compilation server). It includes functions such as server information creation, server information engineering, server information modification, and querying the server information list. The software installed on the server is as follows:

[0060] a) VxWorks cert 6.6.3.1, used to compile the AB machine of the area controller product.

[0061] b) VxWorks6.9, used to compile the C machine of the area controller product.

[0062] In some embodiments, the compilation method of the area controller also includes:

[0063] In the case where the compilation of the configured source file is completed, the compilation result file corresponding to the configured source file is stored in the second folder;

[0064] Before sending the compilation instruction to the virtual machine, a cleaning instruction is sent to the virtual machine to control the virtual machine to clean the previous compilation result file in the second folder.

[0065] In some embodiments, obtaining the configured source file based on the compilation source file and the compilation configuration file includes:

[0066] Based on the compilation configuration file, replace the file with the same name as the compilation configuration file in the first folder to obtain the configured source file.

[0067] In some embodiments, the compilation method of the area controller further includes:

[0068] When the target machine is detected in the second folder, it is determined that the compilation of the configured source file is completed. The target machine can be a target.bin file or a target.out file.

[0069] It can be understood that for the AB machine, in the cmd mode, send the "make all" command to execute the compilation of the area controller application AB machine program. After the compilation is completed, enter the "src\workspace\ZC80_1\cert" directory to check the generated target machines ZC_a.bin and ZC_b.bin. If they exist, the compilation is successful.

[0070] For the C machine, in the cmd mode, send the "make all" command to execute the compilation of the area controller application C machine program. After the compilation is completed, enter the "src\workspace\dtsApp\SIMNTdiab_SMP\C\Debug" directory to check the generated target machine C.out. If it exists, the compilation is successful.

[0071] Automatically control the file copying and compilation process through the command line. According to the different compilation steps of the AB machine and the C machine, use the command line operation to complete the entire compilation process, thus avoiding manual intervention and releasing the labor cost.

[0072] In some embodiments, the compilation method of the area controller further includes:

[0073] Before sending the configured source file to the second folder, send a clear instruction to the virtual machine to control the virtual machine to clear the files in the second folder.

[0074] It can be understood that for the AB machine, before compilation, send the input "make clean" command to perform the project cleaning operation. After the cleaning is completed, query whether the ZC_a.bin and ZC_b.bin files in the "src\workspace\ZC80_1\cert" directory (i.e., the second folder) no longer exist. If they do not exist, continue the compilation to ensure the independence of each compilation for each device.

[0075] For the C machine, send the "make clean" command before compilation to perform a project cleaning operation. After the cleaning is completed, check whether the C.out file in the directory "src\workspace\dtsApp\SIMNTdiab_SMP\C\Debug" no longer exists. If it does not exist, continue with the compilation to ensure the independence of compilation for each time and each device.

[0076] In some embodiments, the compilation method of the area controller further includes:

[0077] Before sending the clearing instruction to the virtual machine, run the.bat instruction to enter the cmd mode; wherein, both the compilation instruction and the clearing instruction are instructions in the cmd mode.

[0078] It can be understood that for the AB machine: enter the directory "C:\ZC Compilation Startup Program", and run the vxworks certenv.bat instruction to enter the cmd mode.

[0079] For the C machine: enter the directory "C:\ZC Compilation Startup Program", and run vxworks 6.9env(2).bat to enter the cmd mode.

[0080] In some embodiments, the compilation method of the area controller further includes:

[0081] When the compilation of the configured source file is completed, package and send the compilation result file corresponding to the configured source file to the third folder.

[0082] Furthermore, the compilation result file is stored in the directory of "Released Software / xxxZC xxxVA.B.C / Compilation Files". The compilation result can be packaged from this directory, and the name of the packaging software is "xxxZCxxx VA.B.C", and then downloaded and output to the local for viewing the compilation result.

[0083] When there is a previous compilation result file in the third folder, delete the previous compilation result file.

[0084] Furthermore, for the AB machine, download the target machine ZC_a.bin and ZC_b.bin to the folder with the directory of "Released Software / xxxZCxxxVA.B.C / Compilation Files", and delete the corresponding original compilation result file in the environment.

[0085] For the C machine, enter the directory "src\workspace\dtsApp\SIMNTdiab_SMP\C\Debug", copy the executable program C.out of the C machine target machine to the folder with the directory "Released Software / xxxZC xxxVA.B.C / Compiled Files", and delete the original compiled result files in the environment.

[0086] In addition, copy the AB machine folder, C machine folder, and DS6-80 folder in the directory of "Source Files / Configuration Data / Configuration Data in xxxZCxxx VA.B.C" downloaded by the SVN tool to "Released Software / xxxZC xxxVA.B.C".

[0087] In some embodiments, for the compilation method of the area controller provided by the present invention, a visual operation interface is designed from the dimension of engineering data management. The following are examples:

[0088] 1. An interface with a compilation server management function is set up. The compilation server management function includes: a compilation server management list function module, an add server function module, and a function module for the user to view the newly added server information after submission.

[0089] 2. An interface for filling in the automatic compilation task information of the area controller is set up.

[0090] 3. The following interface is set up: After filling in the automatic compilation task information of the area controller, view the automatic compilation task of the area controller in the task list.

[0091] 4. The following interface is set up: Check the tasks to be compiled and click the "Automatic Compilation" button below the list.

[0092] 5. The following interface is set up: A compilation process log will appear below the list to record the compilation status.

[0093] 6. The following interface is set up: For tasks with successful compilation, the property on the far right of the list is displayed as "Compilation Completed", and for tasks with failed compilation, the far right of the list is displayed as "Compilation Failed".

[0094] 7. The following interface is set up: Click the "Download File" button, a confirmation download information box will pop up on the interface. After clicking "OK", the compressed package of the compilation result file of the corresponding task will be automatically downloaded, named as the folder name of the configuration data SVN address.

[0095] In summary, the compilation method of the area controller provided by the present invention can automatically obtain the source files for compilation and the compilation configuration files, and then send the source files for compilation and the compilation configuration files to the virtual machine for compilation, greatly improving the automation level of the software products of the area controller of CBTC (Communication Based Train Control), improving the compilation efficiency, and reducing the production cost.

[0096] In addition, the compilation method of the area controller provided by the present invention also greatly improves the management ability of the automatic compilation of the software products of the area controller of CBTC, and provides a series of functions such as project management, data query, and export of configuration data files to the user in the form of page visualization.

[0097] The compilation method of the area controller provided by the present invention enables the software of the area controller of CBTC to automatically complete file copying and compilation work, further improving the automation level and reducing the labor cost. The compilation process of the area controller product is decomposed and encapsulated, and the compilation module is encapsulated based on the microservice architecture to complete the compilation of the automatic compilation task.

[0098] Next, the compilation device of the area controller provided by the present invention will be described. The compilation device of the area controller described below can be correspondingly referred to the compilation method of the area controller described above.

[0099] As Figure 4 shown, the compilation device 400 of the area controller includes: a first acquisition module 410, a second acquisition module 420, and a compilation module 430.

[0100] The first acquisition module 410 is used to acquire the code to be compiled from the server, decompress the code to be compiled to obtain the source files for compilation, and also send the source files for compilation to the first folder.

[0101] The second acquisition module 420 is used to acquire the compilation configuration file from the server and send the compilation configuration file to the first folder to obtain the configured source files based on the source files for compilation and the compilation configuration file.

[0102] The compilation module 430 is used to send the configured source files to the second folder corresponding to the virtual machine and send a compilation instruction to the virtual machine to control the virtual machine to compile the configured source files.

[0103] In some embodiments, the compilation device 400 of the area controller further includes: a compilation result storage module and a first cleaning module.

[0104] The compilation result storage module is used to store the compilation result file corresponding to the configured source file in the second folder when the compilation of the configured source file is completed.

[0105] The first cleaning module is used to send a cleaning instruction to the virtual machine before sending a compilation instruction to the virtual machine, so as to control the virtual machine to clean the previous compilation result file in the second folder.

[0106] In some embodiments, the second acquisition module 420 is further configured to replace the file with the same name as the compilation configuration file in the first folder based on the compilation configuration file to obtain the configured source file.

[0107] In some embodiments, the compilation device 400 of the area controller further includes: a compilation completion confirmation module.

[0108] The compilation completion confirmation module is used to determine that the compilation of the configured source file is completed when the target machine is detected in the second folder.

[0109] In some embodiments, the compilation device 400 of the area controller further includes: a second cleaning module.

[0110] The second cleaning module is used to send an emptying instruction to the virtual machine before sending the configured source file to the second folder, so as to control the virtual machine to empty the files in the second folder.

[0111] In some embodiments, the compilation device 400 of the area controller further includes: a mode construction module.

[0112] The mode construction module is used to run the.bat instruction to enter the cmd mode before sending the emptying instruction to the virtual machine; wherein, the compilation instruction and the emptying instruction are both instructions in the cmd mode.

[0113] In some embodiments, the compilation device 400 of the area controller further includes: a packaging and sending module and a third cleaning module.

[0114] The packaging and sending module is used to package and send the compilation result file corresponding to the configured source file to the third folder when the compilation of the configured source file is completed.

[0115] The third cleaning module is used to delete the previous compilation result file when there is a previous compilation result file in the third folder.

[0116] Next, the electronic device and storage medium provided by the present invention are described. The electronic device and storage medium described below can be mutually corresponding and referred to the compilation method of the area controller described above.

[0117] Figure 5Illustrates a schematic diagram of the physical structure of an electronic device, as Figure 5 shown. The electronic device may include: a processor 510, a communications interface 520, a memory 530, and a communication bus 540. Among them, the processor 510, the communications interface 520, and the memory 530 communicate with each other through the communication bus 540. The processor 510 may call the logical instructions in the memory 530 to execute the compilation method of the area controller. The method includes:

[0118] Step 110: Obtain the code to be compiled from the server, decompress the code to be compiled to obtain the source file for compilation, and also send the source file for compilation to the first folder;

[0119] Step 120: Obtain the compilation configuration file from the server and send the compilation configuration file to the first folder to obtain the configured source file based on the source file for compilation and the compilation configuration file;

[0120] Step 130: Send the configured source file to the second folder corresponding to the virtual machine and send a compilation instruction to the virtual machine to control the virtual machine to compile the configured source file.

[0121] In addition, when the logical instructions in the above-mentioned memory 530 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. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.

[0122] On the other hand, the present invention also provides a computer program product. The computer program product includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the compilation method of the area controller provided by the above-mentioned various methods. The method includes:

[0123] Step 110: Obtain the code to be compiled from the server, decompress the code to be compiled to obtain the source files for compilation, and also send the source files for compilation to the first folder;

[0124] Step 120: Obtain the compilation configuration file from the server, and send the compilation configuration file to the first folder to obtain the configured source files based on the source files for compilation and the compilation configuration file;

[0125] Step 130: Send the configured source files to the second folder corresponding to the virtual machine, and send a compilation instruction to the virtual machine to control the virtual machine to compile the configured source files.

[0126] On the other hand, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it is used to execute the compilation method of the area controller provided above. The method includes:

[0127] Step 110: Obtain the code to be compiled from the server, decompress the code to be compiled to obtain the source files for compilation, and also send the source files for compilation to the first folder;

[0128] Step 120: Obtain the compilation configuration file from the server, and send the compilation configuration file to the first folder to obtain the configured source files based on the source files for compilation and the compilation configuration file;

[0129] Step 130: Send the configured source files to the second folder corresponding to the virtual machine, and send a compilation instruction to the virtual machine to control the virtual machine to compile the configured source files.

[0130] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art can understand and implement it without creative efforts.

[0131] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the essence of the above technical solution, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0132] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A compilation method for an area controller, characterized in that, Implemented based on the microservice architecture. The microservice architecture is built, and the components of the compilation task are segmented based on the Spring Cloud + JpaRepository architecture. The task compilation process is split, and the program running logic during task compilation is designed, including: Obtain the code to be compiled from the server, decompress the code to be compiled to obtain the source files for compilation, and also send the source files for compilation to the first folder; Obtain the compilation configuration file from the server and send the compilation configuration file to the first folder to obtain the configured source files based on the source files for compilation and the compilation configuration file; Send the configured source files to the second folder corresponding to the virtual machine and send a compilation instruction to the virtual machine to control the virtual machine to compile the configured source files; When the compilation of the configured source files is completed, store the compilation result files corresponding to the configured source files in the second folder; Before sending the compilation instruction to the virtual machine, send a cleanup instruction to the virtual machine to control the virtual machine to clean up the previous compilation result files in the second folder; When the target machine is detected in the second folder, determine that the compilation of the configured source files is completed; Manage the server, including functions such as server information creation, server information project, server information modification, querying the server information list, etc. The software installed on the server is as follows: a) VxWorks cert 6.6.3.1, used to compile the AB machines of the regional controller products; b) VxWorks6.9, used to compile the C machines of the regional controller products; For the AB machines, in the cmd mode, send the "make all" command to execute the compilation of the AB machine program of the regional controller application. After the compilation is completed, enter the "src\workspace\ZC80_1\cert" directory to check the generated target machines ZC_a.bin and ZC_b.bin. If they exist, the compilation is successful; For the C machines, in the cmd mode, send the "make all" command to execute the compilation of the C machine program of the regional controller application. After the compilation is completed, enter the "src\workspace\dtsApp\SIMNTdiab_SMP\C\Debug" directory to check the generated target machine C.out. If it exists, the compilation is successful.

2. The compilation method of the area controller according to claim 1, characterized in that, The obtaining of the configured source files based on the source files for compilation and the compilation configuration file includes: Based on the compilation configuration file, replace the file with the same name as the compilation configuration file in the first folder to obtain the configured source files.

3. The compilation method of the area controller according to claim 1, characterized in that It also includes: Before sending the configured source files to the second folder, send a clear instruction to the virtual machine to control the virtual machine to clear the files in the second folder.

4. The compilation method of the area controller according to claim 3, characterized in that, It also includes: Before sending the clearing instruction to the virtual machine, run the.bat instruction to enter the cmd mode; wherein, both the compilation instruction and the clearing instruction are instructions in the cmd mode.

5. The compilation method of the area controller according to claim 1, characterized in that It further includes: When the compilation of the configured source file is completed, package and send the compilation result file corresponding to the configured source file to the third folder; When there is a previous compilation result file in the third folder, delete the previous compilation result file.

6. A compilation device for an area controller, characterized in that, Implemented based on the microservice architecture. The construction of the microservice architecture is completed based on the Spring Cloud + JpaRepository architecture to split the components of the compilation task, split the task compilation process, and design the program running logic during task compilation, including: A first acquisition module, which is used to obtain the code to be compiled from the server, decompress the code to be compiled to obtain the source file for compilation, and also send the source file for compilation to the first folder; A second acquisition module, which is used to obtain the compilation configuration file from the server and send the compilation configuration file to the first folder, so as to obtain the configured source file based on the source file for compilation and the compilation configuration file; A compilation module, which is used to send the configured source file to the second folder corresponding to the virtual machine, and send a compilation instruction to the virtual machine to control the virtual machine to compile the configured source file; When the compilation of the configured source file is completed, store the compilation result file corresponding to the configured source file in the second folder; Before sending the compilation instruction to the virtual machine, send a cleaning instruction to the virtual machine to control the virtual machine to clean the previous compilation result file in the second folder; When a target machine is detected in the second folder, it is determined that the compilation of the configured source file is completed; Manage the server, including functions such as server information creation, server information project, server information modification, querying the server information list, etc. The software installed on the server is as follows: a) VxWorks cert 6.6.3.1, used to compile the AB machines of the regional controller products; b) VxWorks6.9, used to compile the C machines of the regional controller products; For the AB machines, in the cmd mode, send the "make all" command to execute the compilation of the AB machine program of the regional controller application. After the compilation is completed, enter the "src\workspace\ZC80_1\cert" directory to check the generated target machines ZC_a.bin and ZC_b.bin. If they exist, the compilation is successful; For the C machines, in the cmd mode, send the "make all" command to execute the compilation of the C machine program of the regional controller application. After the compilation is completed, enter the "src\workspace\dtsApp\SIMNTdiab_SMP\C\Debug" directory to check the generated target machine C.out. If it exists, the compilation is successful.

7. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the compilation method of the area controller according to any one of claims 1 to 5.

8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the compilation method of the area controller according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Automatic quick generation system and method for UKey installation package

    CN104572237A

  • Automatic construction and uploading method and device for application program, computer equipment and storage medium

    CN110851135A