Vehicle-mounted network switching method and device, electronic equipment and storage medium
By introducing attention model in vehicle network switching and dynamically adjusting the weight of network evaluation indicators, the problem that the existing technology cannot cover complex network environments is solved, and the accuracy of network selection and communication stability are improved.
Patent Information
- Application Number
- CN202411754109.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-02
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2044-12-02
AI Technical Summary
The existing rules-based on-vehicle network switching methods cannot effectively cover complex network environments, resulting in the inability to dynamically adjust the weight of network evaluation indicators under different network environments, affecting the accuracy of network selection.
The attention model is used to calculate the weighted value vector of the feature vector of the vehicle network, and the network status is comprehensively reflected through the attention score, and switch to the network with the highest attention score when the attention score of the current vehicle network is lower than that of other networks.
By introducing an attention mechanism, the weight of network evaluation indicators can be dynamically adjusted according to changes in different network environments, improving the accuracy of network selection, and ensuring the stability of communication in complex network environments.
Smart Images

Figure CN119854895A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of vehicle networking technology, and in particular to a switching method, device, electronic device and storage medium for an in-vehicle network. Background Art
[0002] In modern vehicle communication networks, we often face networks of different types and technologies, such as 4G, 5G, Wi-Fi, etc., which have different performance, coverage and costs. In the vehicle network environment, vehicles are usually in a fast-moving state, and they need to maintain continuous connection to ensure the stability of various services (such as navigation, communication, media playback, safety functions, etc.). Therefore, the switching of the vehicle network is the process in which the vehicle terminal automatically switches from the current vehicle network to another available vehicle network when the current vehicle network coverage is at the edge or the signal quality decreases to ensure uninterrupted communication.
[0003] Related technologies propose a rule-based vehicle network switching method. For example, the rule engine will continuously monitor the performance parameters of the current vehicle network (such as signal strength, bandwidth, delay, etc.). If a certain performance parameter of the current vehicle network is lower than the set threshold, such as the signal strength is lower than the threshold, the rule engine will trigger the switching condition, evaluate all available candidate networks, and determine the best target network based on the priority of the rules (such as signal strength, bandwidth, delay, etc.), and then switch the current network to the target network for communication. However, the above-mentioned rule-based vehicle network switching method is too rigid and cannot cover various complex network environments. Summary of the invention
[0004] In order to overcome the problems existing in the related art, this specification provides a switching method, device, electronic device and storage medium for an in-vehicle network.
[0005] According to a first aspect of an embodiment of this specification, a method for switching an in-vehicle network is provided, the method being applied to a vehicle supporting multiple in-vehicle networks, comprising:
[0006] In the process of the vehicle using the current vehicle network for business communication, for each vehicle network, multiple network evaluation indicators of the vehicle network are determined, and a feature vector for characterizing the characteristics of the vehicle network is constructed based on the multiple network evaluation indicators; and a weighted value vector corresponding to the feature vector is calculated using an attention model, and element values in the weighted value vector are summed to obtain an attention score of the vehicle network;
[0007] When the attention score of the current vehicle network is lower than the attention scores of other vehicle networks, the current vehicle network is switched to the vehicle network with the highest attention score for business communication.
[0008] According to a second aspect of an embodiment of this specification, a switching device for an in-vehicle network is provided, and the device is applied to a vehicle supporting multiple in-vehicle networks, including:
[0009] an attention score determination module, for determining, for each type of vehicle network, a plurality of network evaluation indicators of the vehicle network during the process of the vehicle using the current vehicle network for business communication, and constructing a feature vector for characterizing the characteristics of the vehicle network based on the plurality of network evaluation indicators; and, using an attention model to calculate a weighted value vector corresponding to the feature vector, and summing the element values in the weighted value vector to obtain an attention score of the vehicle network;
[0010] The vehicle network switching module is used to switch the current vehicle network to the vehicle network with the highest attention score for business communication when the attention score of the current vehicle network is lower than the attention scores of other vehicle networks.
[0011] According to a third aspect of the embodiments of this specification, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the method described in the first aspect are implemented.
[0012] According to a fourth aspect of the embodiments of this specification, there is provided a computer-readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the steps of the method described in the first aspect.
[0013] The technical solutions provided by the embodiments of this specification may have the following beneficial effects:
[0014] In the embodiments of this specification, when using multiple network evaluation indicators to jointly evaluate the network status of a certain vehicle network under the current network environment, this solution takes into account the correlation between different network evaluation indicators, and dynamically assigns weights to different network evaluation indicators based on the attention mechanism to reflect the importance of each network evaluation indicator in the current network scenario. Then, the element values in the weighted value vector calculated based on the attention mechanism are summed to obtain the attention score of the vehicle network, and the network status of the vehicle network under the current network environment is comprehensively reflected through the attention score. Finally, the current vehicle network is switched to the vehicle network with the highest attention score. It can be seen that by introducing the attention mechanism, this solution can adaptively adjust the weights of the network evaluation indicators under the network environment according to the changes in different network environments. This means that under different network environments, the importance of each evaluation indicator can change dynamically, so that the evaluation results are more in line with the actual situation, thereby improving the accuracy of network selection.
[0015] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present specification. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the specification and, together with the description, serve to explain the principles of the specification.
[0017] Figure 1 The flowchart of a vehicle network switching method is shown in accordance with an exemplary embodiment of the present specification.
[0018] Figure 2 This is a schematic diagram of a switching process of an in-vehicle network according to an exemplary embodiment of the present specification.
[0019] Figure 3 It is a structural schematic diagram of an electronic device according to an exemplary embodiment of the present specification.
[0020] Figure 4 It is a block diagram of a switching device of a vehicle network according to an exemplary embodiment of the present specification. DETAILED DESCRIPTION
[0021] In modern vehicle communication networks, we often face networks of different types and technologies, such as 4G, 5G, Wi-Fi, etc., which have different performance, coverage and costs. In the vehicle network environment, vehicles are usually in a fast-moving state, and at the same time, they need to maintain continuous connection to ensure the stability of various services (such as navigation, communication, media playback, safety functions, etc.). Therefore, the switching of the vehicle network is a process in which the vehicle terminal automatically switches from the current vehicle network to another available vehicle network when the current vehicle network coverage is at the edge or the signal quality decreases to ensure uninterrupted communication. This solution can be applied to vehicles that support multiple vehicle networks. In addition, this solution does not limit the type of vehicle network, which can be various types of vehicle networks such as 4G, 5G, Wi-Fi, etc.
[0022] like Figure 1 As shown, Figure 1 1 is a flow chart of a method for switching an in-vehicle network according to an exemplary embodiment of the present specification, including steps 101-102:
[0023] Step 101: In the process of the vehicle using the current on-board network for business communication, for each on-board network, multiple network evaluation indicators of the on-board network are determined, and a feature vector for characterizing the characteristics of the on-board network is constructed based on the multiple network evaluation indicators; and a weighted value vector corresponding to the feature vector is calculated using an attention model, and the element values in the weighted value vector are summed to obtain an attention score of the on-board network.
[0024] Step 102: When the attention score of the current vehicle network is lower than the attention scores of other vehicle networks, the current vehicle network is switched to the vehicle network with the highest attention score for service communication.
[0025] When using multiple network evaluation indicators to jointly evaluate the network status of a certain vehicle network in the current network environment, this solution takes into account the correlation between different network evaluation indicators, and dynamically assigns weights to different network evaluation indicators based on the attention mechanism to reflect the importance of each network evaluation indicator in the current network scenario. Then, the element values in the weighted value vector calculated based on the attention mechanism are summed to obtain the attention score of the vehicle network, and the attention score is used to comprehensively reflect the network status of the vehicle network in the current network environment. Finally, the current vehicle network is switched to the vehicle network with the highest attention score. It can be seen that by introducing the attention mechanism, this solution can adaptively adjust the weights of the network evaluation indicators in the network environment according to the changes in different network environments. This means that in different network environments, the importance of each evaluation indicator can change dynamically, making the evaluation results more in line with the actual situation, thereby improving the accuracy of network selection.
[0026] The business communication of the vehicle can include the communication between the various devices inside the vehicle or between the vehicle and the external system. The communication between the vehicle and the external system can be the communication between different vehicles, the communication between the vehicle and the infrastructure (such as traffic lights), the communication between the vehicle and portable devices (notebooks, mobile phones or tablets), the communication between the vehicle and the cloud server, etc.
[0027] When the vehicle uses the current vehicle network for business communication, the switching condition can be triggered at preset time intervals, such as 5 minutes, 10 minutes, etc., to re-evaluate the network quality of each vehicle network on the vehicle, and switch the current vehicle network to the optimal vehicle network for communication based on the evaluation results. In addition, the switching condition can also be triggered when a certain performance parameter of the current vehicle network is not good.
[0028] Specifically, for each vehicle network, multiple network evaluation indicators of the vehicle network can be determined, and these network evaluation indicators can be used to comprehensively evaluate the network quality of each vehicle network in subsequent steps. For example, assuming that the vehicle supports three vehicle networks, namely 4G, 5G and Wifi, and the vehicle is currently using 4G for business communications, multiple network evaluation indicators for evaluating the quality of 4G, 5G and Wifi can be determined respectively, and these network evaluation indicators can be used to comprehensively evaluate the network quality of each vehicle network in subsequent steps. If the network quality of the 4G network currently in use is the highest, there is no need to switch the vehicle network; if the network quality of any other vehicle network is the highest, the current 4G network is switched to the vehicle network with the highest network quality for business communications.
[0029] Among them, the network evaluation index is mainly used to evaluate the ability of the vehicle network to meet the user's network needs. For example, the network evaluation index used in this solution may only include multiple performance indicators used to reflect the performance of the vehicle network, such as throughput, bandwidth utilization and / or packet loss rate. In addition, it can also include vehicle environmental information, such as vehicle location information, vehicle driving status information and / or vehicle surrounding environment information. Of course, it can also include the user's network preference data, such as network preference configuration options. In addition, other types of network evaluation indicators can also be used, and this solution does not limit the specific content of the network evaluation indicators.
[0030] In an illustrated embodiment, the types of network evaluation indicators may include, but are not limited to, performance indicators of the vehicle network, environmental information of the vehicle, and network preference data of the user.
[0031] Specifically, the performance indicators of the vehicle network may include but are not limited to throughput, bandwidth utilization and / or packet loss rate. Among them, throughput refers to the amount of data that can be transmitted by the vehicle network in a unit of time. Bandwidth utilization refers to the percentage of valid data in the vehicle network to the available bandwidth. Packet loss rate refers to the proportion of lost data packets in network transmission to transmitted data packets. It is understandable that the network performance of the vehicle network can also be reflected by other performance indicators, such as the delay, energy consumption and other indicators of the vehicle network.
[0032] This solution can use one or more performance indicators of the vehicle network. The way to obtain the performance indicators of the vehicle network can include but is not limited to real-time monitoring of the vehicle network performance indicators such as throughput and signal strength from the vehicle internal sensors. The performance indicators of the vehicle network can be obtained from the logs of vehicle equipment (such as GPS navigation system, entertainment system). The performance indicators of the vehicle network can also be obtained from the vehicle network management system, such as bandwidth utilization and connection status.
[0033] The environment in which the vehicle is located also affects the quality and performance of the network connection. For example, different geographical locations (such as cities, rural areas, or highways, etc.) have significantly different effects on network quality. Network coverage in cities is usually good, but it may also face congestion problems, and in remote areas, network coverage may be insufficient. By evaluating the geographical location of the vehicle, the network quality and coverage can be judged more accurately. For example, the driving speed of the vehicle will directly affect the stability of the network. Especially when using a cellular network, the vehicle may need to switch between base stations frequently. If the switching speed cannot keep up with the moving speed of the vehicle, it may cause network interruption or degradation of communication quality. For example, severe weather conditions such as rain, snow, and fog can cause signal attenuation, especially 5G networks in the millimeter wave frequency band are more susceptible to being affected. Therefore, this solution proposes that the environmental information of the vehicle that can be collected includes but is not limited to the vehicle's location information, the vehicle's driving status information, and / or the vehicle's surrounding environment information. Among them, the vehicle's location information can be the vehicle's GPS coordinate information, or it can be the location category of the vehicle. For example, the location category can be divided into "city", "mountainous area" or "rural area". The vehicle's location information can be represented by obtaining the vehicle's GPS coordinate information from the GPS positioning system, or by determining the vehicle's location category based on the GPS coordinate information. Representing the vehicle's location information by location category can avoid the problem that the model cannot easily distinguish the GPS coordinate location information of adjacent areas. The vehicle's driving state information includes, but is not limited to, driving state information such as vehicle speed, engine speed, vehicle acceleration, and steering angle. The vehicle's driving state information such as acceleration and steering angle can be obtained from vehicle sensors, and the vehicle's driving state information such as vehicle speed and engine speed can be obtained from the OBD system. The vehicle's surrounding environment information includes, but is not limited to, surrounding environment information such as temperature, humidity, altitude, and traffic conditions captured by the vehicle's onboard camera.
[0034] The user's network preference data can reflect the user's personalized network usage needs. Considering the user's network preference when evaluating network quality can meet the personalized needs of different user groups. For example, some users prefer network types with lower energy consumption. At this time, if the network quality is evaluated only based on network performance parameters, a higher quality score will be given to the vehicle-mounted network with higher performance. This evaluation standard cannot meet the user's preference for network types with lower energy consumption. However, this solution can increase the quality score of the network by considering the user's network preference during the evaluation process, thereby reflecting the user's preference for the network type. The user's network preference data may include network preference configuration options. For example, if the user selects the 5G priority network preference configuration option in the network configuration interface, it can indicate that the user prefers to use the 5G network first. Of course, the network preference can also be set in combination with the usage scenario, which includes but is not limited to energy consumption priority, performance priority or stability priority. For example, the network preference configuration option may include an option to prioritize 4G in energy-saving scenarios.
[0035] This solution selects network evaluation indicators from multiple dimensions such as network performance, vehicle environment, and user preferences, so that the subsequent attention model can more comprehensively evaluate the network quality of the vehicle network. In addition, by providing more dimensional context about network quality, it is also beneficial for the attention mechanism to discover the correlation between various network evaluation indicators, thereby improving the accuracy of dynamically assigning weights to various network evaluation indicators.
[0036] After determining multiple network evaluation indicators for each vehicle network, for each vehicle network, a feature vector for characterizing the characteristics of the vehicle network can be constructed based on these network evaluation indicators, and the weighted value vector corresponding to the feature vector can be calculated using the attention model, and the element values in the weighted value vector can be summed to obtain the attention score of the vehicle network. Since the steps for calculating the attention score of any vehicle network are the same, one vehicle network is selected for exemplary description:
[0037] In an illustrated embodiment, a feature vector for characterizing the characteristics of the vehicle network can be constructed based on multiple network evaluation indicators of the vehicle network obtained in the above-mentioned embodiment. Exemplarily, for each network evaluation indicator obtained, a feature subvector for characterizing the characteristics of the network evaluation indicator can be created, and the feature subvectors of each network evaluation indicator can be spliced into a feature vector for characterizing the characteristics of the vehicle network. Specifically, for example, it is assumed that the obtained network evaluation indicator includes different data such as throughput, bandwidth utilization, packet loss rate, GPS location information of the vehicle, vehicle speed, and setting name in the network preference configuration option. Vectorized representation can be performed for each obtained network evaluation indicator, for example, vectorized representation as different feature subvectors such as [throughput], [bandwidth utilization], [packet loss rate], [GPS location information], [vehicle speed], [network preference setting option]. Among them, for numerical variables, such as throughput, bandwidth utilization, and packet loss rate, the numerical representation of the collected network evaluation indicators can be directly used. For example, assuming that the throughput is 0.6, the vectorized representation is [0.6]. For discrete variables, such as network preference configuration options, vectors can also be used to represent the data in the user's network preference configuration options to facilitate processing by the attention model. For example, assuming that the content in the obtained network preference configuration options is usage scenario + vehicle network type, [x, y] can be used to represent the content, where x represents the usage scenario and y represents the vehicle network type. Assume that the energy-saving priority scenario is marked as 1, the performance priority scenario is marked as 2, and the stability priority scenario is marked as 3. y=1 indicates that the vehicle network type is preferred, and y=0 indicates that the vehicle network type is not preferred. The user selects the network preference configuration option of 4G priority in the energy-saving scenario. For the 4G network, the user's network preference data can be represented by [1, 1]. For other vehicle networks, the user's network preference data can be represented by [0, 0], indicating that the user has no network preference for these vehicle networks. Optionally, after creating the feature subvector, each feature subvector can be normalized or standardized to unify data of different ranges and units into the same numerical range to ensure comparability between data. Finally, the feature sub-vectors of each network evaluation index can be spliced into a feature vector for characterizing the characteristics of the vehicle network. For example, the splicing method can be [[throughput], [bandwidth utilization], [packet loss rate], [GPS location information], [vehicle speed], [network preference setting options]], which can be used to characterize the characteristics of the vehicle network.
[0038] In an illustrated embodiment, a weighted value vector corresponding to a feature vector used to characterize the characteristics of the in-vehicle network may be calculated based on an attention model, and element values in the weighted value vector may be summed to obtain an attention score of the in-vehicle network.
[0039] Specifically, the attention model can adopt the existing Transformer model. In addition, those skilled in the art can also customize the model architecture of the attention model according to the principle of the self-attention mechanism. This specification does not impose any restrictions on this.
[0040] In an illustrated embodiment, the step of calculating a weighted value vector corresponding to a feature vector using an attention model includes:
[0041] Construct the query vector, key vector, and value vector corresponding to the feature vector respectively. For example,
[0042] Q=W Q X
[0043] K=W K X
[0044] V=W V X
[0045] Where Q represents the query vector, K represents the key vector, V represents the value vector, and X represents the feature vector input to the attention model. Q , W K , W V is the weight matrix obtained by training the attention model.
[0046] The query vector is multiplied by the key vector to obtain the attention weight, and the weighted sum of the attention weight and the value vector is calculated to obtain the weighted value vector corresponding to the feature vector. For example:
[0047]
[0048] in, represents the attention weight. SoftMax(.) represents the normalization process, d k is the dimension of the key vector, used to scale the product of the query vector and the key vector. Attention(Q, K, V) represents the weighted value vector.
[0049] The above only shows the use of a single-head attention mechanism to calculate the weighted value vector. It can be understood that the present solution can also use a multi-head attention mechanism to calculate the weighted value vector.
[0050] Finally, the element values in the weighted value vector are summed to obtain the attention score of the vehicle network. For example, assuming that the weighted value vector is [x1, x2, ..., xn], xi represents the element value in the weighted value vector, x1, x2, ..., xn can be summed to obtain the attention score. Among them, the attention score is used to comprehensively reflect the current network quality of the vehicle network. The higher the attention score, the higher the current network quality of the vehicle network. The lower the attention score, the lower the current network quality of the vehicle network.
[0051] In related technologies, attention mechanisms are mainly used in technical fields such as natural language processing and computer vision. This solution takes into account that the performance of the vehicle network is affected by the vehicle environment and user preferences. For example, when the vehicle speed is high, latency and signal strength may be more important than bandwidth; when the vehicle stops, bandwidth may be given priority. The vehicle network environment is complex and changeable, especially in situations such as high-speed driving and cross-regional network switching, where network conditions and requirements are constantly changing. This solution applies the attention mechanism to the switching scenario of the vehicle network, and uses the attention mechanism to dynamically assign weights to different network evaluation indicators according to changes in the network environment, so that network switching does not rely on a single network evaluation indicator to make decisions, but weights the comprehensive performance of each network based on the interaction of multiple network evaluation indicators, and then accurately selects the most suitable network. For example, when a vehicle enters a highway from a city, the attention model automatically adjusts the weights, giving priority to signal coverage and latency, and reducing dependence on bandwidth. This approach can significantly improve the accuracy of network selection and reduce the chance of incorrect switching.
[0052] In an illustrated embodiment, regarding the method of preparing a sample data set of an attention model and the selection of a loss function, see the following embodiment:
[0053] First, collect and create a large number of sample data sets containing various vehicle networks. Simulation tools (such as SUMO, Veins, NS-3, etc.) can be used to simulate different traffic environments and network environments, and training samples can be generated by simulating different vehicle communication technologies and various network conditions.
[0054] Secondly, the loss function used to train the attention model can be a single loss function or composed of multiple sub-loss functions. The optimization objectives of each sub-loss function are different and the loss value of each sub-loss function is assigned different weights. For example, the sub-loss functions of the loss function may include but are not limited to a loss function that maximizes bandwidth utilization, a loss function that minimizes delay, and a loss function that minimizes energy consumption. The weights of different sub-loss functions can depend on the optimization goal. For example, if the attention model is expected to generate a higher attention score for a network with a smaller delay rate, the weight of the loss function that minimizes delay can be increased; and if the attention model is expected to generate a higher attention score for a network with lower energy consumption, the weight of the loss function that minimizes energy consumption can be increased. In this solution, by setting multiple optimization objectives, the attention model can be trained to comprehensively consider the performance of various aspects of the network and meet the application requirements of various complex environments.
[0055] In an illustrated embodiment, after the attention scores of each vehicle network are calculated, the attention scores of each vehicle network can be compared. When the attention score of the current vehicle network is lower than the attention scores of other vehicle networks, the current vehicle network is switched to the vehicle network with the highest attention score for service communication. When the attention score of the current vehicle network is not lower than the attention scores of other vehicle networks, the current vehicle network continues to be used for service communication.
[0056] In another illustrated embodiment, the vehicle network preferred by the user is determined, for example, the vehicle network type preferred by the user can be obtained from the network preference configuration option. The attention score of the vehicle network calculated is adjusted, and the adjusted attention score is greater than the attention score before adjustment. For example, assuming that the vehicle networks supported by the vehicle are 4G, 5G and Wifi, the currently used vehicle network is 5G, and the vehicle network preferred by the user is 4G. The attention scores of 4G, 5G and Wifi are 0.5, 0.5, and 0.4 respectively. If the influence of user preference is not considered, 5G will continue to be used for business communication. If the influence of user preference is considered, the attention score of 4G is adjusted so that the adjusted attention score is greater than the attention score before adjustment. The adjustment method can be the attention score multiplied by the weighting coefficient, which is greater than 1; or the attention score plus a constant greater than 0. Assuming that the adjusted value of the 4G attention score is 0.6, the adjusted 4G attention score is greater than the attention score of the currently used 5G, so the currently used vehicle network can be switched to the 4G network. When comparing the attention scores of different in-vehicle networks, this scheme increases the attention score of the in-vehicle network preferred by the user, thereby increasing its possibility of being selected, and can tend to satisfy the user's network selection preference as much as possible without affecting the network quality.
[0057] In another illustrated embodiment, when the difference between the attention score of any other vehicle network and the attention score of the current vehicle network is not less than a preset threshold, the current vehicle network is switched to the vehicle network with the highest attention score for business communication. When the difference between the attention score of any other vehicle network and the attention score of the current vehicle network is less than the preset threshold, the current vehicle network continues to be used for business communication. For example, assuming that the vehicle supports 4G, 5G and Wifi, the currently used vehicle network is 5G, and the preset threshold is 0.1. The attention scores of 4G, 5G and Wifi are 0.6, 0.58, and 0.4, respectively. Although the attention score of 4G is greater than that of 5G, if the difference between the attention score of 4G and the attention score of 5G is less than 0.1, 5G can continue to be used for business communication. For another example, suppose the attention scores of 4G, 5G, and Wifi are 0.7, 0.58, and 0.4, respectively. If the difference between the attention score of 4G and the attention score of 5G is greater than 0.1, the current vehicle network can be switched to the 4G network for business communication. When comparing the attention scores of different vehicle networks, this solution sets a preset threshold to avoid frequent network switching due to slight fluctuations in network quality, thereby ensuring the stability of network communication.
[0058] In another illustrated embodiment, the in-vehicle network preferred by the user can be determined, and the calculated attention score of the in-vehicle network can be adjusted, the adjusted attention score is greater than the attention score before adjustment, and the adjusted attention score is used to compare with the attention scores of other in-vehicle networks. Also, when the difference between the attention score of any other in-vehicle network and the attention score of the current in-vehicle network is not less than a preset threshold, the current in-vehicle network is switched to the in-vehicle network with the highest attention score for business communications. When the difference between the attention score of any other in-vehicle network and the attention score of the current in-vehicle network is less than a preset threshold, the current in-vehicle network continues to be used for business communications. This solution can simultaneously meet the user's network selection preferences and avoid unnecessary frequent switching of in-vehicle networks.
[0059] like Figure 2 As shown, Figure 2 This is a schematic diagram of a switching process of an in-vehicle network according to an exemplary embodiment of the present specification.
[0060] When the vehicle uses the current vehicle network for business communication, the switching condition can be triggered at preset time intervals, such as 5 minutes, 10 minutes, etc., to re-evaluate the network quality of each vehicle network on the vehicle, and select the optimal vehicle network for communication based on the evaluation results. In addition, the switching condition can also be triggered when a certain performance parameter of the current vehicle network is not good. The network evaluation indicators of each vehicle network can be obtained from different locations such as the vehicle's user network configuration options, vehicle internal sensors, vehicle equipment logs, vehicle network management system, GPS positioning system, vehicle camera, vehicle sensor and OBD (On-Board Diagnostics) system.
[0061] For each vehicle network, feature extraction is performed on multiple network evaluation indicators of the network, and a feature vector is constructed to characterize the features of the vehicle network. Furthermore, the constructed feature vector is input into the attention model, and after calculation by the attention model, a weighted value vector corresponding to the feature vector is output, and the element values in the weighted value vector are summed to obtain the attention score of the vehicle network. This step is performed for each vehicle network to calculate the attention score of each vehicle network on the vehicle.
[0062] By comparing the attention scores of each vehicle network, it is determined whether network switching is required, and network switching is performed if it is determined that network switching is required. Specifically, if the attention score of the current vehicle network is lower than the attention scores of other vehicle networks, the current vehicle network is switched to the vehicle network with the highest attention score for business communication.
[0063] Corresponding to the embodiments of the aforementioned method, this specification also provides embodiments of a device and a terminal to which it is applied.
[0064] like Figure 3 As shown, Figure 3 It is a structural diagram of an electronic device shown in this specification according to an exemplary embodiment. At the hardware level, the electronic device 300 includes a processor 302, an internal bus 304, a network interface 306, a memory 308 and a non-volatile memory 310, and of course may also include hardware required for other services. One or more embodiments of this specification can be implemented based on software, such as the processor 302 reading the corresponding computer program from the non-volatile memory 310 into the memory 308 and then running it. Of course, in addition to the software implementation, one or more embodiments of this specification do not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is to say, the execution subject of the following processing flow is not limited to each logic module, but can also be hardware or logic devices.
[0065] like Figure 4As shown, Figure 4 This is a block diagram of a switching device for an in-vehicle network according to an exemplary embodiment of the present specification. The device can be applied to Figure 3 In the electronic device 300 shown, the technical solution of this specification is implemented. The device includes:
[0066] The attention score determination module 402 is used to determine, for each type of vehicle network, a plurality of network evaluation indicators of the vehicle network during the process of the vehicle using the current vehicle network for business communication, and construct a feature vector for characterizing the characteristics of the vehicle network based on the plurality of network evaluation indicators; and calculate a weighted value vector corresponding to the feature vector using an attention model, and sum the element values in the weighted value vector to obtain an attention score of the vehicle network;
[0067] The vehicle network switching module 404 is used to switch the current vehicle network to the vehicle network with the highest attention score for service communication when the attention score of the current vehicle network is lower than the attention scores of other vehicle networks.
[0068] Optionally, the types of the network evaluation indicators include performance indicators of the vehicle network, environmental information of the vehicle, and network preference data of the user.
[0069] Optionally, the performance indicators of the in-vehicle network include throughput, bandwidth utilization and / or packet loss rate; and / or, the vehicle's environmental information includes vehicle location information, vehicle driving status information and / or vehicle's surrounding environment information; and / or, the user's network preference data includes network preference configuration options.
[0070] Optionally, the attention score determination module 402 is specifically used to create a feature sub-vector for characterizing the characteristics of each network evaluation indicator; and splice the feature sub-vectors of each network evaluation indicator into a feature vector for characterizing the characteristics of the vehicle network.
[0071] Optionally, the device further includes an attention score adjustment module 406, which is used to determine the in-vehicle network preferred by the user and adjust the calculated attention score of the in-vehicle network, wherein the adjusted attention score is greater than the attention score before the adjustment.
[0072] Optionally, a difference between the attention score of at least one other in-vehicle network and the attention score of the current in-vehicle network is not less than a preset threshold.
[0073] Optionally, the attention score determination module 402 is specifically used to construct a query vector, a key vector and a value vector corresponding to the feature vector, respectively; multiply the query vector and the key vector to obtain an attention weight; and calculate the weighted sum of the attention weight and the value vector to obtain a weighted value vector corresponding to the feature vector.
[0074] Optionally, the loss function used to train the attention model is composed of multiple sub-loss functions, each sub-loss function has a different optimization objective and the loss value of each sub-loss function is assigned a different weight.
[0075] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, which will not be repeated here.
[0076] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this specification. Ordinary technicians in this field can understand and implement it without paying creative work.
[0077] The present specification also provides a computer-readable storage medium having a computer program stored thereon, and when the program is executed by a processor, the steps of any of the aforementioned vehicle network switching methods provided in the present application are implemented.
[0078] Specifically, computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media and memory devices, including, for example, semiconductor memory devices (such as EPROM, EEPROM and flash memory devices), magnetic disks (such as internal hard disks or removable disks), magneto-optical disks, and CD ROM and DVD-ROM disks.
Claims
1. A method for switching an in-vehicle network, characterized in that: The method is applied to a vehicle supporting multiple vehicle networks, including: In the process of the vehicle using the current vehicle network for business communication, for each vehicle network, multiple network evaluation indicators of the vehicle network are determined, and a feature vector for characterizing the characteristics of the vehicle network is constructed based on the multiple network evaluation indicators; and a weighted value vector corresponding to the feature vector is calculated using an attention model, and element values in the weighted value vector are summed to obtain an attention score of the vehicle network; When the attention score of the current vehicle network is lower than the attention scores of other vehicle networks, the current vehicle network is switched to the vehicle network with the highest attention score for business communication.
2. The method according to claim 1, characterized in that The types of network evaluation indicators include performance indicators of the vehicle network, vehicle environment information and user network preference data.
3. The method according to claim 2, characterized in that The performance indicators of the vehicle network include throughput, bandwidth utilization and / or packet loss rate; and / or, The vehicle environment information includes the vehicle location information, the vehicle driving state information and / or the vehicle surrounding environment information; and / or, The user's network preference data includes network preference configuration options.
4. The method according to claim 1, characterized in that: The constructing a feature vector for characterizing the features of the vehicle network based on the multiple network evaluation indicators includes: For each network evaluation indicator, a feature subvector is created for characterizing the characteristics of the network evaluation indicator; The feature sub-vectors of each network evaluation index are concatenated into a feature vector for characterizing the characteristics of the vehicle network.
5. The method according to claim 1, characterized in that The method further comprises: An in-vehicle network that meets the user's preference is determined, and the calculated attention score of the in-vehicle network is adjusted, where the adjusted attention score is greater than the attention score before the adjustment.
6. The method according to claim 1, characterized in that The attention score of the current vehicle network is lower than the attention scores of other vehicle networks, including: A difference between the attention score of at least one other in-vehicle network and the attention score of the current in-vehicle network is not less than a preset threshold.
7. The method according to claim 1, characterized in that The step of calculating the weighted value vector corresponding to the feature vector by using the attention model includes: Constructing a query vector, a key vector and a value vector corresponding to the feature vector respectively; Multiplying the query vector by the key vector to obtain an attention weight; The weighted sum of the attention weight and the value vector is calculated to obtain a weighted value vector corresponding to the feature vector.
8. The method according to claim 1, characterized in that The loss function used to train the attention model is composed of multiple sub-loss functions, each sub-loss function has a different optimization objective and the loss value of each sub-loss function is assigned a different weight.
9. A switching device for an in-vehicle network, characterized in that: The device is applied to a vehicle supporting multiple vehicle networks, including: an attention score determination module, for determining, for each type of vehicle network, a plurality of network evaluation indicators of the vehicle network during the process of the vehicle using the current vehicle network for business communication, and constructing a feature vector for characterizing the characteristics of the vehicle network based on the plurality of network evaluation indicators; and, using an attention model to calculate a weighted value vector corresponding to the feature vector, and summing the element values in the weighted value vector to obtain an attention score of the vehicle network; The vehicle network switching module is used to switch the current vehicle network to the vehicle network with the highest attention score for business communication when the attention score of the current vehicle network is lower than the attention scores of other vehicle networks.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method according to any one of claims 1 to 8 are implemented.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Road vehicle tracking method and system based on attention mechanism and multi-target tracking
CN114627447A
Vehicle communication switching method and device, equipment and storage medium
CN116916404A
Determination method of poor-quality cell, determination device of poor-quality cell and electronic equipment
CN118803858A
Method and Apparatus for Multi-Lingual End-to-End Speech Recognition
US20190189111A1