Computer Control Method For Multi-Locomotive Coupling of Railway Locomotives This application claims priority to Chinese Patent Application No. 201010598982.0, filed to the Chinese Patent Office on December 21, 2010, entitled "Computer Control Method for Multi-Locomotive Coupling of Railway Locomotives", which is incorporated herein by reference in its entirety. FIELD OF THE TECHNOLOGY [0001] The present invention relates to a field of railway locomotive control technology, and particularly to a computer control method for multi-locomotive coupling of railway locomotives. BACKGROUND [0002] Multi-locomotive coupling traction of railway locomotives is the most direct, simple and reliable method to improve railway transportation capacity. At an earlier time, drivers for coupled locomotives share information of each locomotive via a radio call, however, due to delay in the radio call and due to response differences of human operations, it is difficult to achieve an accurate synchronous control of coupled locomotives. Afterwards, a method of circuit coupling is adopted, that is, the control circuits of all the locomotives are connected via multiple physical wires. Such method needs a lot of physical wires to connect the control circuits of two locomotives, the efficiency is low while the cost is increased, and meanwhile, analog signals are easy to attenuate, thereby control precision is adversely affected and it is also difficult to achieve multi-locomotive coupling traction. [0003] With the development of modern computer technology, information transmission and direction synchronization in multi-locomotive coupling is achieved by adopting microcomputer serial communication buses in combination with direction synchronization circuits. The locomotive coupling cables adopt directly-connected serial communication buses and crossed direction synchronization circuits. Such method has very concise electrical circuits, however, information sharing between locomotives cannot be achieved because locomotive serial number (location) information cannot be identified and intelligent train formation cannot be conducted. Above all, because the head locomotive and tail locomotive cannot be identified, automatic impedance matching of microcomputer communication network cannot be achieved, and the 1 disadvantages of bus physical links will cause multi-locomotive communication unstable, and it is difficult for direction synchronization circuits to achieve multi-locomotive synchronization, and therefore, such method cannot achieve a multi-locomotive coupling. Then, a method of microcomputer network with additional auxiliary train formation circuits is adopted, prior to each train formation, it's necessary to set up relevant configuration on each locomotive via the auxiliary train formation circuits to distribute train formation serial numbers and codes, separately identify the locomotive train formation serial numbers via physical wire coupling, and thereby identify the location of locomotive in the train formation, and then start coupling network to conduct multi-locomotive communication and control. Such scheme cannot achieve intelligent automatic train formation and location identification of locomotives, and manual train formation must be conducted prior to each multi-locomotive coupling; it's necessary for the additional auxiliary train formation circuits and auxiliary coupling wires, so that not only the cost is increased, but also the number of coupled locomotives is restricted by the number of coupling wires, and meanwhile, it is difficult to deal with the faults during operation under coupling state. SUMMARY [0004] An aspect of the present invention provides a computer control method for multi-locomotive coupling of railway locomotives, aiming to solve the problem in the prior art, that is, due to unable to achieve intelligent automatic train formation and location identification of locomotives, not only the cost is increased but also the number of coupled locomotives is restricted by the number of coupling wires and, thus, difficult to be extended, and the computer control method of the present invention achieves multi-locomotive intelligent networking, automatic impedance matching and intelligent switching of network. [0005] According to an aspect of the present invention, the computer control method for multi-locomotive coupling of railway locomotives is carried out in the following steps: [0006] a. define a coupling port in a first cab of each locomotive as port A and a coupling port in a second cab of each locomotive as port B, port A and port B being connected to channel A and channel B of a network coupling module, respectively; [0007] b. if the first cab of the head locomotive faces forward, a key at port A is inserted, and define a port serial number parameter thereof as 1; if the second cab of the head locomotive faces forward, a key at port B is inserted, and define a port serial number parameter thereof as 0; [0008] c. define a next port serial number by orderly adding 1 to a previous serial number 2 parameter, after defining all the port serial numbers of a same module, send a request for defining port serial number parameters to a next module, if there is no response to the request, define the port of the locomotive sending the request for defining port serial number parameter as the port of a tail locomotive of a train formation, and send one-by-one backward the port serial number of the tail locomotive; [0009] d. send one-by-one forward a success mark of defining port serial number parameters of the train formation after confirming the port serial number of the tail locomotive by the head locomotive; [0010] e. if the port serial number of a port receiving the request for defining port serial number parameters is an odd number, it indicates that port A of the head locomotive faces forward and, if it is an even number, port B faces forward; [0011] f. take the above network as a redundant spare network; [0012] g. turn on control switches K for terminal resistances of the head locomotive and the tail locomotive to connect the terminal resistances R of the head locomotive and the tail locomotive respectively, and keep control switches K for terminal resistances of the remaining locomotives in off state to complete physical link configuration of a main coupling network; and [0013] h. during operation, the head locomotive sends a data request to each locomotive regularly, each locomotive responds to the request and sends relevant data, if one or more locomotives do not respond, judge the location thereof in the train formation, and command a neighboring normal locomotive to access one-by-one the non-responding locomotive via the redundant spare network and send relevant data via the main coupling network. [0014] The technical solutions of the present invention significantly simplify the electrical coupling circuit of the locomotives, provide intellective configuration capability for the main coupling network, improve the degree of the automation and intelligence of the coupled locomotives and enhance the capabilities of the train formation to share information and synchronously control, and further provide a redundant spare network so as to improve reliability and safety of the network. BRIEF DESCRIPTION OF THE DRAWINGS [0015] In order to describe the technical solutions in embodiments of the present invention or the prior art more clearly, accompanying drawings for the embodiments of the present invention or for the prior art are introduced below. Obviously, the accompanying drawings are only some 3 embodiments of the present invention and persons skilled in the art can obtain other drawings according to the accompanying drawings without any creative work. [0016] FIG.1 is a functional block diagram of hardware connection of the locomotive coupling according to an embodiment of the present invention; [0017] FIG.2 is a schematic diagram of train formation serial number initialization according to an embodiment of the present invention; [0018] FIG.3 is a block diagram of physical link configuration of the main coupling network according to an embodiment of the present invention; [0019] FIG.4 is a schematic diagram of communication mode selection according to an embodiment of the present invention; [0020] FIG.5 is a block diagram of the control flow of the network coupling module according to an embodiment of the present invention; [0021] FIG.6 is a block diagram of the program flow of the timing interruption service according to an embodiment of the present invention; [0022] FIG.7 is a block diagram of the program flow of the serial interruption service of the redundant spare network according to an embodiment of the present invention; and [0023] FIG.8 is a block diagram of the program flow of the interruption service of the main coupling network according to an embodiment of the present invention; DETAILED DESCRIPTION [0024] In order to make the objects, technical solutions and merits of the embodiments of the present invention clearer, a clear and complete description of the technical solutions in embodiments of the present invention is given with reference to the accompanying drawings. Apparently, the embodiments described herein are only a part rather than all of the embodiments of the present invention, and all other embodiments derived by persons skilled in the art from the embodiments of the present invention without making any creative effort shall fall within the protection scope of the present invention. [0025] As shown in FIG.1, the hardware circuit for the network coupling module of each locomotive is based on a CPU, channel A and channel B are two peripheral ports of the same CPU, the two channels adopt multi-serial communication mode in the periphery, or extend to at least three serial communication channels by adopting peripheral extending technology, and connect to the coupling port of the train via a bidirectional driving circuit. The connections 4 between the adjacent network coupling modules in the whole train formation are via coupling cables. [0026] The control flow of each module is as shown in FIG.5. The control process starts from Block 1: enter Block 2 to carry out the task of initialization and complete assignment and initialization to relevant register and variable configuration, enter Block 3 to enable the function of timing interruption service, enter Block 4 to enable the function of serial interruption service, enter Block 5 to enable the function of the main coupling network interruption service, and enter Block 6 to run circularly and wait for carrying out the process of interruption service. [0027] As shown in FIG.6, the timing interruption service process flow is as follows: [0028] 1. after entering Block 3.1, enter Block 3.2 to detect the coupling state, if there is a coupling success mark, enter the coupling success state, enter Block 3.11 to judge whether it is the head locomotive, if yes, enter Block 3.18; if no, enter Block 3.17 to enable the main coupling network and enter the coupling initialization state. [0029] 2. if there is no coupling success mark in Block 3.2, enter Block 3.3 to detect whether there is a driver's key inserted, if no, enter Block 3.24 and exit; if yes, enter Block 3.4 to initialize it as the head locomotive. [0030] 3. enter Block 3.5 to detect the insertion location of the driver's key, if the key is inserted at port A, enter Block 3.6 to define the port serial number parameter as 1; if the key is inserted at port B, enter Block 3.7 to define the port serial number parameter as 0. Enter Block 3.8 to define the next port serial number by orderly adding 1Ito the previous serial number parameter, after defining all the port serial numbers of the same module, send a request for defining port serial number parameters to the next level module. Enter Block 3.9 to wait for the response of the next one's defining success, if there is no response, enter Block 3.16 for a coupling failure, eliminate relevant information and exit; if there is a response, enter Block 3.10 to set a mark indicating that train formation is in process, as shown in FIG.2. [0031] 4. enter Block 3.12 to wait for the tail locomotive confirmation mark, if it is overtime, enter Block 3.16 for a coupling failure, eliminate relevant information and exit; if not, enter Block 3.13 to send a coupling success mark, enter Block 3.14 to connect the terminal resistances thereof (see FIG.3) and configure the terminal resistances of the main coupling network, enter Block 3.15 to enable the communication function of main coupling network. [0032] 5. enter Block 3.18 to judge whether a new locomotive is added, if yes, enter Block 3.23 to eliminate the coupling success mark and wait for coupling again; if no, enter Block 3.19 to 5 request one by one the data of each locomotive via main coupling network. [0033] 6. enter Block 3.20 to judge whether there is a respond tobthe data request of the main coupling network, if yes, enter Block 3.21 to process the data; if no, enter Block 3.22 to enable a redundant spare network communication and command a neighboring normal locomotive to access the non-responding locomotives one-by-one via the redundant spare network and send the relevant data via the main coupling network (see "abnormal" shown in FIG.4) [0034] As shown in FIG. 7, the program flow of the serial interruption service of the redundant spare network is as follows: [0035] 1. after entering Block 4.1, enter Block 4.2, according to the information type and the state of present locomotive, enter Block 4.3 for a coupling success and switch to a state of redundant spare network; or enter Block 4.4 for a state of under train formation; or enter Block 4.5 for a state of coupling initialization. [0036] 2. judge whether query data have been received when entering Block 4.3, enter Block 4.3.1 if the query data have been received, then enter Block 4.3.3 to judge whether the present locomotive is normal, if normal, enter Block 4.3.5 to send the received data and data of the present locomotive via the main coupling network; or else, enter Block 4.3.6 to send the additional present locomotive data to the previous one via the redundant spare network. Enter Block 4.3.2 to judge whether a data query request has been received, if the data query request has been received, enter Block 4.3.4 to judge whether the present locomotive has the maximum serial number among the abnormal locomotives, if yes, enter Block 4.3.7 to send the present locomotive data to the previous one; if no, enter Block 4.3.8 to send a data query request to the next one. [0037] 3. judge the type of the received information when entering Block 4.4. Enter Block 4.4.1, if a response mark of the tail locomotive is received, and then enter Block 4.4.4 to judge whether the present locomotive is the head locomotive, if yes, enter Block 4.4.5 to send a coupling success mark to the next one; if no, enter Block 4.4.7 to send a response mark of the tail locomotive to the previous one. Enter Block 4.4.2, if a coupling success mark is received in Block 4.4, and then enter Block 4.4.5 to send a coupling success mark to the next one, enter Block 4.4.8 to enable the main coupling network (see "normal" shown in FIGA). Enter Block 4.4.3, if a response to the port serial number parameter defining request is received in Block 4.4, and then enter Block 4.4.6 to wait for the tail locomotive response mark. [0038] 4. After entering Block 4.5, enter Block 4.5.1 to define port serial number parameter 6 after receiving port serial number parameter defining request, enter Block 4.5.2 to change the present locomotive state and respond to the previous one, enter Block 4.5.3 to send a defining request for the port serial number parameter to the next one and wait for a response. Enter Block 4.5.4, if there is a response, exit; if no, enter Block 4.5.5 to set the present locomotive as the tail locomotive, enter Block 4.5.6 to connect the terminal resistances thereof (see FIG.3) and configure the terminal resistances of the main coupling network of the tail locomotive, enter Block 4.5.7 to send a response mark of the tail locomotive. [0039] As shown in FIG. 8, the program flow of the interruption service of the main coupling network is as follows: [0040] 1. after entering Block 5.1, enter Block 5.2 to judge whether there is a coupling success mark, if yes, enter Block 5.3; if no, enter Block 5.7 and exit. [0041] 2. enter Block 5.3 to judge whether the present locomotive is the head locomotive, if yes, enter Block 5.4 to process the response information of other locomotives; if no, enter Block 5.5. [0042] 3. enter Block 5.5 to judge whether it is a request for querying the present locomotive, if yes, enter Block 5.6 to respond to this query request and send the present locomotive information; if no, enter Block 5.7 and exit. [0043] Finally, it should be noted that the above embodiments are merely provided for describing the technical solutions of the present invention, but not intended to limit the present invention. It should be understood by persons skilled in the art that although the present invention has been described in detail with reference to the foregoing embodiments, modifications can be made to the technical solutions described in the foregoing embodiments, or equivalent replacements can be made to some technical features in the technical solutions, as long as such modifications or replacements do not cause the essence of corresponding technical solutions to depart from the spirit and scope of the embodiments of the present invention. 7