A method and system for in-vehicle network traffic scheduling based on improved bat algorithm
By improving the bat algorithm to optimize in-vehicle network traffic scheduling, the problems of transmission latency and packet loss in traditional vehicle networks are solved, achieving efficient and stable transmission of vehicle networks and supporting centralized integration of vehicle electronic and electrical architecture.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING INST OF TECH
- Filing Date
- 2026-03-16
- Publication Date
- 2026-06-09
Smart Images

Figure CN122179353A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of vehicle communication technology, specifically relating to a method and system for scheduling in-vehicle network traffic based on an improved bat algorithm. Background Technology
[0002] Given the increasing demands of intelligent connected vehicles for data processing capabilities and real-time response, traditional in-vehicle electronic and electrical architectures can no longer meet the needs of efficient transmission of multi-source heterogeneous data streams. To achieve optimal resource allocation under the vehicle-road-cloud integrated framework, the evolution of in-vehicle electronic and electrical architecture towards centralization has become an industry trend, with the core objective of achieving lower scheduling latency through architecture optimization.
[0003] As the backbone network of the next-generation architecture, the stability and efficiency of automotive Ethernet are crucial for vehicle cost control and functional safety. Current technologies employ Time-Sensitive Networking (TSN) protocols to ensure real-time performance; however, under the complex electromagnetic environment and high-load communication pressure of vehicles, unpredictable transmission delays and packet loss are still prevalent, severely impacting the overall service quality of the automotive network topology. Therefore, optimizing traffic scheduling strategies for the automotive environment has become a key issue in improving the performance of automotive electronic and electrical architectures. Summary of the Invention
[0004] In view of this, the purpose of this invention is to provide a method and system for scheduling in-vehicle network traffic based on an improved bat algorithm, so as to meet the needs of improving the stability and quality of service of in-vehicle network transmission.
[0005] To achieve the above objectives, the present invention provides the following technical solution: According to a first aspect, the present invention provides an in-vehicle network traffic scheduling method based on an improved bat algorithm, comprising: acquiring initial data, including in-vehicle network topology data and in-vehicle information flow demand data; performing route solving on the initial data based on a genetic algorithm to determine the optimal routing strategy; and, based on the optimal routing strategy and the in-vehicle information flow demand data, employing the improved bat algorithm to determine the optimal traffic scheduling scheme under objective constraints.
[0006] According to a second aspect, the present invention provides an in-vehicle network traffic scheduling system based on an improved bat algorithm, comprising: a data acquisition module for acquiring initial data, including in-vehicle network topology data and in-vehicle information flow demand data; a routing strategy determination module for solving the routing problem on the initial data based on a genetic algorithm to determine the optimal routing strategy; and a scheduling scheme determination module for determining the optimal traffic scheduling scheme based on the optimal routing strategy and the in-vehicle information flow demand data, using the improved bat algorithm under objective constraints.
[0007] According to a third aspect, an embodiment of the present invention provides an electronic device, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the steps of the in-vehicle network traffic scheduling method and system based on the improved bat algorithm described in the first aspect or any embodiment of the first aspect.
[0008] According to a fourth aspect, embodiments of the present invention provide a computer storage medium storing computer instructions that, when executed by a processor, implement the steps of a method and system for in-vehicle network traffic scheduling based on an improved bat algorithm as described in the first aspect or any embodiment of the first aspect.
[0009] This embodiment provides an in-vehicle network traffic scheduling method based on an improved bat algorithm. First, it acquires in-vehicle network topology data and in-vehicle information flow demand data to provide a scenario-based basis for scheduling. Then, it uses a genetic algorithm to solve the routing problem on the initial data, constructing a multi-objective optimization model with the goals of load balancing and minimizing end-to-end latency. From the path selection source, it plans the optimal transmission path for different types of information flows, avoiding conflicts in multi-source data transmission and achieving accurate pre-allocation and fine-grained allocation of global resources under a centralized architecture, aligning with the trend of architecture evolution. Simultaneously, addressing the problem of unpredictable transmission delays and packet loss in the complex electromagnetic environment and under high load pressure of the in-vehicle system, which affects network service quality, this method, based on optimal routing and combined with in-vehicle information flow demand data, uses an improved bat algorithm and introduces objective constraints to determine the optimal traffic scheduling scheme, effectively compensating for the defects of the TSN protocol and improving the stability and service quality of in-vehicle network transmission.
[0010] The in-vehicle network traffic scheduling strategy optimization method proposed in this embodiment, by innovatively introducing genetic operators and adaptive crossover algorithms into the improved bat algorithm, overcomes the shortcomings of traditional heuristic algorithms that are prone to getting trapped in local optima and have slow convergence speed. This greatly enhances the convergence performance and strategy solution efficiency of the algorithm, thereby enabling the rapid acquisition of the optimal traffic scheduling scheme and supporting the development of in-vehicle electronic and electrical architecture towards centralized and efficient integration.
[0011] Other advantages, objectives, and features of the invention will be set forth in the following description and will be apparent to those skilled in the art in some respects, or may be learned by practice of the invention. The objectives and other advantages of the invention can be realized and obtained through the following description. Attached Figure Description
[0012] To make the objectives, technical solutions, and beneficial effects of this invention clearer, the following figures are provided for illustration: Figure 1This is a flowchart illustrating a specific example of an in-vehicle network traffic scheduling method based on an improved bat algorithm, as described in this invention. Figure 2 This is an overall flowchart of an in-vehicle network traffic scheduling method based on an improved bat algorithm in this invention; Figure 3 This is a schematic block diagram of a specific example of an electronic device in an embodiment of the present invention. Detailed Implementation
[0013] The technical solution of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0014] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can also refer to the internal connection of two components; and they can refer to a wireless connection or a wired connection. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0015] Furthermore, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0016] This invention provides a method for in-vehicle network traffic scheduling based on an improved bat algorithm, such as... Figure 1 As shown, it includes: S101, Obtain initial data, including vehicle network topology data and vehicle information flow demand data; S102, Using a genetic algorithm, the initial data is used to solve for routing and determine the optimal routing strategy; S103, based on the optimal routing strategy and vehicle information flow demand data, adopts an improved bat algorithm to determine the optimal traffic scheduling scheme under the objective constraint.
[0017] For example, the implementation of this embodiment is based on the following pre-built mathematical model of the in-vehicle network architecture, mainly including network architecture topology modeling and in-vehicle network transmission modeling: 1. Network architecture topology modeling (that is, abstracting the network architecture topology into a directed graph) Sensors, controllers, and actuators, along with the links between them, form the in-vehicle network. The nodes and links in the in-vehicle network are abstracted as a directed graph, and the network topology is described using mathematical formulas: In the formula, express A set of nodes, Represents a set of physical links. Represents a node With nodes The links between them.
[0018] 2. In-vehicle network task transmission model Six-dimensional tuples are used to represent information transmission and exchange between nodes in a network topology. The transmission properties of traffic can be represented as follows: In the formula , ∈ Represents a stream The source node and the terminal node. Represents a stream Required bandwidth. and Representing flow The period and deadline. Represents a stream Priority.
[0019] Based on this, in step S101, this embodiment defines the vehicle network topology data as a set of parameters including G, N, and E, and the vehicle information flow demand data as the transmission attributes defined in the in-vehicle network task transmission model. These data can be retrieved from the database, where corresponding data is pre-stored, or through user input. This embodiment does not limit the acquisition method, and those skilled in the art can determine it as needed.
[0020] Next, in step S102, a route solution is performed on the initial data based on a genetic algorithm to determine the optimal route strategy. Specifically, the initial data is input into the constructed multi-objective optimization model, and the optimal route strategy is obtained by solving the multi-objective optimization model using a genetic algorithm, including the following steps: Step 1: In-vehicle network load and end-to-end latency model Routing mechanisms define the transmission path of data tasks within the network topology. By introducing load balancing constraints, this embodiment aims to achieve a balanced distribution of network resources on physical links, effectively mitigating the risk of congestion on specific paths due to traffic surges, thereby improving the utilization rate of overall network resources. The load balancing evaluation model is expressed as follows: In the formula, Indicates load balancing. Indicates backbone link Bandwidth used This indicates the backbone network bandwidth.
[0021] In the evaluation system, end-to-end latency is used as the core parameter for measuring transmission performance. It is defined as the cumulative time it takes for a data packet to travel from the source node to the destination node. Assuming that in-vehicle network traffic is transmitted from the sending port to the receiving port, the end-to-end latency can be expressed as: In the formula Represents a stream End-to-end delay. Represents a stream The transmission delay is determined by the amount of data and the bandwidth. Represents a stream Queuing delays depend on the level of congestion at the port.
[0022] Step 2: Multi-objective evaluation model Utility analysis is applied to obtain the optimal solution based on load balancing and end-to-end latency. According to the decomposition theorem of multi-attribute utility functions, an additive decomposition form is used to establish the utility function, as shown below. In the TSN architecture, latency and load are deeply coupled and conflicting. Simply optimizing latency can lead to traffic convergence and bottlenecks (violating reliability), while simply optimizing load balancing may result in excessively long paths (violating determinism).
[0023] In the formula This represents the overall utility function. This represents the total end-to-end latency of all tasks, consisting of multiple... The sum is obtained by accumulation. and The weighting coefficients for load balancing and end-to-end latency reflect the importance of these two indicators in the overall utility.
[0024] Step 3: Solve the model using a genetic algorithm At the algorithm execution level, this embodiment constructs a specific chromosome encoding structure: each chromosome is mapped to a complete set of routing schemes containing all transmission tasks, where a single path corresponds to an end-to-end route for a specific task. The fitness function employs a comprehensive utility evaluation metric. During the solution process, optimal selection is implemented by executing a tournament selection operator, combined with crossover, mutation, and non-dominated sorting mechanisms for multiple iterations.
[0025] During the algorithm convergence phase, by traversing and comparing the candidate solution set of the final population, the chromosome with the minimum fitness value (i.e. the optimal comprehensive performance index) is identified as the optimal routing strategy, which serves as the final traffic scheduling scheme for the vehicular time-sensitive network (TSN).
[0026] Finally, in step S103, based on the abstraction of the scheduling problem, an abstract model is obtained. Then, the scheduling problem represented by the abstract model is adapted to the improved bat algorithm, thereby using the improved bat algorithm to generate the optimal solution for the scheduling problem. Specifically, the flow scheduling problem is abstracted into a periodic shop floor scheduling model, information flow is abstracted into workpieces requiring operation, each sending port is abstracted into a machine, and the routing process of information flow is abstracted into a work process. The in-vehicle network and scheduling solutions are closely related to specific scenarios. For heuristic algorithms, the dimension of the solution is the sum of the hop counts of all flows within the entire scheduling supercycle. The supercycle is a common multiple of the scheduling cycles of all flows, i.e., the total cycle of the scheduling task. Each hop of a flow in different ports at different times forms a scheduling strategy.
[0027] Based on the echolocation system of bats, the bat algorithm is a biologically inspired metaheuristic method. The general process of the bat algorithm includes: For the first step and each generation, each bat in the colony All through iteration Update its location and speed Move to the next position. Each t-th iteration has a separate position. Both are multi-dimensional real vectors representing the complete and candidate scheduling schemes. The scheduling scheme includes the start time of each hop flow at the corresponding port. Population evolution is a process of competition and continuous optimization among scheduling schemes. The algorithm parameters are calculated as follows: in, This indicates the position at the (t-1)th iteration. Indicates the position at the t-th iteration, table Indicates the velocity at the t-th iteration. This indicates the velocity at the (t-1)th iteration. Let represent a uniform random vector in the interval [0,1]. and These are the minimum and maximum values of the frequency. This indicates the frequency of the sound waves emitted by bats. Frequency control modifies the step size or amplitude of the scheduling scheme. This represents the current globally optimal position, determined after comparing all new positions of the bat. Additionally, for each iteration of the local search, a position is selected. As the best solution, a random walk is used to find the new location of each bat. Perform a partial update as follows: in It is a random number. Iteration The average loudness of all bats at that time. Furthermore, bats continuously decrease loudness while increasing frequency to narrow their hunting range during the search. Therefore, loudness and pulse rate are continuously updated as the iteration progresses.
[0028] ; ; in and It is a constant. It's a bat In iteration Loudness at that time. bat In iteration The pulse rate at that time. Represents bats The initial pulse rate. For any and , , Loudness and impulse rate balance the relationship between exploring new scheduling schemes and uncovering known excellent scheduling schemes. This ensures that the algorithm does not prematurely converge to a suboptimal scheduling scheme.
[0029] Based on the above basic introduction and relying on the determined optimal routing strategy and vehicle information flow demand data, this embodiment presents the general process: First, an initial bat population is generated using a two-layer coding method, with each bat corresponding to a complete traffic scheduling candidate scheme. Then, the population enters an iterative optimization stage. First, a fitness function is defined that integrates core parameters such as transmission latency and bandwidth utilization. The fitness function can be a weighted sum of normalized bandwidth utilization and normalized latency scores. By adjusting the weights, a trade-off can be made between low latency and high bandwidth utilization, quantifying the performance of the candidate scheduling scheme corresponding to each bat. Then, the frequency and flight speed of each bat are updated according to the original formula of the improved bat algorithm, and the bat positions are adjusted based on the updated speeds to obtain new candidate scheduling schemes.
[0030] Next, the local search and acceptance criteria are executed: a random number in the interval [0,1] is generated. If the random number is greater than the corresponding loudness threshold, a new candidate solution is generated by locally randomly perturbing the current bat position. The loudness threshold is initially a preset constant and decays with loudness during iteration. If the fitness of the new candidate solution is better than the original position, and it passes the target constraint verification such as flow offset constraint and flow isolation constraint, the new position is accepted; otherwise, the original position is retained. Finally, all bat positions after iteration are traversed, and the fitness value is compared to update the global optimal bat position (i.e., the current optimal flow scheduling scheme). Finally, the above population iteration steps are repeated until the termination conditions such as the preset number of iterations and the global optimal fitness value not significantly improving for multiple generations are met. At this time, the candidate scheduling scheme corresponding to the current global optimal bat position, i.e., the optimal flow scheduling scheme of the in-vehicle network obtained by solving, can meet the real-time and reliability requirements of the in-vehicle network.
[0031] This invention provides an in-vehicle network traffic scheduling method based on an improved bat algorithm. First, it acquires in-vehicle network topology data and in-vehicle information flow demand data to provide a scenario-based basis for scheduling. Then, it uses a genetic algorithm to solve the routing problem on the initial data, constructing a multi-objective optimization model with the goals of load balancing and minimizing end-to-end latency. From the path selection source, it plans the optimal transmission path for different types of information flows, avoiding conflicts in multi-source data transmission and achieving accurate pre-allocation and fine-grained allocation of global resources under a centralized architecture, aligning with the trend of architecture evolution. Simultaneously, addressing the problem of unpredictable transmission delays and packet loss in the complex electromagnetic environment and high load pressure of the TSN protocol in vehicles, which affects network service quality, this method, based on optimal routing and combined with in-vehicle information flow demand data, uses an improved bat algorithm and introduces objective constraints to determine the optimal traffic scheduling scheme, effectively compensating for the defects of the TSN protocol and improving the stability and service quality of in-vehicle network transmission.
[0032] As an optional implementation, based on the optimal routing strategy and vehicle information flow demand data, an improved bat algorithm is used to determine the optimal traffic scheduling scheme under objective constraints, including: Based on the vehicle information flow and the optimal routing strategy, a two-layer coding method is used to generate an initial bat population, with each bat corresponding to a traffic scheduling candidate scheme. For the initial bat population, perform the following iterations: Based on the fitness calculation formula, the fitness of the current population is determined. Based on the fitness of the current population and a preset ratio, elite and non-elite individuals are identified within the current population. Based on the target frequency calculation formula, the frequency of non-elite individuals is determined. Based on the frequency of non-elite individuals, the velocity of non-elite individuals is determined. Based on the target position update formula and the velocity of non-elite individuals, the update position of non-elite individuals is determined. The target position update formula includes an adaptive crossover operation, which is determined based on the adaptive crossover probability. A search mutation operation based on a tabu list is performed on the update positions of non-elite individuals to obtain optimized non-elite candidate solutions. Based on elite individuals and optimized non-elite candidate solutions, a new generation of population is formed after target constraint verification and fitness evaluation. Based on the new generation of population, the global optimal solution is updated, and it is determined whether the iteration termination condition has been met. If it has, the optimal traffic scheduling scheme is obtained.
[0033] For example, this embodiment employs a two-layer encoding method to simplify computation and avoid generating illegal solutions. Each hop corresponding to a frame is abstracted as a job, and the port of each hop corresponds to the machine where the job is located. Each dimension of the job arrangement vector represents the job sequence number and the corresponding workpiece to be processed. Each dimension of the machine selection vector represents the processing machine used in the corresponding job. For the encoding process, the job and the corresponding machine represent the solution. Assuming the encoded sequence represents a feasible scheduling strategy, it can be decoded to obtain the scheduling result. The encoding and decoding process of safety-critical flows follows the transmission order and constraints in the standard.
[0034] Based on the above abstract processing, the two-layer coding can contain two layers of information. For example, the upper layer coding defines the global execution order of all transmission actions, and the lower layer coding allocates specific network resources for each transmission action, such as which port and when the stream is transmitted under the selected path, and how much bandwidth is allocated to cover the potential feasible solution space.
[0035] For the initial bat population, perform the following iterations: Based on a preset fitness calculation formula, the merits of each bat (candidate scheduling scheme) in the current population are evaluated. The fitness index needs to be designed in conjunction with the vehicle information flow scheduling target, which may include factors such as transmission delay, path congestion rate, and cost. These factors are weighted and integrated to obtain the fitness value. The current population is ranked based on the fitness value, and individuals in the top 20% (e.g., the first 20%) are designated as elite individuals, while the remaining individuals are designated as non-elite individuals. The target frequency formula and the formula for determining individual speed based on individual frequency are consistent with the general improved bat algorithm in the above embodiments, and will not be elaborated here.
[0036] To improve solution efficiency, this embodiment improves the Bat Algorithm in two ways to address the problems of lacking a mutation mechanism and being prone to getting trapped in local optima. First, it introduces operation operators and an elite preservation strategy to update each position. Furthermore, it randomly selects multiple neighborhood operations to avoid local optima. The improved Bat Algorithm for updating a single position is calculated as follows: in, Indicates the superposition operator. This indicates the cross operator. and They are randomly selected cross partners.
[0037] In large-scale vehicle networks, numerous flows with varying periods exist, leading to extensive solution spaces and high-dimensional solutions. Extensive research has shown that combining multiple heuristic algorithms can significantly improve optimization capabilities. Based on these improvements, an adaptive crossover probability operation is further introduced. This adaptive probability crossover operation enhances the global search capability for population diversity while maintaining population diversity. Simultaneously, the tabu search mutation operation improves local search efficiency by avoiding redundant searches. Both work together to optimize the real-time performance and reliability of traffic scheduling. Its frequency tuning mechanism is crucial for in-vehicle network traffic scheduling that requires both global search and local refinement. The loudness-based solution achieves superior ability to escape local optima through adaptive loudness and pulse rate. Compared to schemes such as genetic algorithms, the improved bat algorithm proposed in this embodiment has a lighter search operator. Combined with variable neighborhood search, it achieves more efficient model convergence under complex constraints. The crossover probability of the adaptive operation is defined by the following formula: in It is the crossover probability. This indicates the more adaptable of the two chromosomes. This indicates the optimal fitness of the current population. The median fitness of the current population is represented by t, and the current iteration number is represented by t.
[0038] The tabu search mutation operation specifically involves maintaining a tabu table in the system, which records poor scheduling schemes that have appeared in the last K iterations, to avoid repeatedly generating such schemes during the mutation process. The mutation process can randomly select multiple code points in the two-layer encoding for fine-tuning, such as replacing node order, changing traffic allocation ratios, etc. It checks whether the mutated scheme is in the tabu table; if not, an optimized non-elite candidate solution is generated; if it is, the mutation is repeated. Based on elite individuals and optimized non-elite candidate solutions, a new generation of population is formed after objective constraint verification and fitness evaluation.
[0039] As an optional implementation, the target constraints include: traffic offset constraints, flow isolation constraints, flow routing constraints, and deadline constraints.
[0040] Flow offset constraint: Flow offset is considered the start time of flow transmission. The flow offset in the in-vehicle network must be greater than or equal to the cycle start time. To ensure that each cycle does not affect another cycle, the entire transmission window (offset plus travel duration) must be less than or equal to the cycle end time. The flow offset constraint is as follows: ; in, Indicates port In the Stream in each transmission cycle Transmission offset, It is a flow Transmission period, Representing node X, Representing node Y, Represents a stream The transmission duration, where T represents the period and E represents the set of physical links.
[0041] Stream isolation constraint: The IEEE standard defines the maximum transmission unit size (TUN) for Ethernet as 1500 bytes. When a stream size exceeds 1500 bytes, it is split into multiple frames for transmission. Proper stream ordering is enforced by isolating streams in the time domain. Specifically, if a frame in a stream has already entered the port's transmit queue, it must be ensured that all frames from the previous stream have been transmitted before entering the queue. This constraint ensures that the stream scheduling order is as expected, avoiding scheduling chaos caused by frame loss. The stream isolation constraint is as follows: ; in, and Representing ports respectively exist Transmission cycle flow The transmission offset between the first and last frames. It is a flow The transmission duration of each frame in the data. Indicates the first One transmission cycle, , Representing ports respectively exist Transmission cycle flow The transmission offset between the first and last frames. It is a flow The transmission duration of each frame in the data. Indicates superperiod, defined as , It is the set of all streams.
[0042] Flow routing constraint: Each flow can only be transmitted on one output port at a time. The transmission time of the subsequent port must be greater than the completion time of the previous port. The flow routing constraint is as follows: ; in, Representative Stream The transmission route, where R represents the transmission route. Represents node z.
[0043] Deadline constraint: To ensure real-time performance, the stream must be transmitted within the deadline. The deadline constraints are as follows: ; in, It is the start time of the last transmission before reaching the endpoint. Indicates the time when the source node started sending. d Indicates the deadline.
[0044] Finally, after verifying the objective constraints and evaluating fitness, a new generation of population is formed. Based on this new generation, the global optimal solution is updated, and it is determined whether the iteration termination condition has been met. If it has, the optimal traffic scheduling scheme is obtained. Ultimately, the in-vehicle network architecture is adjusted and optimized based on the policy solution results and sensitivity analysis. Different in-vehicle architecture schemes are designed for policy optimization to achieve a highly efficient integration scheme for the in-vehicle electronic and electrical architecture.
[0045] In summary, this embodiment mainly includes three steps, and the overall framework is as follows: Figure 2 As shown, the process includes: mathematical modeling of the in-vehicle network architecture, solving for in-vehicle network routing strategies based on genetic algorithms, and solving for in-vehicle network traffic scheduling algorithms based on improved bat algorithms. First, the vehicle architecture topology model and task transmission model are abstracted. Then, based on this model, a multi-objective routing optimization model based on backbone network load balancing and minimizing end-to-end latency is constructed, and routing strategies are obtained through routing optimization algorithms. Finally, to improve the efficiency of in-vehicle network traffic scheduling, traffic scheduling is abstracted into a periodic workshop operation scheduling problem, and the efficiency of solving the in-vehicle network traffic scheduling problem is improved based on improved bat algorithms.
[0046] The in-vehicle network traffic scheduling strategy optimization method proposed in this embodiment, by innovatively introducing genetic operators and adaptive crossover algorithms into the improved bat algorithm, overcomes the shortcomings of traditional heuristic algorithms that are prone to getting trapped in local optima and have slow convergence speed. This greatly enhances the convergence performance and strategy solution efficiency of the algorithm, thereby enabling the rapid acquisition of the optimal traffic scheduling scheme and supporting the development of in-vehicle electronic and electrical architecture towards centralized and efficient integration.
[0047] As an optional implementation, an in-vehicle network traffic scheduling system based on an improved bat algorithm includes: The data acquisition module is used to acquire initial data, including vehicle network topology data and vehicle information flow demand data; The routing strategy determination module is used to solve the routing problem on the initial data based on the genetic algorithm and determine the optimal routing strategy. The scheduling scheme determination module is used to determine the optimal traffic scheduling scheme based on the optimal routing strategy and vehicle information flow demand data, using an improved bat algorithm under objective constraints.
[0048] This application also provides an electronic device, such as... Figure 3 As shown, processor 501 and memory 502 are connected via a bus or other means.
[0049] Processor 501 can be a central processing unit (CPU). Processor 501 can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or combinations of the above types of chips.
[0050] The memory 502, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as the program instructions / modules corresponding to an in-vehicle network traffic scheduling method based on an improved bat algorithm in this embodiment of the invention. The processor executes various functional applications and data processing by running the non-transitory software programs, instructions, and modules stored in the memory.
[0051] Memory 502 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created by the processor, etc. Furthermore, the memory may include high-speed random access memory and non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory 502 may optionally include memory remotely located relative to the processor, which can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0052] The one or more modules are stored in the memory 502, and when executed by the processor 501, they perform actions such as... Figure 1 The illustrated embodiment presents an in-vehicle network traffic scheduling method and system based on an improved bat algorithm.
[0053] For specific details regarding the aforementioned electronic devices, please refer to the relevant documentation. Figure 1 The relevant descriptions and effects in the illustrated embodiments are for understanding purposes only and will not be repeated here.
[0054] This embodiment also provides a computer storage medium storing computer-executable instructions that can execute an in-vehicle network traffic scheduling method based on an improved bat algorithm from any of the above method embodiments. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk drive (HDD), or solid-state drive (SSD), etc.; the storage medium may also include combinations of the above types of memory.
[0055] Finally, it should be noted that the above preferred embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail through the above preferred embodiments, those skilled in the art should understand that various changes can be made to it in form and detail without departing from the scope defined by the claims of the present invention.
Claims
1. A method for scheduling in-vehicle network traffic based on an improved bat algorithm, characterized in that, include: Acquire initial data, including vehicle network topology data and vehicle information flow demand data; The genetic algorithm is used to solve the routing problem on the initial data to determine the optimal routing strategy; Based on the optimal routing strategy and vehicle information flow demand data, an improved bat algorithm is used to determine the optimal traffic scheduling scheme under the objective constraint.
2. The in-vehicle network traffic scheduling method based on the improved bat algorithm according to claim 1, characterized in that, Based on the optimal routing strategy and vehicle information flow demand data, an improved bat algorithm is used to determine the optimal traffic scheduling scheme under objective constraints, including: Based on vehicle information flow and optimal routing strategy, a two-layer coding method is used to generate an initial bat population, with each bat corresponding to a traffic scheduling candidate scheme. For the initial bat population, perform the following iterations: The fitness of the current population is determined based on the fitness calculation formula. Based on the fitness of the current population and the preset proportion, elite individuals and non-elite individuals are identified in the current population. Based on the target frequency calculation formula, the frequency of non-elite individuals is determined; Determine the velocity of non-elite individuals based on their frequency; Based on the target position update formula and the velocity of non-elite individuals, the updated position of non-elite individuals is determined. The target position update formula includes an adaptive crossover operation, which is determined based on the adaptive crossover probability. Perform a tabu-based search mutation operation on the updated position of non-elite individuals to obtain optimized non-elite candidate solutions; Based on elite individuals and optimized non-elite candidate solutions, a new generation of population is formed after objective constraint verification and fitness evaluation; Based on the new generation of population, the global optimal solution is updated, and it is determined whether the iteration termination condition has been met. If it has been met, the optimal traffic scheduling scheme is obtained.
3. The in-vehicle network traffic scheduling method based on the improved bat algorithm according to claim 2, characterized in that, The formula for calculating the adaptive crossover probability is: in, It is the crossover probability. This indicates the more adaptable of the two chromosomes. This indicates the optimal fitness of the current population. The median fitness of the current population is represented by t, and the current iteration number is represented by t.
4. The in-vehicle network traffic scheduling method based on the improved bat algorithm according to claim 2, characterized in that, The target location update formula includes: ; in, Indicates the superposition operator. This indicates the cross operator. and They are randomly selected cross partners. This indicates the position at the (t+1)th iteration. This indicates the position at the t-th iteration. This represents the velocity at the t-th iteration.
5. A method for scheduling in-vehicle network traffic based on an improved bat algorithm according to claim 1 or 2, characterized in that, The target constraints include: Traffic offset constraints, flow isolation constraints, flow routing constraints, and deadline constraints; The flow offset constraint is: ; The flow isolation constraint is: ; The flow routing constraints are: ; The deadline constraint is: ; in, It is a flow Transmission period, Representing node X, Representing node Y, Representing node Z, Indicates port exist Transmission cycle flow The transmission offset, where T represents the period and R represents the transmission route. Represents a stream Transmission duration, Indicates superperiod, defined as , It is the set of all flows, and E represents the set of physical links. , Representing ports respectively exist The transmission offset between the first and last frames. and These represent the ports in Transmission cycle flow The transmission offset between the first and last frames. It is a flow The transmission duration of each frame in the data. No. One transmission cycle, Representative Stream Transmission routing, It is the start time of the last transmission before reaching the endpoint. Indicates the time when the source node started sending. d Indicates the deadline.
6. The in-vehicle network traffic scheduling method based on the improved bat algorithm according to claim 1, characterized in that, The initial data is used to solve for routing based on a genetic algorithm to determine the optimal routing strategy, including: The initial data is input into the constructed multi-objective optimization model, and the optimal routing strategy is obtained by solving the multi-objective optimization model through a genetic algorithm. The multi-objective optimization model is as follows: in, Represents minimizing the utility function , This indicates a weighted sum. Represents the comprehensive utility function. Indicates load balancing. This represents the total end-to-end latency for all tasks. and The weighting coefficients for load balancing and end-to-end latency reflect the importance of these two metrics in the overall utility. Indicates backbone link Bandwidth used This indicates the backbone network bandwidth.
7. A vehicle network traffic scheduling system based on an improved bat algorithm, characterized in that, include: The data acquisition module is used to acquire initial data, including vehicle network topology data and vehicle information flow demand data; The routing strategy determination module is used to solve the routing problem on the initial data based on the genetic algorithm and determine the optimal routing strategy. The scheduling scheme determination module is used to determine the optimal traffic scheduling scheme based on the optimal routing strategy and vehicle information flow demand data, using an improved bat algorithm under objective constraints.
8. An electronic device, the device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor performs the steps of the in-vehicle network traffic scheduling method based on the improved bat algorithm as described in any one of claims 1-6.
9. A computer storage medium storing computer instructions thereon, characterized in that, When executed by the processor, this instruction implements the steps of the in-vehicle network traffic scheduling method based on the improved bat algorithm as described in any one of claims 1-6.