Method for Preventing Locomotive from Wheel Slip and Skid Based on Control of Slip Rate FIELD OF THE TECHNOLOGY [0001] The present invention relates to a method for preventing locomotive from wheel slip and skid based on control of slip rate of the locomotive. The present invention belongs to the field of railway locomotive. BACKGROUND [0002] The wheel would slip and skid when traction force or braking force produced at wheel rim is larger than adhesive force between the wheel and track. The adhesive force is affected by numerous factors, such as conditions of wheel and track surface (pit, snow, water, oil and frost on the surface), conditions of the railway line (ramps, roadbeds, curves, and turnouts) and distribution of axle weight and so on. Additionally, the adhesive force is also affected by the driving mode of the driver and the locomotive speed. The wheel slip or skid of locomotive would make the wheel generate heat and be scratched, and even affects the safe operation of the locomotive, and thus is very harmful. The adhesion between the wheel and the track is a complex time-varying system with uncertainty. At present to fully take advantage of the adhesive force and effectively prevent locomotive from wheel slip and skid has become the development direction in the field of railway locomotive around the world. [0003] As to preventing the locomotive from wheel slip, a conventional solution is to install 3 differential relays on the main circuit of the locomotive, and each of the differential relays is connected with 2 traction motors. They constitute together a wheel slip signal detection device. When the locomotive works normally, the voltage on both ends of the differential relay connected with 2 traction motors is balanced. When one wheelset slips, potential difference between the traction motor connected with the wheelset and the traction motor connected with the other wheelset will change, charging the differential relay. And then the audible and visual alarm connected in series with normally open contact circuit of the differential relays is switched on and gives out wheel slip alarm. After the driver's discovering the alarm, he would manually activiate sanding and decreasing the power. As to this solution that each of differential relays is connected with two traction motors, due to back electromotive force at low speed and that at high speed are very different, the same voltage difference cannot indicate the rate of 1 change of the back electromotive force at different locomotive speed and different voltage class, and thus whether the traction motor is wheel slip and its severity cannot be judged accurately according to voltage difference. When the serious wheel slips are synchronous, the voltage on both ends of differential relay is very near to each other so that the relays will not act. In addition, if the driver places his foot on the pedal of sanding device and simultaneously decreases traction power of the locomotive after he sees the wheel slip indicating light shining, it would take time and also it is very difficult to accurately determine how much power is appropriate to decrease. [0004] An improved solution based on the above is to connect an intermediate relay in series to the normally open contact circuit of the differential relay and control the locomotive sanding and decreasing load automatically by it when the differential relay acts after charging. But as described above, on one hand the wheel slip cannot be judged accurately through the differential relay. On the other hand the intermediate relay controlled by the differential relay cannot automatically reduce the load in the accurate size and duration time, and thus it is difficult to achieve good control effect, and furthermore the solution cannot prejudge the wheel slip and relief it by sanding, and only can simultaneously control sanding and decreasing load, and therefore the use of the adhesive traction force cannot be fully taken advantage of. [0005] There is another conventional method for preventing the locomotive from wheel slip. In this solution current and rotation speed of each traction motor is checked all the time. Parameters such as speed difference, accelerated speed, accelerated speed differential signal, current difference, and the change rate of current are calculated in real time, and specific thresholds are set for these parameters. As long as the values of these parameters are larger or less than their corresponding thresholds, it is identified that the locomotive is wheel slip. According to the value of these parameters, the percentage of the load to be decreased and the duration time of load decrease can be calculated and thereby whether to sand and its execution time can be determined. At present, this solution is gradually becoming the prevailing technical solution for preventing the locomotive from wheel slip. But there are following disadvantages in its practical application. At different speed and different current of traction motor, there is a great difference in speed difference, accelerated speed of the wheels, accelerated speed differential signal, current difference, change rate of the current, percentage of the load decreasing and duration time of the load decreasing. Especially, for different stages of the wheel slip, even the feedback parameters are the same, there are still great difference in percentage of 2 the load decreasing, duration time of the load decreasing, and execution time of sanding. So it is almost impossible to get appropriate percentage of the load decreasing, duration time of the load decreasing, and execution time of sanding in real time, either the adhesive traction force cannot be made full use of or the wheel slip cannot be suppressed effectively. The software of the controlling system is very complex, too many controlling units are needed, and the units interact with each other, and generally, the regulation of a certain unit will bring influence on other units. It is difficult to test on site, in the test process that continuously controls the load decreasing and then loads again after ease of wheel slip, if the loading rate is too fast, the output torque of the traction motor would fluctuate, easily causing more serious wheel slip, and if the loading rate is too slow, the velocity of the locomotive will reduce quickly even stop on the ramp-way because of the insufficiencies of the traction force. When the traction motor of the locomotive is wheel slip, it is difficult to determine the time to decrease load, percentage of the load decreasing and duration time of the load decreasing according to rotation speed difference, accelerated speed of the wheels, accelerated speed differential signal, current difference, change rate of the current and so on, and thus it still cannot fully take advantage of the adhesive traction force. [0006] As to the wheel skid of the locomotive in braking, the speed difference, the decelerated speed and the slip ratio are the main parameters to be checked. As long as one parameter exceeds its corresponding threshold, the braking force is to be reduced and to sand immediately. For example, in the case of rheostatic braking, exciting current should be diminished at once, and in the case of gas braking, the braking cylinder should be exhausted greatly. The judgment of the wheel skid depends mostly on the empirical formula and empirical data, which is not suitable for different external conditions such as different conditions of wheeltrack surface, different states of route, different driving modes of the driver, different locomotive speeds. At the same time, it is hard to accurately determine the time when the locomotive begins wheel skid . If the time determined is advanced, braking force loss is too great, and the adhesive force between the wheel and track cannot be utilized sufficiently, and if the time determined is lagged, the wheel skid will occur and cause scratches on the wheel treads, being ineffective for preventing the locomotive from wheel skid. Even if the time determined is perfect, it is still hard to calculate the percentage and the duration time of braking force decreasing. It is thus difficult to make the best use of the braking force while preventing the locomotive from wheel skid. [0007] A further method for preventing the locomotive from wheel skid is the combined control via the parameters of the speed difference, the decelerated speed and the differential of 3 the decelerated speed. Instead of the method that reducing the braking force and sanding as long as one parameter exceeds its corresponding threshold, in this method, several parameters are observed at the same time and the state of the adhesion utilizing is assessed synthetically, and then judge the wheel skid of the locomotive. In this method, although the accuracy of the wheel skid time determined is increased, it is still hard to determine the percentage of braking force decrease and the duration time of braking force decrease and is difficult to obtain a reasonable and quantitative value. It is thus difficult to make the best use of the braking force while preventing the locomotive from wheel skid. [0008] Another solution for preventing the locomotive from wheel skid is to adopt a fuzzy control method. The fuzzy control method does not need to learn the details of the accurate mathematical model of the antiskid system. It sufficiently utilizes human experience, and imitates human thinking mode, and specifically, it formalizes human experience and introduces it into a fuzzy control process. The fuzzy control system is composed of five parts including an input/output interface, a fuzzy controller, an executing mechanism, sensors and controlled objects, wherein the fuzzy controller is the core of the fuzzy control system. Because the design of the fuzzy controller depends mostly on practical experience of personnel, the choice of controlled variables and the design of control rules should largely combine with practices. At the same time, for the rationality of the choice of the controlled variables and the effect of the control rules, a simulation analysis should be conducted by programming, or verification should be carried out by experiments after completing the design of the controller. Obviously the two methods all need to be verified by much time and many efforts, repeatedly experiment and analyse. That is, they need a complicated process and high workload. SUMMARY [0009] An object of the invention is to provide a method for preventing the locomotive from wheel slip and skid based on control of slip rate, to overcome shortcomings of the prior arts above. During the process of performing wheel slip control and wheel skid control, the value of slip rate can be accurately and reasonably controlled, and when the slip rate excesses a given limit, traction force (or brake force) of the locomotive will be reduced. In other words, by means of controlling the slip rate within a desired range, the adhesion and the adhesive force between wheels and tracks can be fully taken advantage of while the locomotive 4 is effectively prevented from wheel slip in traction or wheel skid in braking. [0010] The object is achieved by a method for preventing a locomotive from wheel slip and skid based on control of slip rate, the method includes the following steps: [0011] A. generating a traction force (or a braking force) control value VTout according to running state of the locomotive, where VTout is limited in a range: VTmin VTout < VTmax; [0012] B. detecting speed of the locomotive Vt; [0013] C. calculating the set value of slip rate VBref in traction or braking; [0014] D. detecting rotation speed of each axle VrlVrn, and calculating maximum rim velocity Vmax and minimum rim velocity Vmin; [0015] E. calculating feedback value of the slip rate VBfdb: if Vmax:3 km/h in traction, VBfdb = (Vmax - Vt)/Vmax, otherwise VBfdb = 0; if Vt b3km/h in braking, VBfdb = (Vt Vmin)/Vt, otherwise VBfdb = 0; [0016] F. calculating a slip rate control value VBout by inputting VBref and VBfdb into a PID closed-loop controller of traction (or a braking) slip rate VB, wherein VBout is limited in a range: Vmin(VBout(Vmax; and [0017] G. controlling the traction force (or the braking force) of the locomotive according to the minimum in the slip rate control value VBout and the traction force (or the braking force) control value VTout. [0018] The method according to the invention can prevent a locomotive from wheel slip and skid all-weather. Because of regulating effect of the PID controller, the system has the characteristics of quick adjustment when the deviation of the slip rate is large, continuous and steady adjustment when the deviation of the slip rate is small, and predictive adjustment when the slip rate changes rapidly, not only is which able to fully take advantage of the adhesive force, it can effectively prevent the locomotive from wheel slip in traction or wheel skid in braking. BRIEF DESCRIPTION OF THE DRAWINGS [0019] Fig. 1 is a schematic circuit diagram of the traction main circuit of an AC/DC diesel-electric locomotive according to Embodiment 1 of the invention. [0020] Fig. 2 is a schematic circuit diagram of the rheostatic braking main circuit of an AC/DC 5 diesel-electric locomotive according to Embodiment 1 of the invention. [0021] Fig. 3 is a flow chart of an interruption subprogram according to Embodiment 1 of the invention. [0022] Fig. 4 is a flow chart of an anti-wheel slip control subprogram according to Embodiment 1 of the invention. [0023] Fig. 5 is a flow chart of an anti-slip control subprogram according to Embodiment 1 of the invention. DETAILED DESCRIPTION [0024] The technical solutions of the invention will be described below clearly and comprehensively with reference to the accompanying drawings, so as to make objects, technical solutions and advantages of the embodiments of the invention clearer. Obviously, the embodiments are only a part of the embodiments of the invention. All other embodiments made by the skilled in the art without creative work, based on the embodiments presented herein, fall within the scope of the invention. [0025] Embodiment 1 [0026] This embodiment illustrates traction or braking force control of an AC/DC diesel-electric locomotive. [0027] Fig.1 shows a traction main circuit of an AC/DC diesel-electric locomotive according to this embodiment, where the exciting current of an exciter of a main-generator is controlled by a micro-computer, so as to control the direct voltage rectified by the main-generator. In Fig.1, Rlt is exciting resistance, D1 is fly-wheel diode, Q1 is field-effect transistor, EXC is exciting generator, ERC is exciting rectifier, MG is main-generator, MRC is main rectifier, M1~-M6 are traction motors, SD1~SD6 are rotation speed transducers of the traction motor, and SD is onboard radar detector for detecting the speed of the locomotive body. PWM signal outputted from the micro-computer is to control the exciting current flowing through the exciting coil of EXC by adjusting breakover duty cycle of Q1. Three-phase alternating current generated by EXC and rectified by ERC supplies power for the exciting winding of the main-generator. Three-phase alternating current generated by the main-generator and rectified by MRC main rectifier cubicle supplies power for the M 1~-M6. The direct voltage of the traction motor can be adjusted by adjusting pulse width of PWM signal and thereby the traction force of the traction 6 motor can be adjusted. So the value of pulse width of PWM signal is equivalent to the control value of the traction force. [0028] Fig. 2 shows a rheostatic braking main circuit of an AC/DC drive internal combustion engine locomotive according to an embodiment of the invention. In Fig. 2, traction motors M1~M6 each operates in the mode of generator with load Rz. Three-phase alternating current generated by a main-generator and rectified by MRC main rectifier cubicle supplies power for exciting windings connected in series with the traction motors M1~M6. SD1~SD6 are rotation peed transducers of the traction motor, and SD is onboard radar detector for detecting the speed of the locomotive body. The exciting current flowing through the exciting windings of the above six traction motors can be adjusted through adjusting pulse width of PWM signal, so as to achieve the adjustment of the braking current of the traction motor and further the adjustment of the braking force. So the value of pulse width of PWM signal is equivalent to the control value of the braking force of the traction motor. [0029] Refer to Fig. 3. This embodiment utilizes a timer 1 interruption to generate a timing interrupt of lOmS. First, in block 1.1, turn off the timer 1 interruption, and in block 1.2, clear the sign of the timer 1 interruption. Then enter block 1.3, judge whether the traction command is true: if it is true, enter block 1.4, execute an anti-wheel slip control subprogram; otherwise, enter block 1.5. In block 1.5, judge whether the braking command is true: if it is true, enter block 1.6, execute an anti-slip control subprogram; otherwise, enter block 1.7. In block 1.7, turn on the timer 1 interruption, to get ready for the next interruption. Then the interruption subprogram ends. [0030] Fig. 4 shows an anti-wheel slip control subprogram. In this subprogram, in block 2.1, calculate control value Vtout and limit it in the range between Vmin and Vmax; in block 2.2, detect locomotive speed Vt; in block 2.3 calculate set value of slip rate VBref; in block 2.4 detect rotation speed of each axle Vr1~Vrn; in block 2.5 calculate maximum rim velocity Vmax; in block 2.6 judge whether Vmax > 3.0 km/h: if it is yes, enter block 2.7 and calculate VBfdb =(Vmax - Vt)/Vmax, if it is no, enter block 2.8 and execute VBfdb = 0; in block 2.9 calculate VBout and limit it in the range between Vmin and Vmax; in block 2.10 take the minimum in VBout and VTout; and in block 2.11, calculate PWM pulse width control value. The anti-wheel slip control subprogram ends. [0031] Fig. 5 shows an anti-wheel skid control subprogram. In this subprogram, in block 3.1 calculate control value VTout, and limit it in the range between Vmin and Vmax; in block 3.2 7 detect locomotive speed Vt; in block 3.3 calculate set value of slip rate VBref; in block 3.4 detect rotation speed of each axl e Vr1~Vrn; in block 3.5 calculate minimum rim velocity Vmin; in block 3.6 judge whether Vt > 3.0 km/h: if it is yes, enter block 3.7 and calculate VBfdb=(Vt-Vmin)/Vt, if it is no, enter block 3.8 and execute VBfdb = 0; in block 3.9 calculate VBout and limit it in the range between Vmin and Vmax; in block 3.10 take the minimum in VBout and VTout; and in block 3.11 calculate PWM pulse width control value. The anti-slip control subprogram ends. [0032] Finally, it will be appreciated that the embodiments described above are only used to illustrate the technical solution of the invention rather than to limit it. Although the invention has been described in detail with reference to the above embodiments, the killed in the art should appreciate that the embodiments of the invention can be modified and the technical features therein can be replaced equivalently without departing from spirit and scope of the invention. 8