A tram control method, device, equipment and storage medium
By establishing a virtual rectangular coordinate system and using a preset algorithm to adjust the real-time power of the fuel cell, the dependence on city maps in tram energy management has been solved, achieving automated energy management and flexible scheduling.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- POWER CHINA KUNMING ENG CORP LTD
- Filing Date
- 2023-05-05
- Publication Date
- 2026-05-01
AI Technical Summary
Existing technologies require pre-loaded city and traffic maps to manage the energy of trams based on traffic lights between stations, which makes scheduling work cumbersome in different regions and cities, and the map styles and formats may differ.
By establishing a virtual Cartesian coordinate system, the real-time power and timestamps of the fuel cell and power battery are obtained, the work done is calculated, and the real-time power of the fuel cell is adjusted through a preset algorithm so that its work done is within a preset range, thereby achieving energy management.
Without the need for pre-loaded city and traffic maps, it can automatically adjust the operating status of fuel cells and power batteries according to the operation of trams, improving the efficiency and flexibility of energy management.
Smart Images

Figure CN117104085B_ABST
Abstract
Description
A method, device, equipment, and storage medium for controlling a tram. Technical Field
[0001] This invention relates to the field of transportation infrastructure technology, and in particular to a method, device, equipment, and storage medium for controlling a tram. Background Technology
[0002] A tram (also known as a streetcar or tram car) is a light rail transit vehicle that is electrically powered and runs on tracks. It is a type of public transportation, also called a streetcar or simply a tram, belonging to the light rail system. Trains typically have no more than five cars, but because they run on streets, they occupy road space. Additionally, some cable cars that run on urban tracks can also be considered a type of streetcar. Trams are electrically powered, so they do not emit exhaust fumes, making them a pollution-free and environmentally friendly mode of transportation. Trams have received significant attention from the transportation industry due to their features such as being catenary-free, having zero carbon dioxide and other harmful gas emissions, high energy efficiency, and low noise. Trams are also equipped with small fuel cell stacks and high-capacity power batteries.
[0003] Currently, energy management based on trams typically involves storing excess energy in the power battery for backup through a bidirectional DC / DC converter.
[0004] Chinese patent "202211259019.9 - A fuel cell tram energy management method based on pseudospectral and PSO algorithm" discloses the following steps: "Step 1: Establish a scenario environment model for the fuel cell tram; Step 2: Establish a simplified structural model and dynamic model of the fuel cell tram; Step 3: Optimize the speed trajectory of the fuel cell tram using the pseudospectral method; Step 4: Calculate the required power of the fuel cell tram based on the optimized speed; Step 5: Optimize the output power of the fuel cell and the power battery using the particle swarm optimization algorithm (PSO)." This patent considers the impact of traffic lights between two stations on the operating status of the fuel cell tram; it optimizes the speed trajectory of the fuel cell tram between traffic lights, enabling the fuel cell tram to pass through traffic light intersections without stopping, thereby allocating the output power of the fuel cell and the power battery to achieve energy-saving driving. However, this patent requires preloading city maps and traffic maps to manage energy-saving driving based on traffic lights between stations. For different regions and cities, or when it is necessary to schedule trams, the relevant maps need to be reloaded, and the style and format of the relevant maps may be different, which makes the initial debugging work of energy management cumbersome. Summary of the Invention
[0005] The main objective of this invention is to provide a method, device, equipment, and storage medium for controlling trams, in order to solve the problem that the existing technology requires preloading city maps and traffic maps to manage trams based on traffic lights between stations to achieve energy-saving driving. For different regions and cities, or when trams need to be scheduled, relevant maps need to be reloaded, and the styles and formats of the relevant maps may be different, which leads to cumbersome early debugging work for energy management.
[0006] To achieve the above objectives, the present invention provides the following technical solution:
[0007] A method for controlling a tram, the tram comprising a fuel cell and a power battery electrically connected in sequence, the method comprising:
[0008] A first virtual rectangular coordinate system is established with the first timestamp as the horizontal axis and the output power as the vertical axis;
[0009] At least two first real-time power values and at least two first timestamps of the fuel cell are acquired at first preset time intervals. At least two first coordinate points are generated with each first real-time power value as a first horizontal axis and each first timestamp as a first vertical axis. Each first coordinate point is then connected in sequence to form a first curve.
[0010] At least two second real-time power values of the power battery and at least two second timestamps of the fuel cell are acquired at second preset time intervals. At least two second coordinate points are generated with each second real-time power value as a second horizontal axis and each second timestamp as a second vertical axis. Each second coordinate point is then connected in sequence to form a second curve.
[0011] Output the first curve and the second curve respectively in the first virtual rectangular coordinate system;
[0012] The first work value and the second work value of the first curve and the second curve are obtained respectively according to the first preset algorithm;
[0013] The optimal value of the first real-time power is calculated according to the second preset algorithm so that the first work value and the second work value are within a preset multiplier range.
[0014] Adjust the first real-time power to the optimal value.
[0015] As a further improvement to this application, the first work value and the second work value of the first curve and the second curve are obtained respectively according to the first preset algorithm, including:
[0016] Obtain all first vertices or all first inflection points of the first curve, and divide the first curve into at least two first segmented curves using all first vertices or all first inflection points;
[0017] Fit a first piecewise function to each first piecewise curve;
[0018] The first area enclosed by each piecewise function and the horizontal axis is calculated by definite integral;
[0019] The first work value is obtained by adding up all the first areas;
[0020] Obtain all second vertices or all second inflection points of the second curve, and divide the second curve into at least two second segmented curves using all second vertices or all second inflection points;
[0021] Fit a second piecewise function to each second piecewise curve;
[0022] The second area enclosed by each second piecewise function and the horizontal axis is calculated by definite integral;
[0023] The second work value is obtained by adding up all the second areas.
[0024] As a further improvement to this application, the optimal value of the first real-time power is calculated according to a second preset algorithm so that the first work value and the second work value are within a preset multiplier range, including:
[0025] Based on the optimal value, at least two random solutions are assigned according to equation (1), and the result of all random solutions is defined as the multiplier interval;
[0026]
[0027] Among them, X i Let x be the set of all random solutions. i1 ,x i2 ,...,x in V represents each random solution, and N is the total number of random solutions; i v is the set of velocities for all random solutions. i1 ,v i2 ,...,v in The speed of each random solution;
[0028] Based on the same random solution, the position and velocity of each random solution are updated at preset time intervals according to equation (2):
[0029]
[0030] Among them, v id Let w·v be the velocity of the current random solution at step d. id-1 Let c1·random()·(p) be the velocity inertia of the current random solution at step d-1, ω be the inertia coefficient, and c1·random()·(p) best,i -x i ) represents the self-awareness of the current random solution, c2·random()·(g best,i -x i ) represents the social cognitive representation of the current random solution; c1 and c2 are both learning factors, random() is a random number within a preset range, and p best,i For the current random solution, the optimal solution obtained so far is g. best,i This is the optimal solution obtained for all random solutions;
[0031] Iterate a preset number of times according to equation (2) to update each p. best,i And each g best,i ;
[0032] Judge each p separately best,i Is the first difference compared to the previous iteration less than or equal to the first preset adaptation threshold?
[0033] If so, then determine each g separately. best,i Is the second difference compared to the previous iteration less than or equal to the second preset adaptation threshold?
[0034] If so, then it is determined that the aforementioned multiplier range has been obtained.
[0035] As a further improvement to this application, each p is updated by iterating a preset number of times according to equation (2). best,i and each g best,i ,include:
[0036] The inertia coefficient ω is optimized according to equation (3):
[0037]
[0038] Where, ω i ω is the optimized inertia coefficient. ini Let ω be the initial inertia coefficient. end G is the inertia coefficient after the maximum number of iterations. k This represents the maximum number of iterations.
[0039] As a further improvement to this application, the first real-time power is adjusted to the optimal value, and then the following steps are taken:
[0040] A second virtual rectangular coordinate system is established with the second timestamp as the horizontal axis and the first work value or the second work value as the vertical axis.
[0041] Obtain the timetable and route of the tram.
[0042] Using each second timestamp of the driving timetable as a third horizontal axis and the first or second work value corresponding to each second timestamp as a third vertical axis, at least two third coordinate points are formed, and each third coordinate point is connected in sequence to form a third curve;
[0043] Using each travel start timestamp in the travel timetable as a node, the third curve is divided into at least two curve segments through each node, and each curve segment is defined as the single travel habit curve of the tram.
[0044] In the second virtual rectangular coordinate system, the origin of the second virtual rectangular coordinate system is used as the starting point to superimpose and output each single driving habit curve;
[0045] Based on each second timestamp, obtain the maximum and minimum values of all single driving habit curves;
[0046] Get the difference between the current maximum and minimum values based on the same second timestamp;
[0047] Determine whether each difference exceeds a preset threshold;
[0048] If the number of differences exceeding the preset threshold reaches a preset number, the fuel cell or the power battery is determined to be abnormal.
[0049] As a further improvement to this application, if the number of differences exceeding the preset threshold reaches a preset number, it is determined that the fuel cell or the power battery is abnormal, and then the following steps are taken:
[0050] An abnormal signal is generated based on the determination that the fuel cell or the power battery is abnormal.
[0051] The abnormal signal is sent to an external receiver.
[0052] As a further improvement to this application, the optimal value of the first real-time power is calculated according to a second preset algorithm so that the first work value and the second work value are within a preset multiplier range, and then the process includes:
[0053] Send the optimal value to the external receiver.
[0054] To achieve the above objectives, the present invention also provides the following technical solution:
[0055] A control device for a tram, the control device being applied to the tram control method described above, the control device comprising:
[0056] The first virtual rectangular coordinate system establishment module is used to establish a first virtual rectangular coordinate system with the first timestamp as the horizontal axis and the output power as the vertical axis;
[0057] The first curve generation module is used to acquire at least two first real-time powers of the fuel cell and at least two first timestamps of the fuel cell at first preset time intervals, and generate at least two first coordinate points with each first real-time power as a first abscissa and each first timestamp as a first ordinate, and connect each first coordinate point in sequence to form a first curve.
[0058] The second curve generation module is used to acquire at least two second real-time power values of the power battery and at least two second timestamps of the fuel cell at second preset time intervals, and generate at least two second coordinate points with each second real-time power value as a second horizontal axis and each second timestamp as a second vertical axis, and connect each second coordinate point in sequence to form a second curve.
[0059] The first virtual rectangular coordinate system curve output module is used to output the first curve and the second curve respectively in the first virtual rectangular coordinate system;
[0060] The work value calculation module is used to obtain the first work value and the second work value of the first curve and the second curve respectively according to the first preset algorithm;
[0061] The optimal value calculation module is used to calculate the optimal value of the first real-time power according to the second preset algorithm, so that the first work value and the second work value are within a preset multiplier range.
[0062] An optimal value adjustment module is used to adjust the first real-time power to the optimal value.
[0063] To achieve the above objectives, the present invention also provides the following technical solution:
[0064] An electronic device includes a processor and a memory coupled to the processor, the memory storing program instructions executable by the processor; when the processor executes the program instructions stored in the memory, it implements the tram control method described above.
[0065] To achieve the above objectives, the present invention also provides the following technical solution:
[0066] A storage medium storing program instructions that, when executed by a processor, implement a tram control method as described above.
[0067] This application obtains the first and second work values of the fuel cell and power battery of a tram, respectively, and models and calculates these values. By defining a preset rate range, the first work value of the fuel cell completely covers the second work value of the power battery. The redundant portion of the first work value is supplied to the power battery for energy recovery. The optimal value for the fuel cell and power battery to achieve the preset rate range is then calculated, and the first real-time power is adjusted based on this optimal value. This application does not require pre-loaded city or traffic maps, nor does it rely on external factors such as traffic lights. The optimal value can be obtained solely through tram operation, and the preset rate range can be intervened to adjust the fuel cell and power battery to achieve different operating states. Attached Figure Description
[0068] Figure 1 is a flowchart illustrating the steps of an embodiment of the tram control method of this application;
[0069] Figure 2 is a schematic diagram of the structure of a control device for a tram according to an embodiment of this application;
[0070] Figure 3 is a schematic diagram of the structure of an embodiment of the electronic device of this application;
[0071] Figure 4 is a schematic diagram of the structure of a storage medium according to an embodiment of this application. Detailed Implementation
[0072] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0073] The terms "first," "second," and "third" in this application are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first," "second," or "third" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified. All directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of this application are only used to explain the relative positional relationships and movements between components in a specific orientation (as shown in the figures). If the specific orientation changes, the directional indications also change accordingly. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices.
[0074] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0075] As shown in Figure 1, this embodiment provides an example of a control method for a tram. In this embodiment, the tram includes a fuel cell and a power battery connected in sequence. The control method includes the following steps:
[0076] Step S1: Establish a first virtual rectangular coordinate system with the first timestamp as the horizontal axis and the output power as the vertical axis.
[0077] Step S2: At least two first real-time powers and at least two first timestamps of the fuel cell are acquired at first preset time intervals. At least two first coordinate points are generated with each first real-time power as a first abscissa and each first timestamp as a first ordinate. Each first coordinate point is then connected in sequence to form a first curve.
[0078] Step S3: At least two second real-time power values of the power battery and at least two second timestamps of the fuel cell are obtained at second preset time intervals. At least two second coordinate points are generated with each second real-time power value as a second horizontal axis and each second timestamp as a second vertical axis. Each second coordinate point is then connected in sequence to form a second curve.
[0079] Step S4: Output the first curve and the second curve in the first virtual rectangular coordinate system.
[0080] Step S5: Obtain the first work value and the second work value of the first curve and the second curve respectively according to the first preset algorithm.
[0081] Step S6: Calculate the optimal value of the first real-time power according to the second preset algorithm, so that the first work value and the second work value are within the preset multiplier range.
[0082] Step S7: Adjust the first real-time power to the optimal value.
[0083] Preferably, the timestamp can be based on natural minutes or natural hours as a scale to quantize the horizontal axis of the first virtual rectangular coordinate system, and the output power can be quantized in units such as watts / minute or kilowatts / hour that match the magnitude of the timestamp to quantize the vertical axis of the first virtual rectangular coordinate system.
[0084] Preferably, in this embodiment, the first work value is redundantly covered by the second work value, that is, a preset rate range is set. If about 30% of the redundant energy needs to be stored in the power battery, the preset rate range can be set to [1.4, 1.6].
[0085] Preferably, redundant energy is stored in the power battery via a fuel cell connected to the bus via a unidirectional DC / DC converter. The power battery, as an auxiliary energy source, is directly connected to the bus. Both, either together or individually, power the drive motor, achieving efficient energy utilization. Bidirectional energy flow is possible between the power battery and the DC / AC converter, allowing energy to be used for both drive motor operation and recovery of energy during train braking, which is then stored in the power battery. When the train stops at a station, the fuel cell can charge the power battery. The drive motor is a permanent magnet synchronous motor. The DC power from the fuel cell and power battery is converted to AC power by the DC / AC converter before driving the DC / DC converter. The main circuit of the DC / DC converter is a triple bidirectional DC / DC converter circuit topology. When fuel cell energy flows unidirectionally, the unidirectional function of the DC / DC converter is used; when power battery energy flows bidirectionally, the bidirectional function of the DC / DC converter is used. The triple bidirectional DC / DC converter circuit achieves efficient energy conversion, provides energy support to the DC bus, and stabilizes the bus voltage. A DC electronic load is used to simulate power demand changes.
[0086] Preferably, the control section first acquires voltage and current signals from voltage and current sensors, which are then transmitted to the signal acquisition and conditioning circuit. The conditioned signals are then sent to the TMS320F28335 DSP chip for processing, performing overvoltage and overcurrent protection and detection. During this process, the energy management platform maintains communication with each DSP chip using the RS485 protocol. The energy management platform reads the required voltage and current information from each DSP chip, performs calculations using its internal energy management algorithm, and sends the power allocation command value back to each DSP chip. The DSP chip then sends the control signal from the main circuit to the drive circuit, obtaining the final drive signal for the power switching MOSFET, thus achieving coordinated control.
[0087] Preferably, since H2 in the fuel cell reaches the catalyst surface through diffusion channels, H2 molecules separate into H2 molecules in the catalyst layer. + and e - H + After passing through the proton exchange membrane, the hydrogen and oxygen combine with oxygen at the cathode to form H2O. Electrons travel through the external circuit to the positive electrode. The reaction between hydrogen and oxygen on their respective catalyst surfaces requires energy; this energy loss is called activation loss. Furthermore, the proton exchange membrane and conductors provide resistance to the transport of protons and electrons, resulting in some ohmic loss in the voltage generated by the fuel cell. When the fuel cell outputs a high power, the current density is also high, and the gas concentration may be lower than the concentration required for the reaction. In this case, the fuel cell voltage will also decrease; this voltage loss is called concentration loss. Based on these losses, the fuel conversion rate of the fuel cell is approximately 50%. Without considering mechanical friction, the required fuel energy can be obtained by dividing the initial work value by the fuel conversion rate, facilitating subsequent refueling.
[0088] Furthermore, step S5 specifically includes the following steps:
[0089] Step S51: Obtain all first vertices or all first inflection points of the first curve, and divide the first curve into at least two first segmented curves using all first vertices or all first inflection points.
[0090] Step S52: Fit a first piecewise function to each first piecewise curve.
[0091] Step S53: Calculate the first area enclosed by each piecewise function and the horizontal axis using definite integrals.
[0092] Step S54: Add up all the first areas to get the first work value.
[0093] Step S55: Obtain all second vertices or all second inflection points of the second curve, and divide the second curve into at least two second segmented curves using all second vertices or all second inflection points.
[0094] Step S56: Fit a second piecewise function for each second piecewise curve.
[0095] Step S57: Calculate the second area enclosed by each second piecewise function and the horizontal axis using definite integrals.
[0096] Step S58: Add up all the second areas to obtain the second work value.
[0097] Furthermore, step S6 specifically includes the following steps:
[0098] Step S61: Based on the optimal value, assign at least two random solutions according to equation (1), and define the result of all random solutions as the multiplier interval.
[0099]
[0100] Among them, X i Let x be the set of all random solutions. i1 ,x i2 ,...,x in V represents each random solution, and N is the total number of random solutions; i v is the set of velocities for all random solutions. i1 ,v i2 ,...,v in The speeds for each random solution are respectively.
[0101] Step S62, based on the same random solution, update the position and velocity of each random solution at preset time intervals according to equation (2):
[0102]
[0103] Among them, v id Let w·v be the velocity of the current random solution at step d. id-1 Let c1·random()·(p) be the velocity inertia of the current random solution at step d-1, ω be the inertia coefficient, and c1·random()·(p) best,i -x i ) represents the self-awareness of the current random solution, c2·random()·(g best,i -x i ) represents the social cognitive representation of the current random solution; c1 and c2 are both learning factors, random() is a random number within a preset range, and p best,i For the current random solution, the optimal solution obtained so far is g. best,i This is the optimal solution obtained for all random solutions.
[0104] Preferably, random() has a preset value range of [0, 1], c1 has a value range of [0, 0.5], preferably 0.4; and c2 has a value range of [0.5, 1], preferably 0.8.
[0105] Step S63, iterate a preset number of times according to equation (2) to update each p best,i And each g best,i .
[0106] Step S64, determine each p best,i Compared to the first difference in the previous iteration, is it less than or equal to the first preset adaptation threshold? If each p best,i If the first difference compared to the previous iteration is less than or equal to the first preset adaptation threshold, then step S65 is executed.
[0107] Step S65, determine each g respectively best,i Compared to the second difference in the previous iteration, is it less than or equal to the second preset adaptation threshold? If each g best,i If the second difference compared to the previous iteration is less than or equal to the second preset adaptation threshold, then step S66 is executed.
[0108] Step S66: Determine that the multiplier range has been obtained.
[0109] Furthermore, step S63 specifically includes the following steps:
[0110] Step S631, optimize the inertia coefficient ω according to equation (3):
[0111]
[0112] Where, ω i ω is the optimized inertia coefficient. ini Let ω be the initial inertia coefficient. end G is the inertia coefficient after the maximum number of iterations. k This represents the maximum number of iterations.
[0113] Preferably, the above algorithm can be implemented using existing software such as GitHub and Python.
[0114] Furthermore, after step S7, the following steps are also included:
[0115] Step S101: Establish a second virtual rectangular coordinate system with the second timestamp as the horizontal axis and the first work value or the second work value as the vertical axis.
[0116] Step S102: Obtain the tram's timetable and route.
[0117] Step S103: Using each second timestamp of the driving timetable as a third horizontal axis and the first or second work value corresponding to each second timestamp as a third vertical axis, at least two third coordinate points are formed, and each third coordinate point is connected in sequence to form a third curve.
[0118] Step S104: Using each travel start timestamp in the travel timetable as a node, the third curve is divided into at least two curve segments through each node, and each curve segment is defined as the single travel habit curve of the tram.
[0119] Step S105: In the second virtual rectangular coordinate system, the curves of each single driving habit are superimposed and output, starting from the origin of the second virtual rectangular coordinate system.
[0120] Step S106: Obtain the maximum and minimum values of all single driving habit curves based on each second timestamp.
[0121] Step S107: Obtain the difference between the current maximum and minimum values based on the same second timestamp.
[0122] Step S108: Determine whether each difference exceeds a preset threshold. If the number of differences exceeding the preset threshold reaches a preset number, then proceed to step S109.
[0123] Step S109: Determine that the fuel cell or power battery is malfunctioning.
[0124] Preferably, in this embodiment, each difference is acquired and error is judged, and when a certain number of differences exceed the allowable error range, the battery is identified as abnormal.
[0125] Furthermore, after step S108, the following steps are also included:
[0126] Step S201: Generate an abnormal signal based on the determination that the fuel cell or power battery is abnormal.
[0127] Step S202: Send an abnormal signal to the external receiver.
[0128] Furthermore, after step S6, the following steps are also included:
[0129] Step S301: Send the optimal value to the external receiver.
[0130] This embodiment obtains the first and second work values of the fuel cell and power battery of the tram, respectively, and models and calculates these values. By defining a preset rate range, the first work value of the fuel cell completely covers the second work value of the power battery. The redundant portion of the first work value is supplied to the power battery for energy recovery. The optimal value for the fuel cell and power battery to achieve the preset rate range is then calculated, and the first real-time power is adjusted based on this optimal value. This application does not require pre-loaded city maps or traffic maps, and requires no external support such as traffic lights. The optimal value can be obtained simply through tram operation, and the preset rate range can be intervened to adjust the fuel cell and power battery to achieve different operating states. Furthermore, this application further optimizes the algorithm to reduce the number of iterations, making it easier to obtain the optimal value.
[0131] As shown in Figure 2, this embodiment provides an example of a control device for a tram. In this embodiment, the control device is applied to the control method of the tram as described in the above embodiment. The control device includes a first virtual rectangular coordinate system establishment module 1, a first curve generation module 2, a second curve generation module 3, a first virtual rectangular coordinate system curve output module 4, a work value calculation module 5, an optimal value calculation module 6, and an optimal value adjustment module 7.
[0132] The system comprises: a first virtual rectangular coordinate system establishment module 1, which establishes a first virtual rectangular coordinate system with a first timestamp as the horizontal axis and output power as the vertical axis; a first curve generation module 2, which acquires at least two first real-time power values and at least two first timestamps of the fuel cell at first preset time intervals, and generates at least two first coordinate points with each first real-time power value as a first horizontal axis and each first timestamp as a first vertical axis, and connects each first coordinate point sequentially to form a first curve; and a second curve generation module 3, which acquires at least two second real-time power values of the power battery and at least two second timestamps of the fuel cell at second .... Each second real-time power is used as a second horizontal axis, and each second timestamp is used as a second vertical axis to generate at least two second coordinate points, and each second coordinate point is connected in sequence to form a second curve; the first virtual rectangular coordinate system curve output module 4 is used to output the first curve and the second curve in the first virtual rectangular coordinate system respectively; the work value calculation module 5 is used to obtain the first work value and the second work value of the first curve and the second curve respectively according to the first preset algorithm; the optimal value calculation module 6 is used to calculate the optimal value of the first real-time power according to the second preset algorithm so that the first work value and the second work value are within the preset multiplier range; the optimal value adjustment module 7 is used to adjust the first real-time power to the optimal value.
[0133] Furthermore, the work value calculation module specifically includes a first work value calculation submodule, a second work value calculation submodule, a third work value calculation submodule, a fourth work value calculation submodule, a fifth work value calculation submodule, a sixth work value calculation submodule, a seventh work value calculation submodule, and an eighth work value calculation submodule.
[0134] The first work value calculation submodule is used to obtain all first vertices or all first inflection points of the first curve, and divide the first curve into at least two first piecewise curves using all first vertices or all first inflection points; the second work value calculation submodule is used to fit a first piecewise function to each first piecewise curve; the third work value calculation submodule is used to calculate the first area enclosed by each first piecewise function and the horizontal axis using definite integrals; the fourth work value calculation submodule is used to sum all the first areas to obtain the first work value; the fifth work value calculation submodule is used to obtain all second vertices or all second inflection points of the second curve, and divide the second curve into at least two second piecewise curves using all second vertices or all second inflection points; the sixth work value calculation submodule is used to fit a second piecewise function to each second piecewise curve; the seventh work value calculation submodule is used to calculate the second area enclosed by each second piecewise function and the horizontal axis using definite integrals; and the eighth work value calculation submodule is used to sum all the second areas to obtain the second work value.
[0135] Furthermore, the optimal value calculation module specifically includes a first optimal value calculation submodule, a second optimal value calculation submodule, a third optimal value calculation submodule, a fourth optimal value calculation submodule, a fifth optimal value calculation submodule, and a sixth optimal value calculation submodule.
[0136] Among them, the first optimal value calculation submodule is used to assign at least two random solutions based on the optimal value according to equation (1), and the result of all random solutions is defined as the multiplier interval.
[0137]
[0138] Among them, X i Let x be the set of all random solutions. i1 ,x i2 ,...,x in V represents each random solution, and N is the total number of random solutions; i v is the set of velocities for all random solutions. i1 ,v i2 ,...,v in The speeds for each random solution are respectively.
[0139] The second optimal value calculation submodule is used to update the position and velocity of each random solution according to equation (2) at preset time intervals based on the same random solution:
[0140]
[0141] Among them, v id Let w·v be the velocity of the current random solution at step d. id-1 Let c1·random()·(p) be the velocity inertia of the current random solution at step d-1, ω be the inertia coefficient, and c1·random()·(p) best,i -x i ) represents the self-awareness of the current random solution, c2·random()·(g best,i -x i ) represents the social cognitive representation of the current random solution; c1 and c2 are both learning factors, random() is a random number within a preset range, and p best,i For the current random solution, the optimal solution obtained so far is g. best,i This is the optimal solution obtained for all random solutions.
[0142] The third optimal value calculation submodule is used to iterate a preset number of times according to equation (2) to update each p. best,i And each g best,i .
[0143] The fourth optimal value calculation submodule is used to determine each p separately. best,i Compared to the first difference in the previous iteration, is it less than or equal to the first preset adaptation threshold? If each p best,i If the first difference compared to the previous iteration is less than or equal to the first preset adaptation threshold, then the fifth optimal value calculation submodule is executed.
[0144] The fifth optimal value calculation submodule is used to determine each g separately. best,i Compared to the second difference in the previous iteration, is it less than or equal to the second preset adaptation threshold? If each g best,i If the second difference compared to the previous iteration is less than or equal to the second preset adaptation threshold, then the sixth optimal value calculation submodule is executed.
[0145] The sixth optimal value calculation submodule is used to determine whether the multiplier range has been obtained.
[0146] Furthermore, the third optimal value calculation submodule is also connected to the seventh optimal value calculation submodule, which is used to optimize the inertia coefficient ω according to equation (3):
[0147]
[0148] Where, ωi ω is the optimized inertia coefficient. ini Let ω be the initial inertia coefficient. end G is the inertia coefficient after the maximum number of iterations. k This represents the maximum number of iterations.
[0149] Furthermore, the monitoring device also includes a second virtual rectangular coordinate system establishment module, a driving timetable and driving route acquisition module, a third curve generation module, a single driving habit curve definition module, a single driving habit curve superposition output module, a single driving habit curve extreme value acquisition module, a difference acquisition module, a difference number judgment module, a battery anomaly judgment module, and a communication module.
[0150] The system comprises the following modules: a second virtual rectangular coordinate system establishment module, which establishes a second virtual rectangular coordinate system with the second timestamp as the horizontal axis and the first or second work value as the vertical axis; a timetable and route acquisition module, which acquires the tram's timetable and route; a third curve generation module, which uses each second timestamp of the timetable as a third horizontal axis and the corresponding first or second work value as a third vertical axis to form at least two third coordinate points, and connects each third coordinate point to form a third curve; and a single-trip habit curve definition module, which uses each trip start timestamp of the timetable as a node, divides the third curve into at least two curve segments through each node, and defines each curve segment as a single trip of the tram. The system includes several modules: a habit curve module and a single-trip habit curve overlay output module. The single-trip habit curve overlay output module is used to overlay and output each single-trip habit curve in the second virtual rectangular coordinate system, starting from the origin of the second virtual rectangular coordinate system. The single-trip habit curve extreme value acquisition module is used to acquire the maximum and minimum values of all single-trip habit curves based on each second timestamp. The difference acquisition module is used to acquire the difference between the current maximum and minimum values based on the same second timestamp. The difference count judgment module is used to determine whether each difference exceeds a preset threshold. If the number of differences exceeding the preset threshold reaches a preset number, the battery anomaly judgment module is executed. The battery anomaly judgment module is used to determine whether the fuel cell or power battery is abnormal. The communication module is used to send an abnormal signal to an external receiver and to send the optimal value to an external receiver.
[0151] Preferably, this embodiment is a device embodiment, and its optimization and extension can be referred to the above method embodiment, and will not be repeated in this embodiment.
[0152] This embodiment obtains the first and second work values of the fuel cell and power battery of the tram, respectively, and models and calculates these values. By defining a preset rate range, the first work value of the fuel cell completely covers the second work value of the power battery. The redundant portion of the first work value is supplied to the power battery for energy recovery. The optimal value for the fuel cell and power battery to achieve the preset rate range is then calculated, and the first real-time power is adjusted based on this optimal value. This application does not require pre-loaded city maps or traffic maps, and requires no external support such as traffic lights. The optimal value can be obtained simply through tram operation, and the preset rate range can be intervened to adjust the fuel cell and power battery to achieve different operating states. Furthermore, this application further optimizes the algorithm to reduce the number of iterations, making it easier to obtain the optimal value.
[0153] Figure 3 is a schematic diagram of the structure of an electronic device according to an embodiment of this application. As shown in Figure 3, the electronic device 8 includes a processor 81 and a memory 82 coupled to the processor 81.
[0154] The memory 82 stores program instructions for implementing the tram control method of any of the above embodiments.
[0155] The processor 81 is used to execute program instructions stored in the memory 82 to control the tram.
[0156] The processor 81 can also be referred to as a CPU (Central Processing Unit). The processor 81 may be an integrated circuit chip with signal processing capabilities. The processor 81 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor can be a microprocessor or any conventional processor.
[0157] Further, Figure 4 is a schematic diagram of the structure of a storage medium according to an embodiment of this application. Referring to Figure 4, the storage medium 9 of this embodiment stores program instructions 91 capable of implementing all the above methods. These program instructions 91 can be stored in the storage medium in the form of a software product, including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks, or terminal devices such as computers, servers, mobile phones, and tablets.
[0158] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.
[0159] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated units described above can be implemented in hardware or as software functional units. The above are merely embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made based on the description and drawings of this application, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A method for controlling a tram, the tram comprising a fuel cell and a power battery connected in sequence, characterized in that, The control method includes: establishing a first virtual rectangular coordinate system with a first timestamp as the horizontal axis and output power as the vertical axis; acquiring at least two first real-time powers and at least two first timestamps of the fuel cell at first preset time intervals, and generating at least two first coordinate points with each first real-time power as a first horizontal axis and each first timestamp as a first vertical axis, and connecting each first coordinate point sequentially to form a first curve; acquiring at least two second real-time powers and at least two second timestamps of the power battery at second preset time intervals, and generating at least two second coordinate points with each second real-time power as a second horizontal axis and each second timestamp as a second vertical axis, and connecting each second coordinate point sequentially to form a second curve; outputting the first curve and the second curve in the first virtual rectangular coordinate system; acquiring the first work value and the second work value of the first curve and the second curve according to a first preset algorithm; and calculating the optimal first real-time power according to a second preset algorithm. The first work value and the second work value are adjusted to be within a preset multiplier range; the first real-time power is adjusted to the optimal value; the first work value and the second work value of the first curve and the second curve are obtained according to a first preset algorithm, including: obtaining all first vertices or all first inflection points of the first curve, and dividing the first curve into at least two first segmented curves through all first vertices or all first inflection points; fitting a first piecewise function to each first segmented curve; calculating the first area enclosed by each first piecewise function and the horizontal axis through definite integrals; and summing all the first areas to obtain the first work value; obtaining all second vertices or all second inflection points of the second curve, and dividing the second curve into at least two second segmented curves through all second vertices or all second inflection points; fitting a second piecewise function to each second segmented curve; calculating the second area enclosed by each second piecewise function and the horizontal axis through definite integrals; and summing all the second areas to obtain the second work value.
2. The control method according to claim 1, characterized in that, The optimal value of the first real-time power is calculated according to the second preset algorithm so that the first work value and the second work value are within the preset multiplier interval, including: assigning at least two random solutions based on the optimal value according to formula (1), and defining the result of all random solutions as the multiplier interval; (1); where, Let be the set of all random solutions. For each random solution, The number of all random solutions; The set of velocities for all random solutions. The velocity of each random solution is given; based on the same random solution, the position and velocity of each random solution are updated at preset time intervals according to equation (2): (2); where, For the current random solution in the th... Step speed, For the current random solution in the th... The velocity inertia of the step, The inertia coefficient, For the self-cognitive representation of the current random solution, This represents the social cognitive representation of the current random solution; and All are learning factors. A random number within a preset value range. This is the optimal solution obtained for the current random solution. For the optimal solution obtained from all random solutions, iterate according to equation (2) a preset number of times to update each... And each ; Determine each Compared to the first difference in the previous iteration, is it less than or equal to the first preset adaptation threshold? If so, then determine each... If the second difference compared to the previous iteration is less than or equal to the second preset adaptation threshold, then it is determined that the multiplier range has been obtained.
3. The control method according to claim 2, characterized in that, Iterate a preset number of times according to equation (2) to update each and each This includes: optimizing the inertia coefficient according to equation (3). : (3); among which, The optimized inertia coefficient, The initial inertia coefficient, The inertia coefficient after the maximum number of iterations. This represents the maximum number of iterations.
4. The control method according to claim 1, characterized in that, After adjusting the first real-time power to the optimal value, the process includes: establishing a second virtual rectangular coordinate system with the second timestamp as the horizontal axis and the first work value or the second work value as the vertical axis; acquiring the tram's timetable and route; forming at least two third coordinate points with each second timestamp of the timetable as a third horizontal axis and the corresponding first work value or second work value as a third vertical axis, and connecting each third coordinate point sequentially to form a third curve; and using each travel start timestamp of the timetable as a node, and then... The third curve is divided into at least two curve segments, and each curve segment is defined as the single-trip driving habit curve of the tram. Each single-trip driving habit curve is superimposed and output in the second virtual rectangular coordinate system with the origin of the second virtual rectangular coordinate system as the starting point. The maximum and minimum values of all single-trip driving habit curves are obtained based on each second timestamp. The difference between the current maximum and minimum values is obtained based on the same second timestamp. It is determined whether each difference exceeds a preset threshold. If the number of differences exceeding the preset threshold reaches a preset number, it is determined that the fuel cell or the power battery is abnormal.
5. The control method according to claim 4, characterized in that, If the number of differences exceeding the preset threshold reaches a preset number, the fuel cell or the power battery is determined to be abnormal. Then, the process includes: generating an abnormal signal based on the determination that the fuel cell or the power battery is abnormal; and sending the abnormal signal to an external receiving end.
6. The control method according to claim 1, characterized in that, The optimal value of the first real-time power is calculated according to the second preset algorithm so that the first work value and the second work value are within a preset multiplier range. Then, the optimal value is sent to an external receiving end.
7. A control device for a tram, said control device being applied to the control method for a tram as described in any one of claims 1 to 6, characterized in that, The control device includes: a first virtual rectangular coordinate system establishment module, used to establish a first virtual rectangular coordinate system with a first timestamp as the horizontal axis and output power as the vertical axis; a first curve generation module, used to acquire at least two first real-time powers of the fuel cell and at least two first timestamps of the fuel cell at first preset time intervals, and generate at least two first coordinate points with each first real-time power as a first horizontal axis and each first timestamp as a first vertical axis, and connect each first coordinate point in sequence to form a first curve; a second curve generation module, used to acquire at least two second real-time powers of the power battery and at least two second timestamps of the fuel cell at second preset time intervals, and generate at least two second coordinate points with each second real-time power as a second horizontal axis and each second timestamp as a second vertical axis, and connect each second coordinate point in sequence to form a second curve; a first virtual rectangular coordinate system curve output module, used to output the first curve and the second curve in the first virtual rectangular coordinate system respectively; and a work value calculation module, used to acquire the first work value and the second work value of the first curve and the second curve respectively according to a first preset algorithm. The system includes: an optimal value calculation module for calculating the optimal value of the first real-time power according to a second preset algorithm, so that the first work value and the second work value are within a preset multiplier range; an optimal value adjustment module for adjusting the first real-time power to the optimal value; and obtaining the first work value and the second work value of the first curve and the second curve respectively according to the first preset algorithm, including: obtaining all first vertices or all first inflection points of the first curve, and dividing the first curve into at least two first segmented curves through all first vertices or all first inflection points; fitting a first piecewise function to each first segmented curve; calculating the first area enclosed by each first piecewise function and the horizontal axis through definite integrals; and summing all the first areas to obtain the first work value; obtaining all second vertices or all second inflection points of the second curve, and dividing the second curve into at least two second segmented curves through all second vertices or all second inflection points; fitting a second piecewise function to each second segmented curve; calculating the second area enclosed by each second piecewise function and the horizontal axis through definite integrals; and summing all the second areas to obtain the second work value.
8. An electronic device, characterized in that, The system includes a processor and a memory coupled to the processor, the memory storing program instructions executable by the processor; when the processor executes the program instructions stored in the memory, it implements the tram control method as described in any one of claims 1 to 6.
9. A storage medium, characterized in that, The storage medium stores program instructions, which, when executed by a processor, implement the control method for the tram as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Fuel cell tramcar energy management method based on pseudo-spectrum and PSO algorithm
CN115782607A
Quasi-optimal energy management method for day running of fuel cell tramcar
CN110549914A
Fuel cell vehicle energy control method, storage medium and vehicle
CN111845461A