Clamp implementation method compatible with multi-model railway CIR program upgradingTechnical Field
The invention relates to unit program upgrading of railway CIR equipment, in particular to a clamp implementation method compatible with multi-model railway CIR program upgrading.
Background
The last two decades that railway CIR equipment has been put into use has passed, over which many models have been derived and still used in railway systems. Release of a new service standard and modification of existing software problems need to be compatible with all models of CIR equipment, so that multiple versions of a modified new program are released to the field, and maintenance personnel need to correspond to the CIR equipment with multiple models by using the programs with multiple versions one by one. Because the field equipment has large quantity of stored field equipment and complex environment, and the upgrading modes of all CIR equipment programs are different, the situations of mistaken upgrading and mistaken upgrading of the programs often occur, and the maintenance cost is increased, a clamp which can be compatible with the upgrading of the programs of the field CIR equipment with various models needs to be developed urgently, so that the operation of maintenance personnel is reduced, and the automatic upgrading is realized.
Disclosure of Invention
In order to solve the problems of wrong upgrading and wrong upgrading of programs of field multi-model CIR equipment, the invention provides a clamp implementation method compatible with multi-model CIR program upgrading, so as to realize the functions of version detection and identification, program upgrading, integrity verification and the like.
The technical scheme adopted by the invention is as follows: a method for realizing a clamp compatible with program upgrading of multi-model railway CIR equipment comprises the following steps: the clamp and the upgrading software running on the clamp perform compatibility upgrading on unit programs of various types of railway CIR equipment, the clamp is provided with standard network port peripheral equipment by using a Linux operating system, and the clamp is connected with the railway CIR equipment through a network cable; the upgrading software comprises a version detection and identification module, a program upgrading module and an integrity verification module which are used for sequentially carrying out data interaction, program files of all units of the railway CIR equipment of all types stored in the clamp are automatically identified through the version detection and identification process, the program upgrading process and the integrity verification process after the program upgrading process is finished.
The version detection identification process performs the following operations:
1-1, copying program files of all units of the railway CIR equipment of all models to different paths of the clamp system, and connecting the railway CIR equipment by using a network cable.
1-2, the version detection and identification module running in the upgrade software on the clamp sends various connection instructions to the railway CIR equipment in sequence and waits for the railway CIR equipment to respond to the instructions.
1-3, the version detection and identification module judges the type of the railway CIR equipment according to a response instruction returned by the railway CIR equipment.
1-4, the version detection and identification module sends a version inquiry request to a railway CIR equipment upgraded unit with a known model.
1-5, the upgraded unit of the railway CIR equipment with the known model returns version information to the version detection and identification module, and the version detection and identification module identifies the identity of the upgraded unit of the railway CIR equipment according to the returned version information.
1-6, the version detection and identification module sends the identity details of the unit to be upgraded of the railway CIR equipment to the program upgrading module through inter-thread communication.
The program upgrading process executes the following operations:
2-1, the program upgrading module indexes the path corresponding to the program file in the clamp system according to the identity details of the upgraded unit of the railway CIR equipment with the known model transmitted by the version detection and identification module.
2-2, reading the upgrading program file into the memory by the program upgrading module.
2-3, the program upgrading module sends an upgrading starting instruction to the upgraded unit of the railway CIR equipment with the known model.
2-4, the program upgrading module sends the upgrading program file to the upgraded unit of the railway CIR equipment with the known model in an FTP or custom mode;
and 2-5, the program upgrading module sends an upgrading completion instruction to the upgraded unit of the railway CIR equipment with the known model.
2-6, the program upgrading module sends an upgrading completion instruction to the integrity checking module through inter-thread communication.
The integrity check flow performs the following operations:
3-1, reading and calculating the md5 value of the indexed upgrading program file in the fixture system by the integrity checking module.
And 3-2, reading and calculating the md5 value of the upgrade program file of the upgraded unit of the railway CIR equipment with the known model by the integrity checking module.
And 3-3, judging whether the md5 value of the upgraded program file indexed in the clamp system is the same as the md5 value of the upgraded program file in the upgraded unit of the railway CIR equipment by the integrity checking module, wherein the same indicates that the upgrade is successful, and the different indicates that the upgrade is failed, and giving a prompt.
The beneficial effects of the invention are: the invention realizes the compatibility upgrade of unit programs of CIR equipment of various types of railways, simplifies the complex flow of the original upgrade mode, reduces the false rise and false rise probability and the maintenance cost, and realizes the intellectualization and automation of the CIR equipment program upgrade.
Drawings
FIG. 1 is a schematic block diagram of the system connection of the present invention;
FIG. 2 is a schematic diagram of a version detection identification process in an embodiment of the present invention;
FIG. 3 is a schematic diagram of a program upgrade process in an embodiment of the invention;
fig. 4 is a schematic diagram of an integrity check process in an embodiment of the invention.
Detailed Description
The invention is further illustrated by the following examples in conjunction with the accompanying drawings:
referring to fig. 1, a clamp compatible with program upgrading of multi-model railway CIR equipment and upgrading software running on the clamp perform compatibility upgrading on unit programs of the multi-model railway CIR equipment, the clamp is provided with standard network port peripheral equipment by using a Linux operating system, and the clamp is connected with the railway CIR equipment through a network cable; the upgrading software comprises a version detection and identification module, a program upgrading module and an integrity verification module which are used for sequentially carrying out data interaction, program files of all units of railway CIR equipment of all types stored in the clamp are automatically identified through a version detection and identification flow, a program upgrading flow and an integrity verification flow, and the program upgrading is carried out after the program files are identified and the integrity verification is carried out after the program upgrading is finished.
Referring to fig. 2, the version detection recognition procedure performs the following operations:
1-1, copying program files of all units of the CIR equipment of all types of railways to different paths of a clamp system, and connecting the CIR equipment of the railways by using a network cable.
And 1-2, the version detection and identification module running in the upgrading software on the clamp sequentially sends telnet, ping and ssh connection instructions to the railway CIR equipment and waits for the railway CIR equipment to respond to the instructions.
1-3, in the embodiment, the CIR equipment returns a telnet response instruction, and the version detection and identification module judges that the type of the CIR equipment is V2.0 according to the response instruction of the CIR equipment.
1-4, the version detection and identification module sends a version inquiry request to the upgraded unit of the railway CIRV2.0 equipment.
1-5, in this embodiment, the upgraded unit of the CIR 2.0 equipment of the railway returns Version information to the Version detection and identification module, wherein the Version information is one of Version _ ZK, version _ GPS and Version _ M450, the Version detection and identification module analyzes the Version information "Version _ ZK" according to the returned Version information, and identifies and determines that the upgraded unit of the CIR equipment of the railway is the master control unit of CIRV 2.0.
1-6, the version detection and identification module sends the identified identity details of the CIRV2.0 main control unit to the program upgrading module through inter-thread communication.
Referring to fig. 3, the program upgrade flow performs the following operations:
2-1, the program upgrading module indexes the path of the program file of the corresponding main control unit in the clamp system according to the identity details of the CIRV2.0 main control unit transmitted by the version detection and identification module.
2-2, reading the upgrading program file into the memory by the program upgrading module.
2-3, the program upgrading module sends an upgrading starting instruction to the CIRV2.0 main control unit.
2-4, in this embodiment, the CIRV2.0 main control unit supports FTP mode upgrade, so the program upgrade module sends an FTP connection instruction to the CIRV2.0 main control unit through two system functions of internet open and internet connect, after receiving a successful connection response of the CIRV2.0 main control unit, the program upgrade module sends an upgrade program file to the CIRV2.0 main control unit through the FtpPutFile system function, and after the sending is completed, the program upgrade module sends an FTP disconnection instruction to the CIRV2.0 main control unit through the internet closehandle system function.
2-5, the program upgrading module sends an upgrading completion instruction to the CIRV2.0 main control unit.
And 2-6, the program upgrading module sends an upgrading completion instruction to the integrity checking module through inter-thread communication.
Referring to fig. 4, the integrity check flow performs the following operations:
3-1, reading the indexed upgrading program file in the fixture system to a memory by the integrity checking module and calculating the md5 value of the upgrading program file.
3-2, the integrity check module reads an upgrade program file received by the CIRV2.0 main control unit through the FTP protocol to the memory and calculates the md5 value of the upgrade program file.
3-3, judging whether the md5 value of the upgraded program file indexed in the clamp system is the same as the md5 value of the upgraded program file in the CIRV2.0 main control unit by the integrity checking module, if so, indicating that the upgrade is successful, and if not, indicating that the upgrade is failed, and giving a prompt.
The integrity check module judges whether the md5 values of the two program files are the same, the md5 values are the same, which indicates that the upgrade program file has no lost data in the upgrade sending process, the program file is complete and effective, and an upgrade success prompt is given in the upgrade software; the different md5 values indicate that the program file may lose a data packet in the upgrading transmission process, the program file is incomplete and invalid, and an error prompt is given in the upgrading software.