An improved method for a message scheduling mechanism based on an adaptive genetic algorithm

Through adaptive genetic algorithms, CAN packet scheduling is optimized and the probability of cross-mutation is dynamically adjusted, which solves the problem of parameter fixedness and slow convergence speed of traditional genetic algorithms, and realizes efficient transmission and rapid convergence of CAN packets.

CN120074979BActive Publication Date: 2025-08-05QILU UNIVERSITY OF TECHNOLOGY (SHANDONG ACADEMY OF SCIENCES) +2
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510527186.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-25
Publication Date
2025-08-05
Estimated Expiration
2045-04-25

AI Technical Summary

Technical Problem

Traditional genetic algorithms have problems such as parameter fixedness, slow convergence speed, difficulty in balancing global and local searches, insufficient adaptability and poor algorithm stability, and the CAN message transmission time is too long.

Method used

Adaptive genetic algorithm is used to dynamically adjust the cross probability and variation probability, combine roulette selection and optimal retention selection, optimize the CAN message scheduling scheme, and use sorting encoding and non-uniform variation, single-point crossover operation to achieve adaptive optimization of populations.

Benefits of technology

It achieves a balance between global exploration and local development, quickly converges, optimizes CAN protocol message scheduling, reduces the number of iterations, and improves the efficiency of CAN message transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120074979B_ABST
    Figure CN120074979B_ABST
Patent Text Reader

Abstract

The present invention belongs to the technical field of intelligent control, and more specifically, relates to a method for improving a message scheduling mechanism based on an adaptive genetic algorithm. The method comprises enabling the crossover probability and mutation probability, which are supposed to be fixed in a traditional genetic algorithm, to be dynamically and adaptively adjusted during the process, and changing the judgment results of the crossover probability formula and mutation probability formula in a cosine-type adaptive genetic algorithm. The present invention solves the drawbacks of traditional genetic algorithms, such as parameter fixity, slow convergence, difficulty balancing global and local searches, insufficient adaptability, and poor algorithm stability. It also solves the drawback of the improved strategy for the CAN message scheduling mechanism in the cosine-type adaptive genetic algorithm, such as excessive number of iterations resulting in inability to quickly converge, which results in longer CAN message transmission times.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of intelligent control, and more specifically, relates to an improved method for a message scheduling mechanism based on an adaptive genetic algorithm. Background Art

[0002] Genetic algorithms (GAs) are computational models of biological evolution that simulate the natural selection and genetic mechanisms of Darwinian evolution. They are a method for searching for optimal solutions by simulating natural evolutionary processes. Their main characteristic is that they operate directly on structural objects, without the constraints of derivatives or function continuity.

[0003] Chinese invention patent CN101814086A discloses a Chinese WEB information filtering method based on a fuzzy genetic algorithm. The method uses a text training set and a fuzzy genetic algorithm to filter templates. WEB data packets are intercepted and parsed to extract valid text information. URL information, keyword information, and Chinese domain name information are extracted from the valid information obtained, and a three-layer filtering mechanism is applied for preliminary filtering, and the filtering results are returned. The text information that is not filtered out is segmented, stop words are removed, and hierarchical clustering is performed to form concept-based logical paragraphs, and feature item weights are calculated. The processing results are matched with the filtering template for similarity, and the matching results are returned. The filtering results and matching results are combined to determine whether the obtained text information is filtered, and the filtered web page information is directly blocked. The filtering results are fed back using a feedback method and combined with user feedback information to update the filtering template.

[0004] However, traditional genetic algorithms have problems such as parameter fixedness, slow convergence speed, difficulty in balancing global and local searches, insufficient adaptability, poor algorithm stability, and long CAN message transmission time. Summary of the Invention

[0005] The present invention aims to overcome the above-mentioned technical defects of traditional genetic algorithms and provide an improved method for the message scheduling mechanism based on an adaptive genetic algorithm to solve the problems that the genetic algorithm easily causes some excellent gene fragments to be lost, resulting in premature convergence of the algorithm and low search efficiency in the late evolution stage.

[0006] In addition, the invention also includes a device for realizing an improved method of a message scheduling mechanism based on an adaptive genetic algorithm.

[0007] In another aspect of the present invention, a computer-readable storage medium is provided, which stores executable instructions for executing an improved method for a message scheduling mechanism based on an adaptive genetic algorithm.

[0008] The detailed technical solutions of the present invention are as follows:

[0009] An improved method for a message scheduling mechanism based on an adaptive genetic algorithm, the method comprising:

[0010] S1. The CAN message scheduling scheme is represented as a chromosome, i.e. a set of genes. Each gene represents a message parameter, including sending time, priority, message identifier, bandwidth allocation and sending node. This is used to determine the encoding strategy. Then, sorting coding is used to establish a one-to-one mapping relationship between the actual value of the independent variable and the encoding algebra.

[0011] Furthermore, the CAN bus message scheduling scheme is encoded as {X, Y, Z, P, Q}, where X is the sending time; Y is the priority; Z is the message identifier; P is the bandwidth allocation; and Q is the sending node.

[0012] S2. Initialize the population, select the population size, i.e., a set of CAN message data frames and chromosome size, and determine the convergence condition. The selection process uses the roulette wheel selection and the best retention selection method.

[0013] In the mutation method, non-uniform mutation is selected; in the crossover method, single-point crossover is selected. Mutation and crossover are the key genetic operations in genetic algorithms.

[0014] S3, taking the transmission time of a group of CAN message scheduling schemes that have completed the crossover and mutation process as the fitness value of the group to perform fitness analysis;

[0015] The CAN message scheduling scheme that completes the crossover and mutation process is the individual, and the population is all the offspring produced by the crossover and mutation process. Then the fitness of each individual in the population is calculated and sorted according to the size of the fitness.

[0016] S4. Sorting by fitness can get the median fitness value of the population And the average fitness value of the population ,judge Is it established?

[0017] If it is not true, then the median of the fitness set composed of all individual fitness values in the population is greater than the average fitness of the population, and the process goes to S5.

[0018] If it is true, the median of the fitness set composed of all individual fitness values in the population is less than the average fitness of the population, and the process goes to S6.

[0019] S5: First, a mutation crossover operation is performed to generate a second-generation population, and then a selection operation is performed to screen and preserve high-quality individuals in the population; S5 is specifically as follows:

[0020] First, let the minimum crossover probability of a generation be ; The maximum crossover probability is ; The minimum mutation probability is ; The maximum crossover probability is , first perform the non-uniform mutation operation;

[0021] In the non-uniform mutation operation, first determine the relationship between the fitness value of the individual and the average fitness value of the current population. If , then the crossover probability of an individual is:

[0022] (1);

[0023] In formula (1), is the crossover probability of an individual, is the maximum crossover probability in the current population, is the minimum crossover probability in the current population, is the maximum fitness value in the current population, is the average fitness value in the current population, is the fitness value of the current individual;

[0024] if , by reducing the individual's mutation probability, its high-quality genes can be preserved, and the individual's mutation probability , then the five message parameters contained in the individual are mutated according to the mutation probability;

[0025] Then perform a single-point crossover operation. In the single-point crossover operation, the first step is to determine the relationship between the fitness value of the individual and the average fitness value of the current population. Here, the population at this time is the new population composed of the individual population before the mutation operation plus all new individuals generated by the mutation operation.

[0026] if , then the mutation probability of the individual ;

[0027] if , then the mutation probability of this individual is:

[0028] (2);

[0029] In formula (2), is the crossover probability of an individual, is the maximum mutation probability in the current population, is the minimum mutation fork probability in the current population;

[0030] The single-point crossover operation is: for an individual in a new population, a message parameter of the individual is exchanged with the same message parameter of another individual at the individual's crossover probability.

[0031] After completing the mutation and crossover operations, the best retention strategy selection operation is finally performed, that is, only the top individual with the highest fitness value in the population is retained. individuals as the second-generation population.

[0032] This selection method can effectively prevent the loss of excellent individuals in the new population generated by the crossover mutation operation. In the early stage of convergence, in order to ensure the diversity of the population, when the number of iterations is less than or equal to 30 generations, let k = the average number of populations. In the late stage of convergence, in order to ensure the rapid convergence of the results, when the number of iterations is greater than 30 generations, let , That is the average number of populations.

[0033] S6: First, a selection operation is performed to preserve high-quality individuals in the population, and then a mutation and crossover operation is performed on the screened population to increase the probability of generating high-quality individuals; S6 is specifically as follows:

[0034] First, perform the roulette selection operation. Roulette selection simulates the random selection process of a casino roulette wheel. The higher the fitness value of an individual, the greater the probability of being selected. Calculate the selection probability of each individual, and the individual selection probability formula is as follows:

[0035] (3);

[0036] In formula (3), is the choice probability of individual i; is the fitness value of individual i; is the number of individuals in the population; is the total probability of the population, j is a variable;

[0037] Then calculate the cumulative probability This forms the roulette range:

[0038] (4);

[0039] In formula (4), is the cumulative probability of individual i;

[0040] Next, generate a Then select a random number r that satisfies Individual i is formed into a new population and then a single-point crossover operation is performed, and finally a non-uniform mutation operation is performed;

[0041] The crossover and mutation operations are the same as S5, thereby obtaining the second generation population;

[0042] S7. In the improved cosine adaptive genetic algorithm, determine the convergence condition.

[0043] Then, the convergence is judged until the best fitness value of the individual in this convergence is equal to the best fitness value of the individual in history, then the convergence is stopped; otherwise, the next convergence is entered and S3 is repeated;

[0044] S8. Repeat this process until the optimal solution, i.e., the best message scheduling solution, is found and the optimal solution is output.

[0045] Furthermore, the S7 specifically includes:

[0046] First, by setting maxIter=150, the maximum number of iterations is preset to 150 times; and the historical individual optimal fitness value is recorded, so that each completed iteration is compared with the previous individual optimal fitness value to determine convergence;

[0047] After completing a convergence, first determine whether the number of iterations exceeds the preset maximum number of iterations, and then determine the relationship between the individual best fitness value in this convergence and the historical individual best fitness value. If it is less than the historical individual best fitness value, enter the next convergence and repeat S3; if they are equal, stop convergence.

[0048] The present invention also includes a device for improving a message scheduling mechanism based on an adaptive genetic algorithm, the device comprising:

[0049] processor;

[0050] a memory having stored thereon a computer program executable on the processor;

[0051] Wherein, when the computer program is executed by the processor, the computer program implements the steps of a method for improving a message scheduling mechanism based on an adaptive genetic algorithm.

[0052] A computer-readable storage medium stores a computer program. When the computer program is executed by a processor, an improved method for a message scheduling mechanism based on an adaptive genetic algorithm is implemented.

[0053] Compared with the prior art, the present invention has the following beneficial effects:

[0054] (1) The present invention provides an improved method for a message scheduling mechanism based on an adaptive genetic algorithm. Compared with the traditional genetic algorithm, the improved cosine adaptive genetic algorithm can firstly dynamically adjust the probability so as to achieve a balance between global exploration and local development; secondly, it has a fitness feedback mechanism, which can automatically optimize parameters according to the population status; finally, it uses a smooth transition strategy such as the cosine function to reduce the impact of parameter mutations on the population.

[0055] (2) The present invention provides an improved method for message scheduling mechanism based on adaptive genetic algorithm, which can better optimize the CAN protocol message scheduling mechanism compared with the cosine type adaptive genetic algorithm, so that while ensuring the best CAN protocol message scheduling scheme, that is, the minimum transmission time, it can ensure fewer iterations, that is, fast convergence, thereby better completing the CAN message transmission task on the CAN bus. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 This is a flow chart of an improved method for a message scheduling mechanism based on an adaptive genetic algorithm according to the present invention. DETAILED DESCRIPTION

[0057] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0058] It should be noted that the following detailed descriptions are exemplary and intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which the present invention belongs.

[0059] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, they indicate the presence of features, steps, operations, devices, components and / or combinations thereof.

[0060] In the absence of conflict, the embodiments of the present invention and the features thereof may be combined with each other.

[0061] Example 1

[0062] Ginseng Figure 1 This embodiment provides an improved method for a message scheduling mechanism based on an adaptive genetic algorithm, the method comprising:

[0063] S1. The CAN message scheduling scheme is represented as a chromosome, i.e., a set of genes. Each gene represents a message parameter, including sending time, priority, message identifier, bandwidth allocation, and sending node. The coding strategy is determined as sorting coding, and a one-to-one mapping relationship is established between the actual value of the independent variable and the coding algebra.

[0064] Preferably, the CAN bus message scheduling scheme is encoded as {X, Y, Z, P, Q}, where: X is the sending time; Y is the priority; Z is the message identifier; P is the bandwidth allocation; and Q is the sending node.

[0065] S2. Initialize the population, i.e., perform encoding operations to generate the initial population, select the population size, i.e., a set of CAN message data frames, the chromosome size, and determine the selection method. Since other selection methods are not suitable for the CAN message scheduling mechanism optimization strategy, the selection process uses roulette wheel selection and best-reserved selection. Considering the transmission time requirements of CAN message data frames, this dual selection method can ensure that the convergence is too fast and that too many offspring lead to slow convergence.

[0066] Since a message only has five parameters, non-uniform mutation can be used as the mutation method, which can increase the diversity and selectivity of the offspring. However, the number of offspring should not be too large, which will lead to slow convergence. Therefore, single-point crossover is selected as the crossover method. Mutation and crossover are key genetic operations in genetic algorithms.

[0067] Preferably, this embodiment employs an improved cosine-based adaptive genetic algorithm (ICAGA), which dynamically adjusts these parameters based on the algorithm's performance. For example, the crossover probability and mutation probability can be adjusted based on information such as population diversity and fitness changes to avoid premature convergence and enhance search capabilities.

[0068] The crossover and mutation probabilities can be adaptively adjusted based on the fitness or other statistical information of the individuals. For example, individuals with high fitness can adopt a lower mutation probability, while individuals with low fitness can adopt a higher mutation probability to increase the possibility of mutation and exploration of new solutions.

[0069] The improved formulas for crossover probability and mutation probability are as follows:

[0070] (5);

[0071] (6);

[0072] In formulas (5)-(6), is the crossover operator, is the maximum probability among the crossover probabilities, is the minimum probability among the crossover probabilities, is the maximum fitness value of the current population, is the current population average fitness value, is the fitness value of the current individual, is the mutation operator, is the maximum probability among the mutation probabilities, is the minimum probability among the mutation probabilities.

[0073] The improved crossover and mutation probabilities decrease as fitness increases and increase as fitness decreases. This approach effectively preserves high-quality individuals and increases the probability of low-quality individuals producing high-quality offspring. When the current fitness is infinitely close to the average fitness, the cosine value approaches 1, and the crossover and mutation probabilities are at their maximum. When the current fitness is infinitely far from the average fitness, the cosine value approaches 0.

[0074] S3. Construct a fitness function to calculate the individual fitness value: take the transmission time of a group of CAN message scheduling schemes that complete the crossover and mutation process as the fitness value of the group to perform fitness analysis;

[0075] A set of CAN message scheduling schemes that complete the crossover and mutation process is an individual, and the population is all the offspring produced by the crossover and mutation process again;

[0076] Then calculate the fitness of each individual in the population and sort them according to the size of the fitness.

[0077] S4. Sorting by fitness can get the median fitness value of the population And the average fitness value of the population ,judge Is it established?

[0078] If it is not true, it means that the median of the fitness set composed of all individual fitness values in the population is greater than the average fitness of the population, that is, there are fewer high-quality individuals in the population. The high-quality individuals represent the message scheduling scheme with high fitness values, and finally enter the S5 operation.

[0079] If it is true, it means that the median of the fitness set composed of all individual fitness values in the population is less than the average fitness of the population, that is, there are more high-quality individuals in the population, and finally enter S6 operation;

[0080] S5: First perform a mutation crossover operation to generate a second-generation population, and then use a selection operation to screen and preserve the high-quality individuals in the population.

[0081] Preferably, the S5 specifically includes:

[0082] First, let the minimum crossover probability of a generation be ; The maximum crossover probability is ; The minimum mutation probability is ; The maximum crossover probability is ; According to the process of the improved cosine adaptive genetic algorithm, the non-uniform mutation operation is performed first;

[0083] In the non-uniform mutation operation, first determine the relationship between the fitness value of the individual and the average fitness value of the current population. If , then the crossover probability of an individual is:

[0084] (1);

[0085] In formula (1), is the crossover probability of an individual, is the maximum crossover probability in the current population, is the minimum crossover probability in the current population, is the maximum fitness value in the current population, is the average fitness value in the current population, is the fitness value of the current individual;

[0086] if , that is, the fitness value of the individual is greater than the average fitness value of the population, indicating that the individual is a high-quality individual. Therefore, it is necessary to reduce the mutation probability of the individual so that its high-quality genes can be preserved. Therefore, the mutation probability of the individual is , and then the five message parameters contained in the individual are mutated according to this mutation probability.

[0087] A single-point crossover operation is then performed to generate the second-generation population. In the single-point crossover operation, the fitness value of the individual is first determined in relation to the average fitness value of the current population. The population at this point is not just the population before the mutation operation, but a new population consisting of the individual population before the mutation operation plus all new individuals generated by the mutation operation.

[0088] if , then the mutation probability of the individual ;

[0089] if , then the mutation probability of this individual is:

[0090] (2);

[0091] In formula (2), is the crossover probability of an individual, is the maximum mutation probability in the current population, is the minimum mutation fork probability in the current population;

[0092] Taking an individual in a new population as an example, a message parameter of the individual is exchanged with the same message parameter of another individual at the individual's crossover probability.

[0093] After completing the mutation and crossover operations, the best retention strategy selection operation is finally performed to screen and save the high-quality individuals in the population, that is, only the top individuals with the highest individual fitness value in the population are retained. individuals as the second-generation population.

[0094] This selection method can effectively prevent the loss of excellent individuals in the new population generated by the crossover mutation operation.

[0095] Preferably, in the early stage of convergence, in order to ensure the diversity of the population, when the number of iterations is less than or equal to 30 generations, let k = the average number of populations. In the late stage of convergence, in order to ensure the rapid convergence of the results, when the number of iterations is greater than 30 generations, let , is the average number of populations.

[0096] S6. First, a selection operation is performed to preserve the high-quality individuals in the population, and then the selected population is subjected to a mutation crossover operation to increase the probability of producing high-quality individuals.

[0097] Preferably, the S6 specifically includes:

[0098] According to the process of the improved cosine adaptive genetic algorithm, the roulette wheel selection operation is first performed. Roulette wheel selection simulates the random selection process of a casino roulette wheel. The higher the individual's fitness value, the greater the probability of being selected. This selection method is targeted at populations with a large number of high-quality individuals and can further filter out a small number of low-quality individuals in the population, thereby achieving rapid population convergence. First, the selection probability of each individual is calculated. The formula for individual selection probability is as follows:

[0099] (3);

[0100] In formula (3), is the choice probability of individual i; is the fitness value of individual i; is the number of individuals in the population; is the total probability of the population, and j is a variable.

[0101] Then calculate the cumulative probability This forms the roulette range:

[0102] (4);

[0103] In formula (4), is the cumulative probability of individual i;

[0104] Next, generate a Then select a random number r that satisfies The individuals i are formed into a new population and then a single-point crossover operation is performed. Finally, a non-uniform mutation operation is performed. The crossover and mutation operations are the same as S5, thereby obtaining the second-generation population.

[0105] S7. In the improved cosine adaptive genetic algorithm, determine the convergence condition.

[0106] Preset the maximum number of iterations and record the historical individual optimal fitness value;

[0107] Then, the convergence judgment is performed until the individual best fitness value in this convergence is equal to the historical individual best fitness value, then the convergence is stopped; otherwise, the next convergence is entered and S3 is performed again.

[0108] Preferably, first, by taking maxIter=150, the maximum number of iterations is preset to 150 times; that is, maxIter=150; ifiter>=maxIter break; end.

[0109] And record the historical individual best fitness value, that is, best_fitness_history(iter)=current_best_fitness; so that each iteration is compared with the previous individual best fitness value to determine convergence;

[0110] After completing a convergence, first determine whether the number of iterations exceeds the preset maximum number of iterations, and then determine the relationship between the individual best fitness value in this convergence and the historical individual best fitness value. If it is less than the historical individual best fitness value, enter the next convergence and re-perform S3. If they are equal, stop convergence.

[0111] S8. Repeat this process until the optimal solution, i.e., the best message scheduling solution, is found and the optimal solution is output.

[0112] Preferably, the condition for finding the optimal solution is that the maximum number of iterations is reached or the individual best fitness value in this convergence is equal to the historical individual best fitness value.

[0113] Preferably, the present invention performs sample selection:

[0114] A CAN-based control system consists of 12 sensor nodes, a network management node (NMT), and a master controller node. The sensor nodes' TPDOs are triggered by synchronous cyclic messages (SYNC). The NMT configures the network and manages the system's status. The master controller sends synchronous cyclic messages and receives RPDOs.

[0115] The communication rate is set to 250 kbit / s, and the synchronization communication period is 10000 μs. The 12 sensor nodes and their status are shown in Table 1:

[0116] Table 1 Sensor nodes and status

[0117]

[0118] Table 2 Experimental results

[0119]

[0120] The experimental results processed by this embodiment are shown in Table 2, and the analysis is as follows:

[0121] All message scheduling mechanisms optimized by genetic algorithms reduced CAN message transmission time. However, compared to traditional genetic algorithm-optimized message scheduling mechanisms, the message scheduling mechanism optimized by the modified cosine adaptive genetic algorithm not only converges more accurately, meaning the CAN message scheduling scheme requires less transmission time, but also achieves a roughly twofold increase in the number of iterations.

[0122] Compared with the message scheduling mechanism optimized by the improved cosine-type adaptive genetic algorithm, the message scheduling mechanism optimized by the improved cosine-type adaptive genetic algorithm has the same transmission time as the CAN message scheduling scheme, but the number of iterations is increased by 40%~100%, which means that it can converge faster, reduce the running time of the genetic algorithm, and improve the confirmation time of the CAN message scheduling scheme, thereby avoiding congestion of CAN messages on the CAN bus.

[0123] Example 2

[0124] This embodiment provides a device for implementing an improved method for a message scheduling mechanism based on an adaptive genetic algorithm, the device comprising:

[0125] at least one processor; and

[0126] A memory stores instructions, and when the instructions are executed by the at least one processor, the at least one processor executes the improved method of the message scheduling mechanism based on the adaptive genetic algorithm as described above.

[0127] In this embodiment, electronic devices include but are not limited to: personal computers, server computers, workstations, desktop computers, laptop computers, notebook computers, mobile computing devices, smart phones, tablet computers, cellular phones, personal digital assistants (PDAs), handheld devices, messaging devices, wearable computing devices, consumer electronic devices, etc.

[0128] Example 3

[0129] This embodiment further provides a computer-readable storage medium storing executable instructions, which, when executed, enable the machine to execute the above-mentioned improved method for the message scheduling mechanism based on the adaptive genetic algorithm.

[0130] Specifically, a system or device equipped with a readable storage medium can be provided, on which software program codes that implement the functions of any of the above-mentioned embodiments are stored, and a computer or processor of the system or device can read and execute instructions stored in the readable storage medium.

[0131] In this case, the program code itself read from the computer-readable medium can realize the function of any one of the above embodiments, and thus the computer-readable code and the computer-readable storage medium storing the computer-readable code constitute part of this specification.

[0132] Examples of readable storage media include floppy disks, hard disks, magneto-optical disks, optical disks (e.g., CD-ROMs, CD-Rs, CD-RWs, DVD-ROMs, DVD-RAMs, DVD-RWs, DVD-RWs), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, the program code may be downloaded from a server computer or a cloud via a communication network.

[0133] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0134] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts 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, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0135] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0136] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0137] Obviously, the above embodiments of the present invention are merely examples for the purpose of clearly illustrating the technical solutions of the present invention, and are not intended to limit the specific implementation methods of the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the claims of the present invention shall be included within the scope of protection of the claims of the present invention.

Claims

1. A method for improving a message scheduling mechanism based on an adaptive genetic algorithm, characterized in that: The method comprises: S1. Represent the CAN message scheduling scheme as a chromosome, i.e., a set of genes, where each gene represents a message parameter. Determine the encoding strategy as sorted encoding, and establish a one-to-one mapping relationship between the actual value of the independent variable and the encoding algebra. S2. Initialize the population, select the population size, i.e., a set of CAN message data frames and chromosome size, and determine the selection method. The selection process selects the roulette wheel selection and the best retention selection method. In the mutation mode, choose non-uniform mutation; in the crossover mode, choose single-point crossover; S3. The transmission time of a group of CAN message scheduling schemes that have completed the crossover and mutation process is used as the fitness value of the group to perform fitness analysis; a group of CAN message scheduling schemes that have completed the crossover and mutation process is an individual, and the population is all offspring produced by the crossover and mutation process; Then calculate the fitness of each individual in the population and sort them according to the size of the fitness; S4. Sorting by fitness can get the median fitness value of the population And the average fitness value of the population ,judge Is it established? If it is not true, then the median of the fitness set composed of all individual fitness values in the population is greater than the average fitness of the population, and the process goes to S5. If it is established, the median of the fitness set composed of all individual fitness values in the population is less than the average fitness of the population, and the process goes to S6. S5. First, perform a mutation crossover operation to generate a second-generation population, and then perform a selection operation to screen and preserve high-quality individuals in the population; S6. First, a selection operation is performed to preserve high-quality individuals in the population, and then a mutation and crossover operation is performed on the selected population to increase the probability of generating high-quality individuals; S7. Preset the maximum number of iterations and record the historical individual optimal fitness value; Then, the convergence is judged until the best fitness value of the individual in this convergence is equal to the best fitness value of the individual in history, then the convergence is stopped; otherwise, the next convergence is entered and S3 is repeated; S8. Repeat this process until the optimal solution, i.e., the best message scheduling solution, is found and the optimal solution is output.

2. The method for improving the message scheduling mechanism based on the adaptive genetic algorithm according to claim 1, characterized in that: The message parameters include sending time, priority, message identifier, bandwidth allocation and sending node, and the CAN bus message scheduling scheme is encoded as {X, Y, Z, P, Q}; X is the sending time; Y is the priority; Z is the message identifier; P is the bandwidth allocation; and Q is the sending node.

3. The method for improving the message scheduling mechanism based on the adaptive genetic algorithm according to claim 2, characterized in that: The S5 is specifically: First, let the minimum crossover probability of a generation be ; The maximum crossover probability is ; The minimum mutation probability is ; The maximum crossover probability is , first perform the non-uniform mutation operation; In the non-uniform mutation operation, first determine the relationship between the fitness value of the individual and the average fitness value of the current population. If , then the crossover probability of an individual is: (1); In formula (1), is the crossover probability of an individual, is the maximum crossover probability in the current population, is the minimum crossover probability in the current population, is the maximum fitness value in the current population, is the average fitness value in the current population, is the fitness value of the current individual; if , by reducing the individual's mutation probability, its high-quality genes can be preserved, and the individual's mutation probability , then the five message parameters contained in the individual are mutated according to the mutation probability; Then perform a single-point crossover operation. In the single-point crossover operation, the first step is to determine the relationship between the fitness value of the individual and the average fitness value of the current population. Here, the population at this time is the new population composed of the individual population before the mutation operation plus all new individuals generated by the mutation operation. if , then the mutation probability of the individual ; if , then the mutation probability of this individual is: (2); In formula (2), is the crossover probability of an individual, is the maximum mutation probability in the current population, is the minimum mutation fork probability in the current population; After completing the mutation and crossover operations, the best retention strategy selection operation is finally performed to screen and save the high-quality individuals in the population, that is, only the top individuals with the highest individual fitness value in the population are retained. individuals as the second-generation population.

4. The method for improving the message scheduling mechanism based on the adaptive genetic algorithm according to claim 3, characterized in that: The S6 is specifically: First, perform the roulette selection operation. Roulette selection simulates the random selection process of a casino roulette wheel. The higher the fitness value of an individual, the greater the probability of being selected. Calculate the selection probability of each individual, and the individual selection probability formula is as follows: (3); In formula (3), is the choice probability of individual i; is the fitness value of individual i; is the number of individuals in the population; is the total probability of the population, j is a variable; The cumulative probabilities are then calculated to form the roulette range: (4); In formula (4), is the cumulative probability of individual i; Next, generate a Then select a random number r that satisfies Individuals i form a new population; Then perform a single-point crossover operation, and finally perform a non-uniform mutation operation. The single-point crossover operation and the non-uniform mutation operation are the same as S5, thereby obtaining the second-generation population.

5. The improved method for message scheduling mechanism based on adaptive genetic algorithm according to claim 4, characterized in that: In the early stage of convergence, that is, when the number of iterations is less than or equal to 30 generations, let k = the average number of populations; In the late stage of convergence, that is, when the number of iterations is greater than 30 generations, let , is the average number of populations.

6. The method for improving the message scheduling mechanism based on the adaptive genetic algorithm according to claim 1, characterized in that: The S7 specifically includes: First, by setting maxIter=150, the maximum number of iterations is preset to 150 times; and the historical individual optimal fitness value is recorded, so that each completed iteration is compared with the previous individual optimal fitness value to determine convergence; After completing a convergence, first determine whether the number of iterations exceeds the preset maximum number of iterations, and then determine the relationship between the individual best fitness value in this convergence and the historical individual best fitness value. If it is less than the historical individual best fitness value, enter the next convergence and repeat S3; if they are equal, stop convergence.

7. A device for improving a message scheduling mechanism based on an adaptive genetic algorithm, characterized in that: The device comprises: processor; a memory having stored thereon a computer program executable on the processor; Wherein, when the computer program is executed by the processor, the steps of the method for improving the message scheduling mechanism based on the adaptive genetic algorithm as claimed in any one of claims 1 to 6 are implemented.

8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Chinese WEB information filtering method based on fuzzy genetic algorithm

    CN101814086A

  • Parameter optimization method for wireless energy transmission system based on improved genetic algorithm

    CN105320988A

  • Affine transformation solving method under massive control points based on improved genetic algorithm

    CN111931934A