A new energy vehicle CAN bus topology construction method and system
By transforming the CAN bus network topology design of new energy vehicles into a multi-objective optimization problem, and using an evolutionary algorithm to generate the optimal controller-bus allocation relationship, the problems of chaotic controller layout and gateway overload are solved, thereby improving the stability and security of the system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- XUZHOU XUGONG NEW ENERGY VEHICLE CO LTD
- Filing Date
- 2026-04-17
- Publication Date
- 2026-07-14
AI Technical Summary
Existing CAN bus network designs for new energy vehicles suffer from problems such as chaotic controller layout, gateway overload, poor system stability and scalability. Furthermore, existing domain controller solutions have long development cycles, high costs, difficult maintenance, and poor security.
The network topology design is transformed into a multi-objective optimization problem. An evolutionary algorithm is used to generate and iteratively optimize a set of candidate topology schemes. The optimal controller-bus allocation relationship is generated based on engineering constraints. A bus quantity flag is introduced and a constraint repair mechanism is embedded to achieve rapid evaluation and efficient search.
It improves the stability and security of the CAN bus network for new energy vehicles, reduces development cycle and cost, and enhances system scalability and maintenance convenience.
Smart Images

Figure CN122394987A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method and system for constructing a CAN bus topology for new energy vehicles, belonging to the field of automotive bus technology. Background Technology
[0002] With the rapid development and increasing intelligence of new energy vehicles, the number of controllers far exceeds that of traditional vehicles, leading to greater information transmission demands and increasingly complex CAN bus network topologies. During development, as functional requirements increase, designers typically select suitable CAN lines from the existing ones to connect new controllers. Messages that cannot be communicated directly via CAN lines are forwarded through a gateway. This can cause problems such as unreasonable controller placement and gateway overload. Current technology focuses on domain controllers, reducing the number of controllers and message forwarding by integrating controller functions, thus eliminating the need for gateways. However, this is still in a transitional phase; integration solutions are not mature and have drawbacks such as long development cycles, high costs, high maintenance costs, and poor security. Specifically: First, traditional design methods rely heavily on engineers' personal experience and lack scientific quantitative basis. Designers often arbitrarily choose locations on the existing bus to connect new controllers. This manual allocation method easily leads to a chaotic controller layout, with controllers from different functional domains mixed on the same bus, increasing communication latency and system complexity.
[0003] Secondly, the lack of a global optimization perspective leads to critical components operating under overload. Because the packet forwarding volume cannot be accurately calculated, gateways often operate in an over-forwarding state, becoming network bottlenecks. Simultaneously, the load rates of various buses are severely uneven, with some buses approaching saturation while others are underutilized, affecting system stability and scalability.
[0004] Third, existing domain controller solutions have significant limitations. Although hardware integration can reduce the number of controllers, this approach has a long development cycle, high costs, and brings problems such as maintenance difficulties and security risks, making it less than ideal during the current technology transition period.
[0005] Therefore, in order to address the above problems, there is an urgent need for a method and system for constructing the CAN bus topology of new energy vehicles, thereby improving the stability and safety of new energy vehicles. Summary of the Invention
[0006] The purpose of this invention is to overcome the shortcomings of the prior art and provide a method and system for constructing the CAN bus topology of new energy vehicles. This method transforms network topology design into a multi-objective optimization problem, effectively solving technical problems such as experience dependence, uneven load and rigid architecture, and providing innovative ideas for automotive electronic and electrical architecture design.
[0007] To achieve the above objectives, the present invention is implemented using the following technical solution: In a first aspect, the present invention provides a method for constructing a CAN bus topology for new energy vehicles, including: Obtain controller information, message information, and engineering constraints of the CAN network; Based on the message information and using the engineering constraints as the screening criteria, a set of candidate topology schemes is generated and iteratively optimized through an evolutionary algorithm under the pre-built coding rules until the termination condition is met, and the optimal scheme is obtained. Output the controller-bus allocation relationship corresponding to the optimal solution; The encoding rules ensure that each candidate topology scheme includes bus allocation information for each controller and the number of buses used by the scheme.
[0008] Furthermore, under pre-built encoding rules, an evolutionary algorithm is used to generate and iteratively optimize a set of candidate topology schemes, including: An initial set of solutions is generated based on the engineering constraints, which serves as the current set of solutions. Each candidate topology solution in the initial set of solutions satisfies the engineering constraints. Perform evaluation and evolution steps on the current set of solutions to generate a new generation of solutions; The new generation of solutions is used as the new current solution set. The evaluation and evolution steps are repeated until the termination condition is met. The evaluation steps include: Calculate the comprehensive evaluation value of each candidate topology scheme in the current scheme set, wherein the comprehensive evaluation value is determined based at least on the gateway forwarding volume, the number of buses, and the average bus load rate; The evolutionary steps include: Based on the comprehensive evaluation value, a scheme is selected from the current scheme set, and crossover and mutation operations are performed on the selected candidate topology schemes to generate a new generation scheme set.
[0009] Furthermore, an initial set of solutions is generated based on the aforementioned engineering constraints, including: Calculate the minimum required number of buses based on the total number of messages and the single-bus load rate threshold; The number of buses used in the current scheme is determined between the minimum required number of buses and the upper limit of the number of buses; Assign bus numbers to each controller and generate candidate topology schemes; Verify whether the generated scheme meets the engineering constraints. If it does, retain it; otherwise, regenerate or increase the number of buses and try again until the upper limit of the number of buses is reached.
[0010] Furthermore, in the evaluation step, the gateway forwarding volume is calculated based on the transmission period of each message, the bus where the sending controller is located, and the bus where the receiving controller is located, to determine the total number of messages forwarded across the bus per second; the comprehensive evaluation value is obtained by weighted summation after normalizing the gateway forwarding volume, the number of buses, and the average bus load rate.
[0011] Furthermore, the crossover operation includes: Select two candidate topology schemes from the current scheme set as parent schemes; Exchange the bus allocation information of some controllers in the two parent schemes to generate two new candidate topology schemes as child schemes; Update the bus quantity information used by the child scheme based on the actual bus allocation of the controller in the child scheme; If there are controllers with binding constraints in the offspring scheme that are assigned to different buses, then adjust the bus assignment of all controllers in the binding group to the same bus number. Verify whether the child solution meets the engineering constraints. If it does, retain the child solution; otherwise, re-execute the crossover operation or directly retain the parent solution for the next generation.
[0012] Furthermore, the mutation operation includes: Select one candidate topology scheme from the current scheme set as the scheme to be mutated; Randomly select a controller in the scheme that does not have a binding constraint relationship, and modify its bus allocation information. The modification methods include adjusting it to another bus number that already exists in the scheme, or assigning it to a new bus number when the number of buses currently used by the scheme has not reached the upper limit. Update the bus count information used by the modified scheme; Check if any binding constraints have been broken in the mutated scheme; if so, perform consistency repair. Verify whether the modified solution meets the engineering constraints. If it does, retain the modified solution; otherwise, cancel the modification and retain the original solution.
[0013] Furthermore, the termination conditions include at least one of the following: the number of iterations reaches a preset value, the change in the comprehensive evaluation value of the optimal solution over multiple consecutive generations is less than a preset threshold, or the comprehensive evaluation value of the optimal solution exceeds a preset threshold.
[0014] Secondly, the present invention provides a CAN bus topology construction system for new energy vehicles, comprising: The first module is used to obtain controller information, message information, and engineering constraints of the CAN network. The second module is used to generate and iteratively optimize a set of candidate topology schemes based on the message information and the engineering constraints, under the pre-built coding rules, through an evolutionary algorithm until the termination condition is met, and to obtain the optimal scheme. The third module is used to output the controller-bus allocation relationship corresponding to the optimal solution; The encoding rules ensure that each candidate topology scheme includes bus allocation information for each controller and the number of buses used by the scheme.
[0015] Thirdly, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the methods described above.
[0016] Fourthly, the present invention provides a computer device, comprising: Memory, used to store computer programs / instructions; A processor for executing the computer program / instructions to implement the steps of any of the methods described above.
[0017] Fifthly, the present invention provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of any of the methods described above.
[0018] Compared with the prior art, the beneficial effects achieved by the present invention are as follows: This invention provides a method and system for constructing a CAN bus topology for new energy vehicles. By introducing a bus quantity identifier bit into the encoding, it enables rapid evaluation of the bus quantity; by embedding a constraint repair mechanism in the genetic operation, it ensures that the population always evolves within the feasible domain; and through multi-objective normalization and adjustable weights, it supports users in flexibly switching optimization priorities. Compared with manual design, this method can efficiently search for topology schemes that meet engineering requirements and have excellent overall performance in large-scale, multi-constraint scenarios. Attached Figure Description
[0019] Figure 1 This is a flowchart of a method for constructing a CAN bus topology for a new energy vehicle, provided by an embodiment of the present invention; Figure 2 This is a schematic diagram of the topology construction result of a CAN bus topology construction method for new energy vehicles provided in an embodiment of the present invention; Detailed Implementation
[0020] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the embodiments and specific features in the embodiments are detailed descriptions of the technical solution of the present application, rather than limitations thereof. In the absence of conflict, the embodiments and technical features in the embodiments can be combined with each other.
[0021] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship. Example 1
[0022] Figure 1 This is a flowchart of a method for constructing a CAN bus topology for a new energy vehicle according to Embodiment 1 of the present invention. The new energy vehicle CAN bus topology construction method provided in this embodiment can be applied to a terminal and can be executed by a new energy vehicle CAN bus topology construction system. This system can be implemented by software and / or hardware and can be integrated into the terminal, such as any smartphone, tablet, or computer device with communication capabilities. See also... Figure 1 The method implemented in this way specifically includes the following steps: Step S1. Obtain the controller information, message information, and engineering constraints of the CAN network; Step S2. Based on the message information and using the engineering constraints as the screening criteria, a set of candidate topology schemes is generated and iteratively optimized through an evolutionary algorithm under the pre-constructed coding rules until the termination condition is met, and the optimal scheme is obtained. Step S3. Output the controller-bus allocation relationship corresponding to the optimal solution; The encoding rules ensure that each candidate topology scheme includes bus allocation information for each controller and the number of buses used by the scheme.
[0023] In the above technical solution, the controller information includes the names or identifiers of all electronic control units in the network, and the total number of controllers is N.
[0024] The message information includes the name, identifier ID, transmission type (period / event), period time (ms), data length (bytes), sending controller name, and a list of receiving controller names for each message.
[0025] The engineering constraints include a single bus load rate threshold, a gateway maximum forwarding threshold, and a maximum number of buses set by the user; in this embodiment, the single bus load rate threshold is 35%, and the maximum number of buses is 5. In this embodiment, a genetic algorithm is used to iteratively optimize the scheme set. The genetic algorithm first needs to design chromosome encoding. The encoding length is equal to the total number of vehicle controllers, i.e., N set above. Each gene bit corresponds to one controller. The gene value is a non-negative integer, representing the bus number that the controller is connected to. A gene value of 1 indicates that the controller is connected to bus number 1, and 0 is an invalid encoding. During initialization, an extra bus quantity flag bit is added, i.e., one bit is added to the end of the encoding to record the total number of buses corresponding to the current chromosome. The flag bit 4 indicates that the current topology uses 4 buses, which is used to quickly calculate the minimum bus quantity target.
[0026] If there is a controller binding constraint, such as controllers A and B must belong to the same bus, then the corresponding gene bit values are forced to be the same during encoding, and this constraint is maintained during initialization and mutation. The method for constructing a CAN bus topology for new energy vehicles provided in this embodiment involves the following steps in its application process: In step S2, a set of candidate topology schemes is generated and iteratively optimized using an evolutionary algorithm under pre-constructed encoding rules, including: Step S2.1: Generate an initial set of solutions based on the engineering constraints, which serves as the current set of solutions. Each candidate topology solution in the initial set of solutions satisfies the engineering constraints. Step S2.2: Perform evaluation and evolution steps on the current set of solutions to generate a new generation of solutions; Step S2.3: Take the new generation of solution set as the new current solution set, and repeat the evaluation step and evolution step until the termination condition is met; The evaluation steps include: Calculate the comprehensive evaluation value of each candidate topology scheme in the current scheme set, wherein the comprehensive evaluation value is determined based at least on the gateway forwarding volume, the number of buses, and the average bus load rate; The evolutionary steps include: Based on the comprehensive evaluation value, a scheme is selected from the current scheme set, and crossover and mutation operations are performed on the selected candidate topology schemes to generate a new generation scheme set.
[0027] In step S2.1, an initial set of solutions is generated based on the engineering constraints, including: Calculate the minimum required number of buses based on the total number of messages and the single-bus load rate threshold; The number of buses used in the current scheme is determined between the minimum required number of buses and the upper limit of the number of buses; Assign bus numbers to each controller and generate candidate topology schemes; Verify whether the generated scheme meets the engineering constraints. If it does, retain it; otherwise, regenerate or increase the number of buses and try again until the upper limit of the number of buses is reached.
[0028] In the above technical solution, when generating the initial scheme set, the population size is set to P. In this embodiment, P=50, which is determined by the number of controllers, P=30~50.
[0029] For each individual in the population, the number of buses K needs to be determined first. First, the load of all messages is summed to obtain the total bus load rate. This is divided by the single-bus load rate threshold and rounded up to obtain the minimum required number of buses. Then, an integer between the minimum required number of buses and the preset upper limit of the number of buses is randomly selected as the number of buses K for that individual.
[0030] Under the premise of satisfying controller binding constraints, N controllers are randomly assigned to K buses. To avoid the initial solution being too concentrated, diversity rules can be set, such as the number of controllers on a single bus not exceeding 30% of the total number.
[0031] Based on the above allocation results, calculate the actual load rate and gateway forwarding volume for each bus. If all indicators meet the constraints, accept the individual; otherwise, regenerate. If retries exceed 100 and still fail, increment K by 1 and retry until the bus limit is reached. If no feasible solution is found, indicate initialization failure. The actual load rate must include local packets and cross-bus forwarded packets.
[0032] In step S2.2, during the evaluation step, the gateway forwarding volume is calculated based on the transmission period of each message, the bus where the sending controller is located, and the bus where the receiving controller is located, to determine the total number of messages forwarded across the bus per second. The comprehensive evaluation value is obtained by weighted summation after normalizing the gateway forwarding volume, the number of buses, and the average bus load rate. The normalization formula and the comprehensive fitness calculation formula are as follows: ; fitness =
[0033] in, This represents the normalized minimum forwarding capacity of the gateway. This represents the maximum value of the gateway forwarding volume in the scheme to be evaluated. This represents the minimum gateway forwarding volume in the scheme to be evaluated. This represents the actual forwarding volume at the gateway for each solution. And so on. This represents the minimum number of buses after normalization. The normalized minimum average bus load rate is calculated in the same way. For weight values, .
[0034] In step S2.2, the crossover operation includes: Select two candidate topology schemes from the current scheme set as parent schemes; Exchange the bus allocation information of some controllers in the two parent schemes to generate two new candidate topology schemes as child schemes; Update the bus quantity information used by the child scheme based on the actual bus allocation of the controller in the child scheme; If there are controllers with binding constraints in the offspring scheme that are assigned to different buses, then adjust the bus assignment of all controllers in the binding group to the same bus number. Verify whether the child solution meets the engineering constraints. If it does, retain the child solution; otherwise, re-execute the crossover operation or directly retain the parent solution to enter the next generation. In the above technical solution, for the remaining individuals, they are paired up for crossover with a crossover probability of 0.7. The crossover probability is set to 0.6~0.8, with 0.6 when the number of controllers is small and 0.8 when the number is large.
[0035] Randomly select a crossover point, exchange the gene segments after the crossover point of the two parent chromosomes, and generate two offspring individuals. The position of the crossover point ranges from 1 to N.
[0036] Based on the actual values of the first N genes of the offspring individuals, the bus count flag at the end of the offspring is recounted and updated.
[0037] In step S2.2, the mutation operation includes: Select one candidate topology scheme from the current scheme set as the scheme to be mutated; Randomly select a controller in the scheme that does not have a binding constraint relationship, and modify its bus allocation information. The modification methods include adjusting it to another bus number that already exists in the scheme, or assigning it to a new bus number when the number of buses currently used by the scheme has not reached the upper limit. Update the bus count information used by the modified scheme; Check if any binding constraints have been broken in the mutated scheme; if so, perform consistency repair. Verify whether the modified solution meets the engineering constraints. If it does, retain the modified solution; otherwise, cancel the modification and retain the original solution.
[0038] In the above technical solution, the selection operation adopts the roulette wheel selection method, randomly selecting parent individuals based on their fitness percentage. Simultaneously, an elite preservation strategy is employed, directly replicating the top 10% of the most fit individuals in the current population to the next generation. For each individual, including those generated by elite retention and crossover, mutation is performed with a mutation probability of 0.02. The mutation probability is set to 0.01~0.03, with 0.01 for larger populations and 0.03 for smaller populations.
[0039] Randomly select a gene locus that is not bound by any binding constraints.
[0040] Modify the value of the gene locus to another random bus number that already exists in the current individual; or, if the number of buses currently in use has not reached the upper limit, modify it to a completely new bus number, which is the current maximum number + 1.
[0041] The termination conditions include at least one of the following: the number of iterations reaches a preset value, the change in the comprehensive evaluation value of the optimal solution over multiple consecutive generations is less than a preset threshold, or the comprehensive evaluation value of the optimal solution exceeds a preset threshold.
[0042] In summary, this embodiment achieves rapid evaluation of the number of buses by introducing a bus quantity flag in the encoding; it ensures that the population always evolves within the feasible domain by embedding a constraint repair mechanism in the genetic operations; and it supports users in flexibly switching optimization priorities through multi-objective normalization and adjustable weights. Compared with manual design, this method can efficiently search for topology schemes that meet engineering requirements and have excellent overall performance in large-scale, multi-constraint scenarios.
[0043] Example 2: This example provides a CAN bus topology construction system for new energy vehicles, including: The first module is used to obtain controller information, message information, and engineering constraints of the CAN network. The second module is used to generate and iteratively optimize a set of candidate topology schemes based on the message information and the engineering constraints, under the pre-built coding rules, through an evolutionary algorithm until the termination condition is met, and to obtain the optimal scheme. The third module is used to output the controller-bus allocation relationship corresponding to the optimal solution; The encoding rules ensure that each candidate topology scheme includes bus allocation information for each controller and the number of buses used by the scheme.
[0044] The specific functions of each module described above are explained in the relevant content of the method in Embodiment 1, and will not be repeated here.
[0045] Example 3: This example provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in any of Examples 1.
[0046] Example 4: This example provides a computer device, including: Memory, used to store computer programs / instructions; A processor for executing the computer program / instructions to implement the steps of the method described in any of Embodiment 1.
[0047] Example 5: This example provides a computer program product, including a computer program / instructions, which, when executed by a processor, implement the steps of the method described in any of Examples 1.
[0048] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
[0049] Those skilled in the art will understand that embodiments of this disclosure can be provided as methods, systems, or computer program products. Therefore, this disclosure can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this disclosure can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0050] This disclosure is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a machine for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0051] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0052] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0053] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this disclosure and not to limit its protection scope. Although this disclosure has been described in detail with reference to the above embodiments, those skilled in the art should understand that after reading this disclosure, they can still make various changes, modifications or equivalent substitutions to the specific implementation of the invention, but these changes, modifications or equivalent substitutions are all within the protection scope of the pending claims.
Claims
1. A method for constructing a CAN bus topology for new energy vehicles, characterized in that, include: Obtain controller information, message information, and engineering constraints of the CAN network; Based on the message information and using the engineering constraints as the screening criteria, a set of candidate topology schemes is generated and iteratively optimized through an evolutionary algorithm under the pre-built coding rules until the termination condition is met, and the optimal scheme is obtained. Output the controller-bus allocation relationship corresponding to the optimal solution; The encoding rules ensure that each candidate topology scheme includes bus allocation information for each controller and the number of buses used by the scheme.
2. The method for constructing a CAN bus topology for new energy vehicles according to claim 1, characterized in that, A set of candidate topology schemes is generated and iteratively optimized using an evolutionary algorithm under pre-built encoding rules, including: An initial set of solutions is generated based on the engineering constraints, which serves as the current set of solutions. Each candidate topology solution in the initial set of solutions satisfies the engineering constraints. Perform evaluation and evolution steps on the current set of solutions to generate a new generation of solutions; The new generation of solutions is used as the new current solution set. The evaluation and evolution steps are repeated until the termination condition is met. The evaluation steps include: Calculate the comprehensive evaluation value of each candidate topology scheme in the current scheme set, wherein the comprehensive evaluation value is determined based at least on the gateway forwarding volume, the number of buses, and the average bus load rate; The evolutionary steps include: Based on the comprehensive evaluation value, a scheme is selected from the current scheme set, and crossover and mutation operations are performed on the selected candidate topology schemes to generate a new generation scheme set.
3. The method for constructing a CAN bus topology for new energy vehicles according to claim 2, characterized in that, An initial set of solutions is generated based on the aforementioned engineering constraints, including: Calculate the minimum required number of buses based on the total number of messages and the single-bus load rate threshold; The number of buses used in the current scheme is determined between the minimum required number of buses and the upper limit of the number of buses; Assign bus numbers to each controller and generate candidate topology schemes; Verify whether the generated scheme meets the engineering constraints. If it does, retain it; otherwise, regenerate or increase the number of buses and try again until the upper limit of the number of buses is reached.
4. The method for constructing a CAN bus topology for new energy vehicles according to claim 3, characterized in that, In the evaluation step, the gateway forwarding volume is calculated based on the transmission period of each message, the bus where the sending controller is located, and the bus where the receiving controller is located, to determine the total number of messages forwarded across the bus per second. The comprehensive evaluation value is obtained by weighted summation after normalizing the gateway forwarding volume, the number of buses, and the average bus load rate.
5. The method for constructing a CAN bus topology for new energy vehicles according to claim 4, characterized in that, The crossover operation includes: Select two candidate topology schemes from the current scheme set as parent schemes; Exchange the bus allocation information of some controllers in the two parent schemes to generate two new candidate topology schemes as child schemes; Update the bus quantity information used by the child scheme based on the actual bus allocation of the controller in the child scheme; If there are controllers with binding constraints in the offspring scheme that are assigned to different buses, then adjust the bus assignment of all controllers in the binding group to the same bus number. Verify whether the child solution meets the engineering constraints. If it does, retain the child solution; otherwise, re-execute the crossover operation or directly retain the parent solution for the next generation.
6. The method for constructing a CAN bus topology for new energy vehicles according to claim 5, characterized in that, The mutation operation includes: Select one candidate topology scheme from the current scheme set as the scheme to be mutated; Randomly select a controller in the scheme that does not have a binding constraint relationship, and modify its bus allocation information. The modification methods include adjusting it to another bus number that already exists in the scheme, or assigning it to a new bus number when the number of buses currently used by the scheme has not reached the upper limit. Update the bus count information used by the modified scheme; Check if any binding constraints have been broken in the mutated scheme; if so, perform consistency repair. Verify whether the modified solution meets the engineering constraints. If it does, retain the modified solution; otherwise, cancel the modification and retain the original solution.
7. The method for constructing a CAN bus topology for new energy vehicles according to any one of claims 1 to 6, characterized in that, The termination conditions include at least one of the following: the number of iterations reaches a preset value, the change in the comprehensive evaluation value of the optimal solution over multiple consecutive generations is less than a preset threshold, or the comprehensive evaluation value of the optimal solution exceeds a preset threshold.
8. A CAN bus topology construction system for new energy vehicles, characterized in that, include: The first module is used to obtain controller information, message information, and engineering constraints of the CAN network. The second module is used to generate and iteratively optimize a set of candidate topology schemes based on the message information and the engineering constraints, under the pre-built coding rules, through an evolutionary algorithm until the termination condition is met, and to obtain the optimal scheme. The third module is used to output the controller-bus allocation relationship corresponding to the optimal solution; The encoding rules ensure that each candidate topology scheme includes bus allocation information for each controller and the number of buses used by the scheme.
9. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the steps of the method described in any one of claims 1-7.
10. A computer device, characterized in that, include: Memory, used to store computer programs / instructions; A processor for executing the computer program / instructions to implement the steps of the method according to any one of claims 1-7.