Method and apparatus for switching vehicle-mounted network, electronic device and storage medium

By introducing an attention mechanism to dynamically allocate weights in the vehicular network, the problem that existing vehicular network switching methods cannot adapt to complex environments is solved, achieving more accurate network selection and stable communication.

CN119854895BActive Publication Date: 2025-11-04ZHEJIANG GEELY HLDG GRP CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411754109.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-02
Publication Date
2025-11-04
Estimated Expiration
2044-12-02

AI Technical Summary

Technical Problem

Existing in-vehicle network switching methods are too rigid and cannot adapt to complex network environments, resulting in inaccurate network selection.

Method used

An attention mechanism is used to dynamically allocate the weights of network evaluation metrics. The attention score of the in-vehicle network is calculated by constructing feature vectors and weighted value vectors, and the best network is adaptively selected for switching.

Benefits of technology

It improves the accuracy of network selection, reduces the chance of incorrect handover, and meets the needs of different network environments and user preferences.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119854895B_ABST
    Figure CN119854895B_ABST
Patent Text Reader

Abstract

The specification provides a switching method and device of an in-vehicle network, electronic equipment and a storage medium, the method is applied to a vehicle supporting multiple in-vehicle networks, comprising: in the process that the vehicle uses a current in-vehicle network for business communication, for each in-vehicle network, determining multiple network evaluation indexes of the in-vehicle network, and constructing a feature vector for representing the features of the in-vehicle network based on the multiple network evaluation indexes; 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 in-vehicle network. In the case that the attention score of the current in-vehicle network is lower than the attention scores of other in-vehicle networks, the current in-vehicle network is switched to the in-vehicle network with the highest attention score for business communication.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of vehicle networking technology, and in particular to methods, devices, electronic devices and storage media for switching in-vehicle networks. Background Technology

[0002] In modern vehicular communication networks, different types and technologies are often encountered, such as 4G, 5G, and Wi-Fi, each with varying performance, coverage, and costs. In vehicular network environments, vehicles are typically in a state of rapid movement and require continuous connectivity to ensure the stability of various services (such as navigation, communication, media playback, and safety functions). Therefore, vehicular network switching is the process by which the vehicle terminal automatically switches from the current vehicular network to another available vehicular network when the current network's coverage is at the edge or signal quality deteriorates, ensuring uninterrupted communication.

[0003] Related technologies propose rule-based switching methods for vehicular networks. For example, a rule engine continuously monitors the performance parameters of the current vehicular network (such as signal strength, bandwidth, and latency). If a performance parameter of the current vehicular network falls below a set threshold, such as signal strength, the rule engine triggers a switching condition, evaluates all available candidate networks, and determines the optimal target network based on rule priority ranking (such as signal strength, bandwidth, and latency). Then, the current network is switched to the target network for communication. However, the above rule-based vehicular network switching methods are too rigid and cannot cover various complex network environments. Summary of the Invention

[0004] To overcome the problems existing in related technologies, this specification provides a method, apparatus, electronic device and storage medium for switching in-vehicle networks.

[0005] According to a first aspect of the embodiments of this specification, a method for switching vehicular networks is provided, the method being applied to a vehicle supporting multiple vehicular networks, comprising:

[0006] During the process of the vehicle using the current in-vehicle network for service communication, for each in-vehicle network, multiple network evaluation indicators of the in-vehicle network are determined, and a feature vector is constructed based on the multiple network evaluation indicators to characterize the features of the in-vehicle network; and an attention model is used to calculate the weighted value vector corresponding to the feature vector, and the element values ​​in the weighted value vector are summed to obtain the attention score of the in-vehicle network.

[0007] If the attention score of the current vehicle network is lower than that of other vehicle networks, the current vehicle network will be switched to the vehicle network with the highest attention score for service communication.

[0008] According to a second aspect of the embodiments of this specification, a switching device for an in-vehicle network is provided, the device being applied to a vehicle supporting multiple in-vehicle networks, comprising:

[0009] The attention score determination module is used to determine multiple network evaluation indicators for each type of vehicle network during the process of the vehicle using the current vehicle network for service communication, and to construct a feature vector to characterize the features of the vehicle network based on the multiple network evaluation indicators; and to calculate the weighted value vector corresponding to the feature vector using an attention model, and to sum the element values ​​in the weighted value vector to obtain the 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 that of other vehicle networks.

[0011] According to a third aspect of the embodiments of this specification, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the method as described in the first aspect.

[0012] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the method as described in the first aspect.

[0013] The technical solutions provided in the embodiments of this specification may include the following beneficial effects:

[0014] In the embodiments of this specification, when using multiple network evaluation metrics to jointly assess the network status of a certain vehicular network in the current network environment, this solution considers the correlation between different network evaluation metrics and dynamically assigns weights to different network evaluation metrics based on an attention mechanism. This reflects the importance of each network evaluation metric 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 vehicular network. The attention score comprehensively reflects the network status of the vehicular network in the current network environment. Finally, the current vehicular network is switched to the vehicular network with the highest attention score. It can be seen that this solution, by introducing an attention mechanism, can adaptively adjust the weights of network evaluation metrics in different network environments. This means that the importance of each evaluation metric can dynamically change in different network environments, making the evaluation results more consistent with the actual situation, thereby improving the accuracy of network selection.

[0015] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this specification. Attached Figure Description

[0016] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this specification and, together with the description, serve to explain the principles of this specification.

[0017] Figure 1 This is a flowchart illustrating a method for switching in-vehicle networks according to an exemplary embodiment.

[0018] Figure 2 This is a schematic diagram illustrating a switching process of an in-vehicle network according to an exemplary embodiment of this specification.

[0019] Figure 3 This is a schematic diagram of the structure of an electronic device according to an exemplary embodiment of this specification.

[0020] Figure 4 This is a block diagram illustrating a switching device for an in-vehicle network according to an exemplary embodiment. Detailed Implementation

[0021] In modern vehicular communication networks, different types and technologies are often encountered, such as 4G, 5G, and Wi-Fi, each with varying performance, coverage, and costs. In vehicular network environments, vehicles are typically in a state of rapid movement and require continuous connectivity to ensure the stability of various services (such as navigation, communication, media playback, and safety functions). Therefore, vehicular network switching is the process by which the vehicle terminal automatically switches from the current vehicular network to another available vehicular network when the current network's coverage is at the edge or signal quality deteriorates, ensuring uninterrupted communication. This solution can be applied to vehicles supporting multiple vehicular networks. Furthermore, this solution does not limit the type of vehicular network; it can be 4G, 5G, Wi-Fi, or other types of vehicular networks.

[0022] like Figure 1 As shown, Figure 1 This is a flowchart illustrating a method for switching in-vehicle networks according to an exemplary embodiment, including steps 101-102:

[0023] Step 101: During the process of the vehicle using the current in-vehicle network for service communication, for each in-vehicle network, determine multiple network evaluation indicators for the in-vehicle network, and construct a feature vector to characterize the features of the in-vehicle network based on the multiple network evaluation indicators; and calculate the weighted value vector corresponding to the feature vector using an attention model, and sum the element values ​​in the weighted value vector to obtain the attention score of the in-vehicle network.

[0024] Step 102: If the attention score of the current vehicle network is lower than the attention scores of other vehicle networks, switch the current vehicle network to the vehicle network with the highest attention score for service communication.

[0025] When using multiple network evaluation metrics to jointly assess the network status of a vehicular network in the current network environment, this solution considers the correlation between different network evaluation metrics. Based on an attention mechanism, it dynamically assigns weights to different network evaluation metrics to reflect their importance in the current network scenario. Then, it sums the element values ​​in the weighted vector calculated based on the attention mechanism to obtain the attention score of the vehicular network. This attention score comprehensively reflects the network status of the vehicular network in the current network environment. Finally, it switches the current vehicular network to the one with the highest attention score. It is evident that this solution, by introducing an attention mechanism, can adaptively adjust the weights of network evaluation metrics according to changes in different network environments. This means that the importance of each evaluation metric can dynamically change under different network environments, making the evaluation results more consistent with the actual situation and thus improving the accuracy of network selection.

[0026] Vehicle business communication can encompass communication between various devices within the vehicle or between the vehicle and external systems. Specifically, communication between the vehicle and external systems can include communication between different vehicles, communication between the vehicle and infrastructure (such as traffic lights), communication between the vehicle and portable devices (laptops, mobile phones, or tablets), and communication between the vehicle and cloud servers, among other communication methods.

[0027] During vehicle communication using the current in-vehicle network, a switching condition can be triggered at preset intervals, such as 5 minutes or 10 minutes, to reassess the network quality of each in-vehicle network and switch to the optimal network based on the assessment results. Alternatively, a switching condition can be triggered when a performance parameter of the current in-vehicle network is unsatisfactory.

[0028] Specifically, for each type of vehicular network, multiple network evaluation metrics can be determined, and these metrics are used in subsequent steps to comprehensively evaluate the network quality of each vehicular network. For example, assuming the vehicle supports three vehicular networks—4G, 5G, and Wi-Fi—and is currently using 4G for service communication, multiple network evaluation metrics can be determined to evaluate the quality of each of 4G, 5G, and Wi-Fi. In subsequent steps, these metrics are used to comprehensively evaluate the network quality of each vehicular network. If the currently used 4G network has the highest network quality, there is no need to switch vehicular networks; if any other vehicular network has the highest network quality, the current 4G network is switched to the vehicular network with the highest network quality for service communication.

[0029] The network evaluation metrics are primarily used to assess the ability of the vehicular network to meet users' network requirements. For example, the network evaluation metrics used in this solution may include only a few performance indicators reflecting the vehicular network performance, such as throughput, bandwidth utilization, and / or packet loss rate. In addition, environmental information about the vehicle may be included, such as vehicle location information, vehicle driving status information, and / or information about the vehicle's surrounding environment. Of course, user network preference data, such as network preference configuration options, may also be included. Furthermore, other types of network evaluation metrics can be used; this solution does not limit the specific content of the network evaluation metrics.

[0030] In one illustrated embodiment, the types of network evaluation metrics may include, but are not limited to, performance metrics of the vehicular network, vehicle environmental information, and user network preference data.

[0031] Specifically, the performance metrics of an vehicular network can include, but are not limited to, throughput, bandwidth utilization, and / or packet loss rate. Throughput refers to the amount of data that the vehicular network can transmit per unit of time. Bandwidth utilization refers to the percentage of valid data in the available bandwidth of the vehicular network. Packet loss rate refers to the proportion of data packets lost during network transmission out of the transmitted data packets. It is understandable that other performance metrics can also reflect the network performance of the vehicular network, such as latency and energy consumption.

[0032] This solution can utilize one or more performance metrics of the vehicular network. These performance metrics can be obtained through various means, including but not limited to real-time monitoring of in-vehicle sensors, such as throughput and signal strength. They can also be obtained from vehicle device logs (e.g., GPS navigation systems, entertainment systems). Furthermore, performance metrics such as bandwidth utilization and connection status can be obtained from the vehicular network management system.

[0033] The vehicle's environment also significantly impacts network connectivity quality and performance. For example, different geographical locations (such as cities, rural areas, or highways) have vastly different effects on network quality. Urban areas typically offer good network coverage but may experience congestion, while remote areas may suffer from insufficient coverage. Assessing the vehicle's geographical location allows for a more accurate assessment of network quality and coverage. For instance, vehicle speed directly affects network stability, especially when using cellular networks, where vehicles may frequently switch between base stations. If the switching speed cannot keep pace with the vehicle's movement, network outages or degraded communication quality may occur. Furthermore, adverse weather conditions such as rain, snow, and fog can cause signal attenuation, particularly affecting millimeter-wave 5G networks. Therefore, this solution proposes collecting environmental information about the vehicle, including but not limited to its location, driving status, and / or surrounding environment. The vehicle's location information can be its GPS coordinates or its location category, such as "urban," "mountainous," or "rural." Vehicle location information can be represented by GPS coordinates obtained from a GPS positioning system, or by determining the vehicle's location category based on GPS coordinates. Representing the vehicle's location by location category avoids the problem of the model not being able to distinguish GPS coordinates in neighboring areas. Vehicle driving status information includes, but is not limited to, vehicle speed, engine speed, vehicle acceleration, and steering angle. This driving status information can be obtained from vehicle sensors, such as acceleration and steering angle, as well as from the OBD system. Surrounding environmental information includes, but is not limited to, temperature, humidity, altitude, and traffic conditions captured by onboard cameras.

[0034] User network preference data can reflect their personalized network usage needs. Considering user network preferences when evaluating network quality can meet the individual needs of different user groups. For example, some users prefer lower-power network types. If network quality is evaluated solely based on network performance parameters, higher-performance in-vehicle networks would receive higher quality scores, failing to meet the user's preference for lower-power networks. This solution, by considering user network preferences during the evaluation process, can increase the weight of lower-power network types to improve their quality scores, thus reflecting the user's preference for that network type. User network preference data can include network preference configuration options. For example, if a user selects the 5G-first network preference option in the network configuration interface, it indicates that the user prefers to use the 5G network. Of course, network preferences can also be set based on usage scenarios, including but not limited to power consumption priority, performance priority, or stability priority. For example, network preference configuration options could include a 4G-first option in energy-saving scenarios.

[0035] This solution selects network evaluation metrics from multiple dimensions, including network performance, vehicle environment, and user preferences, enabling the subsequent attention model to more comprehensively evaluate the network quality of the vehicular network. Furthermore, by providing more contextual information about network quality, the attention mechanism can better discover the correlations between various network evaluation metrics, thereby improving the accuracy of dynamically assigning weights to each metric.

[0036] After determining multiple network evaluation metrics for each in-vehicle network, for each in-vehicle network, a feature vector representing the network's characteristics can be constructed based on these metrics. A weighted vector corresponding to this feature vector is then calculated using an attention model, and the element values ​​in the weighted vector are summed to obtain the attention score of the in-vehicle network. Since the steps for calculating the attention score of any in-vehicle network are the same, an example of an in-vehicle network will be provided below:

[0037] In one illustrated embodiment, a feature vector characterizing the features of the vehicular network can be constructed based on multiple network evaluation metrics obtained from the aforementioned embodiments. For example, for each obtained network evaluation metric, a feature sub-vector characterizing that metric can be created, and the feature sub-vectors of each metric can be concatenated to form a feature vector characterizing the features of the vehicular network. Specifically, for example, suppose the obtained network evaluation metrics include different data such as throughput, bandwidth utilization, packet loss rate, vehicle GPS location information, vehicle speed, and setting names in network preference configuration options. Each obtained network evaluation metric can be vectorized, for example, vectorized as different feature sub-vectors such as [throughput], [bandwidth utilization], [packet loss rate], [GPS location information], [vehicle speed], and [network preference settings]. For numerical variables, such as throughput, bandwidth utilization, and packet loss rate, the numerical representation of the collected network evaluation metrics can be directly used. For example, suppose the throughput is 0.6, then it can be vectorized as [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 the content of the obtained network preference configuration options is usage scenario + vehicle network type, it can be represented by [x, y], where x represents the usage scenario and y represents the vehicle network type. Assume that the energy-saving priority scenario is labeled as 1, the performance-priority scenario as 2, and the stability-priority scenario as 3. y = 1 indicates a preference for this vehicle network type, and y = 0 indicates no preference for this vehicle network type. If the user selects the 4G priority network preference configuration option in the energy-saving scenario, then 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 preference for these vehicle networks. Optionally, after creating the feature sub-vectors, each feature sub-vector can be normalized or standardized to unify data of different ranges and units to the same numerical range to ensure comparability between data. Finally, the feature vectors of each network evaluation metric can be concatenated into a feature vector that characterizes the features of the vehicular network. For example, the concatenation method could be [[throughput], [bandwidth utilization], [packet loss rate], [GPS location information], [vehicle speed], [network preference settings]], which can be used to characterize the features of the vehicular network.

[0038] In one illustrated embodiment, a weighted vector corresponding to the feature vector used to characterize the features of the in-vehicle network can be calculated based on an attention model, and the element values ​​in the weighted vector can be summed to obtain the attention score of the in-vehicle network.

[0039] Specifically, the attention model can employ the existing Transformer model. Furthermore, those skilled in the art can customize the model architecture of the attention model based on the principles of self-attention mechanisms. This specification does not impose any limitations in this regard.

[0040] In one illustrated embodiment, the step of calculating the weighted vector corresponding to the feature vector using the attention model includes:

[0041] Construct the query vector, key vector, and value vector corresponding to the feature vectors 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 The weight matrix obtained for training this attention model.

[0046] The attention weights are obtained by multiplying the query vector and the key vector, and a weighted sum of the attention weights and the value vectors is calculated to obtain the weighted value vector corresponding to the feature vector. For example:

[0047]

[0048] in, This represents the attention weights. SoftMax(.) indicates normalization, d k It represents 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 vector.

[0049] The above only shows the use of a single-head attention mechanism to calculate the weighted vector. It can be understood that this scheme can also use a multi-head attention mechanism to calculate the weighted vector.

[0050] Finally, the element values ​​in the weighted vector are summed to obtain the attention score of the vehicular network. For example, assuming the weighted vector is [x1, x2, ..., xn], where xi represents the element value in the weighted vector, the attention score can be obtained by summing x1, x2, ..., xn. The attention score comprehensively reflects the current network quality of the vehicular network. A higher attention score indicates a higher current network quality, while a lower attention score indicates a lower current network quality.

[0051] In related technologies, attention mechanisms are mainly applied in fields such as natural language processing and computer vision. This solution considers that the performance of vehicular networks is affected by the vehicle environment and user preferences. For example, at high speeds, latency and signal strength may be more important than bandwidth; while when the vehicle is stationary, bandwidth may be prioritized. The vehicular network environment is complex and variable, especially during high-speed driving and cross-regional network handovers, where network conditions and requirements constantly change. This solution applies the attention mechanism to vehicular network handover scenarios, dynamically assigning weights to different network evaluation metrics based on changes in the network environment. This allows network handover decisions to be made based on the interaction of multiple network evaluation metrics, weighted to calculate the overall performance of each network, thereby accurately selecting the most suitable network. For example, when a vehicle enters a highway from a city, the attention model automatically adjusts the weights, prioritizing signal coverage and latency while reducing reliance on bandwidth. This approach can significantly improve the accuracy of network selection and reduce the probability of erroneous handovers.

[0052] In one illustrated embodiment, the method for creating the sample dataset for the attention model and the selection of the loss function are described in the following example:

[0053] First, a large sample dataset containing various vehicular networks is collected and created. Simulation tools (such as SUMO, Veins, NS-3, etc.) can be used to simulate different traffic and network environments, generating training samples by simulating different vehicular 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. Each sub-loss function has a different optimization objective, and the loss value of each sub-loss function is assigned a different weight. For example, the sub-loss functions can include, but are not limited to, loss functions that maximize bandwidth utilization, minimize latency, and minimize energy consumption. The weights of different sub-loss functions can be determined according to the optimization objective. For example, if the goal is for the attention model to generate higher attention scores for networks with lower latency, the weight of the latency-minimizing loss function can be increased; conversely, if the goal is for the attention model to generate higher attention scores for networks with lower energy consumption, the weight of the energy-minimizing loss function can be increased. In this scheme, by setting multiple optimization objectives, the attention model can be trained to comprehensively consider various aspects of network performance, meeting the application requirements of various complex environments.

[0055] In one illustrated embodiment, after calculating the attention scores of each vehicular network, the attention scores of each vehicular network can be compared. If the attention score of the current vehicular network is lower than that of other vehicular networks, the current vehicular network is switched to the vehicular network with the highest attention score for service communication. If the attention score of the current vehicular network is not lower than that of other vehicular networks, the current vehicular network continues to be used for service communication.

[0056] In another illustrated embodiment, the user's preferred in-vehicle network is determined, for example, by obtaining the preferred in-vehicle network type from network preference configuration options. The calculated attention score of this in-vehicle network is adjusted so that the adjusted attention score is greater than the original attention score. For example, suppose the vehicle supports 4G, 5G, and Wi-Fi in-vehicle networks, the currently used in-vehicle network is 5G, and the user's preferred in-vehicle network is 4G. The attention scores for 4G, 5G, and Wi-Fi are 0.5, 0.5, and 0.4, respectively. If the influence of user preference is not considered, 5G continues to be used for service 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 original attention score. The adjustment method can be by multiplying the attention score by a weighting coefficient greater than 1; or by adding a constant greater than 0 to the attention score. Suppose the adjusted value of the 4G attention score is 0.6, which is greater than the currently used 5G attention score, therefore the currently used in-vehicle network can be switched to the 4G network. When comparing the attention scores of different in-vehicle networks, this solution increases the likelihood of the network being selected by improving the attention score of the network preferred by the user. This approach aims to better meet the user's network selection preferences without compromising network quality.

[0057] In another illustrated embodiment, if the difference between the attention score of any other vehicular network and the attention score of the current vehicular network is not less than a preset threshold, the current vehicular network is switched to the one with the highest attention score for service communication. If the difference between the attention score of any other vehicular network and the attention score of the current vehicular network is less than the preset threshold, the current vehicular network continues to be used for service communication. For example, assuming the vehicle supports 4G, 5G, and Wi-Fi vehicular networks, and the currently used vehicular network is 5G, with a preset threshold of 0.1, the attention scores for 4G, 5G, and Wi-Fi are 0.6, 0.58, and 0.4, respectively. Although the attention score of 4G is greater than that of 5G, the difference between the attention scores of 4G and 5G is less than 0.1, so 5G can continue to be used for service communication. For example, suppose the attention scores for 4G, 5G, and Wi-Fi are 0.7, 0.58, and 0.4, respectively. If the difference between the 4G and 5G attention scores is greater than 0.1, the current in-vehicle network can be switched to 4G for service communication. This solution, by setting a preset threshold when comparing the attention scores of different in-vehicle networks, avoids frequent network switching due to minor fluctuations in network quality, thus ensuring the stability of network communication.

[0058] In another illustrated embodiment, a user-preferred in-vehicle network can be determined, and the calculated attention score of that in-vehicle network can be adjusted. The adjusted attention score is higher than the original attention score, and this adjusted score is compared with the attention scores of other in-vehicle networks. Furthermore, if 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 one with the highest attention score for service communication. If 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 the preset threshold, the current in-vehicle network continues to be used for service communication. This solution can simultaneously satisfy 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 illustrating a switching process of an in-vehicle network according to an exemplary embodiment of this specification.

[0060] During vehicle communication using the current in-vehicle network, switching conditions can be triggered at preset intervals, such as 5 minutes or 10 minutes, to reassess the network quality of each in-vehicle network and select the optimal network for communication based on the evaluation results. Additionally, switching conditions can be triggered when a performance parameter of the current in-vehicle network is unsatisfactory. Network evaluation metrics for each in-vehicle network can be obtained from various sources, including user network configuration options, in-vehicle sensors, in-vehicle device logs, the in-vehicle network management system, GPS positioning system, in-vehicle cameras, in-vehicle sensors, and the OBD (On-Board Diagnostics) system.

[0061] For each in-vehicle network, features are extracted from multiple network evaluation metrics to construct a feature vector representing the characteristics of the in-vehicle network. The constructed feature vector is then input into an attention model. After calculation by the attention model, a weighted vector corresponding to the feature vector is output, and the element values ​​in the weighted vector are summed to obtain the attention score of the in-vehicle network. This step is performed for each in-vehicle network to calculate the attention score of each in-vehicle network in the vehicle.

[0062] The need for network switching is determined by comparing the attention scores of various vehicular networks, and a network switch is performed if it is determined that a switch is necessary. Specifically, if the attention score of the current vehicular network is lower than that of other vehicular networks, the current vehicular network is switched to the vehicular network with the highest attention score for service communication.

[0063] Corresponding to the embodiments of the foregoing methods, this specification also provides embodiments of the apparatus and the terminal to which it is applied.

[0064] like Figure 3 As shown, Figure 3 This is a schematic diagram illustrating the structure of an electronic device 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, memory 308, and non-volatile memory 310, and may also include other hardware required for various services. One or more embodiments of this specification can be implemented in software, for example, the processor 302 reads the corresponding computer program from the non-volatile memory 310 into memory 308 and then runs it. Of course, besides software implementation, one or more embodiments of this specification do not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. That is to say, the execution entity of the following processing flow is not limited to individual logic modules, but can also be hardware or logic devices.

[0065] like Figure 4As shown, Figure 4 This is a block diagram illustrating a switching device for an in-vehicle network according to an exemplary embodiment. This device can be applied to, for example... Figure 3 The electronic device 300 shown implements the technical solution of this specification. The device includes:

[0066] The attention score determination module 402 is used to determine multiple network evaluation indicators for each type of vehicle network during the process of the vehicle using the current vehicle network for service communication, and to construct a feature vector to characterize the features of the vehicle network based on the multiple network evaluation indicators; and to calculate the weighted value vector corresponding to the feature vector using an attention model, and to sum the element values ​​in the weighted value vector to obtain the 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 that of other vehicle networks.

[0068] Optionally, the types of network evaluation metrics include performance metrics of the vehicular network, vehicle environmental information, and user network preference data.

[0069] Optionally, the performance indicators of the vehicular network include throughput, bandwidth utilization and / or packet loss rate; and / or, the environmental information of the vehicle includes the vehicle's location information, the vehicle's driving status information and / or the 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 representing the features of the network evaluation index for each network evaluation index; and to concatenate the feature sub-vectors of each network evaluation index into a feature vector representing the features of the vehicular network.

[0071] Optionally, the device further includes an attention score adjustment module 406, used to determine the user's preferred in-vehicle network and adjust the calculated attention score of the in-vehicle network, wherein the adjusted attention score is greater than the original attention score.

[0072] Optionally, the 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 the query vector, key vector, and value vector corresponding to the feature vector respectively; multiply the query vector and the key vector to obtain the attention weight; and calculate the weighted sum of the attention weight and the value vector to obtain the weighted value vector corresponding to the feature vector.

[0074] Optionally, the loss function used to train the attention model consists of multiple sub-loss functions, each with a different optimization objective and a different weight assigned to its loss value.

[0075] The specific implementation process of the functions and roles of each module in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.

[0076] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of the solution in this specification according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0077] This specification also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the aforementioned vehicle network switching methods provided in this application.

[0078] Specifically, computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media, and memory devices, such as semiconductor memory devices (e.g., EPROM, EEPROM, and flash memory devices), magnetic disks (e.g., internal hard disks or removable disks), magneto-optical disks, and CD-ROM and DVD-ROM disks.

Claims

1. A method for switching in-vehicle networks, characterized in that, The method is applied to vehicles that support multiple vehicular networks, including: During the process of the vehicle using the current in-vehicle network for service communication, for each in-vehicle network, multiple network evaluation metrics are determined, and a feature vector characterizing the features of the in-vehicle network is constructed based on these metrics. This includes: for each network evaluation metric, creating a feature sub-vector characterizing the features of that metric; concatenating the feature sub-vectors of each metric into a feature vector characterizing the features of the in-vehicle network; and calculating a weighted value vector corresponding to the feature vector using an attention model, and summing the element values ​​in the weighted value vector to obtain the attention score of the in-vehicle network. The types of network evaluation metrics include performance metrics of vehicular networks, vehicle environmental information, and user network preference data; the calculation of the weighted value vector corresponding to the feature vector using the attention model includes: constructing a query vector, key vector, and value vector corresponding to the feature vector respectively; multiplying the query vector and the key vector to obtain the attention weight; and calculating the weighted sum of the attention weight and the value vector to obtain the weighted value vector corresponding to the feature vector; the loss function used to train the attention model consists of multiple sub-loss functions, each with a different optimization objective and each sub-loss function's loss value is assigned a different weight; Identify the in-vehicle network that matches user preferences and adjust the calculated attention score of that in-vehicle network. The adjusted attention score is greater than the original attention score. If the attention score of the current vehicle network is lower than that of other vehicle networks, the current vehicle network will be switched to the vehicle network with the highest attention score for service communication.

2. The method according to claim 1, characterized in that, The performance metrics of the vehicular network include throughput, bandwidth utilization, and / or packet loss rate; and / or, The vehicle's environmental information includes the vehicle's location information, the vehicle's driving status information, and / or the vehicle's surrounding environment information; and / or, The user's network preference data includes network preference configuration options.

3. The method according to claim 1, characterized in that, The current in-vehicle network's attention score is lower than that of other in-vehicle networks, including: The 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.

4. A switching device for an in-vehicle network, characterized in that, The device is used in vehicles that support multiple vehicular networks, including: The attention score determination module is used to, during the process of the vehicle using the current in-vehicle network for service communication, determine multiple network evaluation metrics for each in-vehicle network, and construct a feature vector representing the characteristics of the in-vehicle network based on the multiple network evaluation metrics. This includes: for each network evaluation metric, creating a feature sub-vector representing the characteristics of that network evaluation metric; concatenating the feature sub-vectors of each network evaluation metric into a feature vector representing the characteristics of the in-vehicle network; and calculating a weighted value vector corresponding to the feature vector using an attention model, and summing the element values ​​in the weighted value vector to obtain the attention score of the in-vehicle network. Attention score; the types of network evaluation indicators include performance indicators of in-vehicle networks, vehicle environmental information, and user network preference data; the calculation of the weighted value vector corresponding to the feature vector using the attention model includes: constructing the query vector, key vector, and value vector corresponding to the feature vector respectively; multiplying the query vector and the key vector to obtain the attention weight; calculating the weighted sum of the attention weight and the value vector to obtain the weighted value vector corresponding to the feature vector; the loss function used to train the attention model consists of multiple sub-loss functions, each with a different optimization objective and each sub-loss function's loss value is assigned a different weight; The attention score adjustment module is used to determine the in-vehicle network that meets the user's preferences and adjust the calculated attention score of the in-vehicle network. The adjusted attention score is greater than the original attention score. 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 that of other vehicle networks.

5. 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, it implements the steps of the method as described in any one of claims 1-3.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by a processor, it implements the steps of the method as described in any one of claims 1-3.

Citation Information

Patent Citations

  • 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