Communication link adjustment method and electronic device

CN123021101APending Publication Date: 2026-10-30GREAT WALL MOTOR CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611171819.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-04
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

该类调度行为完全封闭于运营商内网,仅由运营商网管系统内部决策执行,不存在对外开放通知接口,无法主动同步至下游车联网平台,导致平台链路绑定设备与运营商实际承载设备错位,进而引起平台无法接收上行报文、平台消息重复、业务乱序、通信时延增加、计费异常等问题

Benefits of technology

[0008]从上面所述可以看出,本申请提供的通信链路调整方法,获取主用通信链路的第一运行数据与备用通信链路的第二运行数据,通过第一运行数据确定主用通信链路的链路健康度,实现对主用通信链路的健康状态的实时检测,该方法考虑到运营商切换设备可以引起平台链路绑定设备与运营商实际承载设备错位,进而导致主用通信链路健康度下降,在主用通信链路的链路健康度低于预设异常阈值的情况下,进一步通过第一运行数据和第二运行数据,确定使用的网关通信设备发生切换的风险值,以准确识别运营商从使用主用通信链路绑定的网关通信设备,切换至使用备用通信链路绑定的网关通信设备的设备切换行为,最终在风险值大于预设风险阈值的情况下调换主用通信链路与备用通信链路绑定的网关通信设备,能够根据检测到的设备切换风险准确识别运营商的设备切换行为,及时更换平台链路绑定设备,保证平台链路绑定设备与运营商实际承载设备一致,进而保证平台与运营商之间的通信可靠性,提升链路冗余架构的稳定性与业务一致性,避免无法接收到上行报文、平台消息重复、业务乱序、通信时延增加、计费异常等。并且,该方法能够在不改变运营商内网设备、不增加第三方接口的前提下实现设备切换风险的识别与链路绑定设备调整,不依赖于人工巡检与人为重启服务,能够大幅降低运维成本,适配各类运营商。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123021101A_ABST
    Figure CN123021101A_ABST
Patent Text Reader

Abstract

The application provides a communication link adjustment method and an electronic device, and relates to the technical field of intelligent networking. The method acquires first running data of a main communication link and second running data of a backup communication link, determines the link health degree of the main communication link through the first running data, realizes health detection of the main communication link, further determines a risk value of switching of a gateway communication device in use through the first running data and the second running data in the case that the link health degree is lower than a preset abnormal threshold, and exchanges the gateway communication device bound with the main communication link and the backup communication link in the case that the risk value is greater than a preset risk threshold. The device switching behavior of an operator can be accurately identified and the platform link binding device can be timely replaced, the platform link binding device is consistent with the actual bearing device of the operator, the stability and business consistency of the link redundancy architecture are ensured, and various operators are adapted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of intelligent connected vehicle technology, and in particular to a communication link adjustment method and electronic device. Background Technology

[0002] The vehicle-to-everything (V2X) service platform relies on SMS channels to achieve two-way data interaction with in-vehicle terminals. Uplink SMS messages are used for terminal status reporting, fault alarms, and wake-up responses; downlink SMS messages are used for remote platform management, parameter configuration, and status queries. To avoid service paralysis caused by single-point device failures, the platform configures a set of primary and backup gateway communication devices for each operator and establishes independent communication links to form a redundant link group.

[0003] However, the operator's side possesses independent internal network primary / backup scheduling capabilities, which can autonomously complete traffic switching and traffic rollback based on device load and fault status. This type of scheduling behavior is completely closed within the operator's internal network, and is only decided and executed internally by the operator's network management system. There is no externally accessible notification interface, and it cannot be proactively synchronized to the downstream vehicle networking platform. This leads to a mismatch between the platform's link-bound devices and the operator's actual carrying devices, resulting in problems such as the platform's inability to receive uplink packets, duplicate platform messages, out-of-order services, increased communication latency, and billing anomalies. Summary of the Invention

[0004] In view of this, the purpose of this application is to propose a communication link adjustment method and electronic device to ensure that the platform link binding device is consistent with the actual carrier device of the operator, thereby ensuring the communication stability between the platform and the operator.

[0005] To achieve the above objectives, this application provides a communication link adjustment method and an electronic device, comprising:

[0006] Obtain first operating data of the primary communication link and second operating data of the backup communication link, and determine the link health of the primary communication link based on the first operating data; In response to the link health being lower than a preset abnormal threshold, a risk value for switching of the used gateway communication device is determined based on the first operating data and the second operating data; In response to the risk value exceeding a preset risk threshold, the gateway communication device bound to the primary communication link and the backup communication link is swapped.

[0007] For the same purpose, embodiments of this application also provide an electronic device, 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 method provided in any embodiment of this application.

[0008] As can be seen from the above, the communication link adjustment method provided in this application obtains first operating data of the primary communication link and second operating data of the backup communication link. It determines the link health of the primary communication link using the first operating data, achieving real-time detection of the primary communication link's health status. This method considers that operator equipment switching can cause misalignment between the platform link-bound device and the operator's actual carrying device, leading to a decrease in the primary communication link's health. When the primary communication link's health falls below a preset abnormal threshold, it further determines the risk value of the gateway communication device being switched using the first and second operating data, in order to accurately identify the operator's switching from the primary communication link to the backup communication link. This method involves switching from a primary communication link-bound gateway device to a backup communication link-bound gateway device. Ultimately, if the risk value exceeds a preset risk threshold, the gateway devices bound to the primary and backup communication links are swapped. This approach accurately identifies operator switching behavior based on detected switching risks, promptly replacing the platform link-bound devices to ensure consistency between the platform link-bound devices and the operator's actual carrying equipment. This guarantees communication reliability between the platform and the operator, improves the stability and service consistency of the link redundancy architecture, and avoids issues such as unreceived uplink packets, duplicate platform messages, out-of-order service requests, increased communication latency, and billing anomalies. Furthermore, this method can identify switching risks and adjust link-bound devices without altering the operator's internal network equipment or adding third-party interfaces. It does not rely on manual inspections or service restarts, significantly reducing maintenance costs and adapting to various operator types. Attached Figure Description

[0009] To more clearly illustrate the technical solutions in this application or related technologies, the drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0010] Figure 1 This is a flowchart of a communication link adjustment method provided in an embodiment of this application; Figure 2 This is a schematic diagram of the structure of a communication link adjustment device provided in an embodiment of this application; Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0011] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with specific embodiments and the accompanying drawings.

[0012] It should be noted that, unless otherwise defined, the technical or scientific terms used in the embodiments of this application should have the ordinary meaning understood by one of ordinary skill in the art to which this application pertains. The terms "first," "second," and similar terms used in the embodiments of this application do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word encompasses the elements or objects listed after the word and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are only used to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0013] Before providing a detailed explanation of the communication link adjustment method provided in the embodiments of this application, the technical problem solved by this method will be explained first.

[0014] In existing technologies, after a device switchover is completed within an operator's intranet, the operator's service traffic can migrate from the primary device to the backup device, or vice versa. However, because the platform cannot detect this behavior, it fails to update the link device binding relationships in a timely manner. This results in a mismatch between the platform's logical link binding devices and the operator's actual carrying devices, leading to the following two types of core faults: 1. Uplink SMS loss and out-of-order issues: Most operators use a one-sided forwarding mechanism, which only forwards uplink SMS to the currently used device after switching devices. However, since the platform side is still bound to the backup communication link for this device, the device's traffic will appear on the backup communication link, causing the platform to be unable to receive uplink SMS. Furthermore, a few operators can switch to transient dual-transmission of uplink packets, but this method is prone to causing duplicate messages and out-of-order business, increasing the business processing pressure. 2. Downlink SMS outbound misalignment issue: The platform still sends downlink SMS messages through the primary communication link. This behavior relies on the operator's routing fallback mechanism to complete the forwarding, which can easily lead to problems such as increased communication latency, abnormal billing statistics, and risk control interception, seriously affecting the effectiveness of terminal management.

[0015] Therefore, in order to solve the problems existing in the above-mentioned scenarios of device switching without notification, this application provides a communication link adjustment method. Without modifying the operator's intranet equipment or adding third-party interfaces, it can detect the risk of device switching and adjust the link-bound devices, comprehensively improve the stability and service consistency of the link redundancy architecture, adapt to various operators, and significantly reduce operation and maintenance costs without relying on manual inspection and manual service restart.

[0016] Figure 1 This is a flowchart illustrating a communication link adjustment method provided in an embodiment of this application. This method is applicable to scenarios where an operator switches from using a primary gateway device to using a backup gateway device, and also applicable to scenarios where an operator switches from using a backup gateway device to using a primary gateway device. This method can be executed by a communication link adjustment device, which can be integrated into an electronic device, such as a vehicle-to-everything (V2X) service platform, through hardware and / or software.

[0017] like Figure 1 As shown, the method provided in this application embodiment includes S110-S130: S110. Obtain the first operating data of the primary communication link and the second operating data of the backup communication link, and determine the link health of the primary communication link based on the first operating data.

[0018] In this embodiment, the primary communication link and the backup communication link can be logical links between the vehicle-to-everything (V2X) service platform and the operator, used to bind different gateway communication devices provided by the operator, jointly forming a dual-active communication architecture between the V2X service platform and the operator. The operator typically provides two gateway communication devices: a primary gateway device and a backup gateway device.

[0019] Specifically, the initialization process of the dual-active communication architecture may include: (1) The vehicle network service platform reads the operator's link group configuration parameters and initiates long connection and SMS protocol handshake to the operator's primary gateway device and backup gateway device in parallel to establish physical connection channels with the primary gateway device and physical connection channels with the backup gateway device respectively. The connection timeout threshold can be configured to 15s by default; (2) After the two physical connection channels are established and the connection status is stable, the logical link group can be initialized. By default, the primary communication link is bound to the operator's primary gateway device (i.e., the primary communication link is mapped to the physical connection channel of the primary gateway device), and the backup communication link is bound to the operator's backup gateway device (i.e., the backup communication link is mapped to the physical connection channel of the backup gateway device).

[0020] After initializing the active-active communication architecture, the validity of the logical link group (primary communication link and backup communication link) can be verified. For example, Boolean formulas can be used to verify link validity and determine whether the active-active communication architecture has been successfully initialized. ; In the formula, The operating status of the primary communication link. This refers to the operational status of the backup communication link. Indicates link activation and binding. This is the result of the link validity verification; as shown in the above formula, when both the primary communication link and the backup communication link are in the active binding state, A value of 1 indicates that the link validity verification has passed.

[0021] When a single logical link fails or both logical links fail, an exponential backoff retry strategy can be initiated. The retry interval can be calculated using the following formula: ; In the formula, For the retry interval, The base interval can be 5 seconds. This represents the current number of retries. For example, the maximum number of retries can be limited to no more than 5. If a connection cannot be established after 5 consecutive retries, the system can automatically downgrade to a single-link operating architecture and push a Level 1 maintenance alarm when a single logical link fails. If both logical links fail, the logical link group can be locked directly, and manual intervention can be initiated.

[0022] In this embodiment, the operator's gateway communication device maintains a fixed underlying physical connection with the platform. That is, the two underlying physical connection channels are always used to connect the two gateway communication devices respectively and will not be interchanged. When the operator switches service traffic from one gateway communication device to another, this embodiment only modifies the upper-layer mapping, that is, only adjusts the gateway communication device bound to the logical link (which can also be understood as changing the physical connection channel of the logical link mapping). The underlying physical connection remains online continuously, without the need to reconnect to the gateway communication device.

[0023] The primary communication link can be used to carry all downlink remote control SMS traffic and uplink vehicle reporting SMS traffic of the vehicle network service platform. The backup communication link is only used as a redundancy backup and does not carry service traffic unless the operator switches equipment.

[0024] Specifically, it can collect the first operating data of the primary communication link and the second operating data of the backup communication link in real time. For example, it can be based on a preset sampling period (e.g., ...). The preset sampling period is adjustable from 5s to 30s and can be adjusted according to actual needs. It synchronously collects data generated during the operation of the primary and backup communication links, such as heartbeat status, message round-trip delay, and heartbeat message fingerprints. Furthermore, it can also be adjusted according to a time-based rolling window (e.g., ...). The adjustable range of this time scrolling window is 30s~300s, which can be adjusted according to actual needs. The uplink SMS traffic is counted to obtain the real-time uplink SMS quantity, which is used as the operation data of the logical link.

[0025] In this embodiment, the purpose of obtaining the first and second operational data is as follows: Considering that in scenarios where an operator switches from a primary gateway device to a backup gateway device, and vice versa, the operator's device switching behavior will lead to a decrease in the health of the primary communication link, the first operational data can be used to achieve real-time detection of the primary communication link's health. Furthermore, considering that the operator's device switching behavior can also cause changes in the operational data of the primary and backup communication links, the first and second operational data can also be used to achieve real-time detection of the risks associated with the operator's device switching.

[0026] For example, in the scenario of switching from a primary gateway device to a backup gateway device, before the operator performs the device switching action, the platform's primary communication link is bound to the primary gateway device, and the backup communication link is bound to the backup gateway device. After the operator migrates traffic from the primary gateway device to the backup gateway device, since the backup gateway device is still bound to the backup communication link, a large amount of traffic will appear on the backup communication link, which will cause the health of the primary communication link to decline.

[0027] Furthermore, in the scenario of switching from a backup gateway device to a primary gateway device, before the operator performs the device switching action, the platform's primary communication link is bound to the backup gateway device, and the backup communication link is bound to the primary gateway device. After the operator migrates traffic from the backup gateway device to the primary gateway device, since the primary gateway device is still bound to the backup communication link, a large amount of traffic will appear on the backup communication link, which will lead to a decline in the health of the primary communication link.

[0028] In this embodiment of the application, the link health of the primary communication link can be obtained by analyzing the connectivity reliability, transmission latency, traffic carrying ratio, and matching degree with historical normal working conditions of the primary communication link through the first operating data analysis.

[0029] In one specific implementation, determining the link health of the primary communication link based on the first operational data includes the following steps: Step A1: Determine the heartbeat response rate of the primary communication link based on the number of heartbeat response messages and the number of heartbeat detection messages in the first running data; Step A2: Determine the normalized link delay of the primary communication link based on the round-trip delay of the messages in the first running data; Step A3: Based on the real-time uplink SMS count in the first running data and the uplink SMS count on the peer link, determine the uplink traffic ratio of the primary communication link, and based on the real-time uplink SMS count and the historical uplink SMS count in the first running data, determine the traffic baseline matching degree of the primary communication link. Step A4: Determine the link health of the primary communication link based on the heartbeat response rate, normalized link latency, uplink traffic ratio, and traffic baseline matching degree of the primary communication link.

[0030] In step A1, the number of heartbeat response messages can be the number of heartbeat response messages successfully received within a single preset sampling period, and the number of heartbeat detection messages can be the number of heartbeat detection messages actively sent within a single preset sampling period.

[0031] Specifically, the heartbeat response rate of the primary communication link can be obtained by calculating the ratio between the number of heartbeat response messages and the number of heartbeat probe messages. This heartbeat response rate reflects the reliability of the primary communication link; the higher the heartbeat response rate, the higher the link reliability. The heartbeat response rate can be referenced by the following formula: ; In the formula, For heart rate response, For the number of heartbeat response messages, This represents the number of heartbeat detection messages.

[0032] In step A2, the round-trip time (RTT) can be the time from sending a heartbeat probe message to receiving a heartbeat response message within a single preset sampling period. Specifically, the RTT of each message can be statistically analyzed, and the 95th percentile of the RTT can be determined as the link RTT. Then, the link RTT is normalized using the historical link reference RTT to obtain the normalized link RTT. This normalized link RTT can describe the transmission delay quality of the primary communication link.

[0033] For example, the normalized link delay can be calculated based on the following formula: ; In the formula, To normalize link latency, The larger the value, the higher the transmission latency performance of the link. The round-trip time for a message at the 95th percentile. As the historical baseline latency of the link, This is a limiting function used to convert the calculation results... The constraint is within the interval [0,1].

[0034] In step A3, the real-time uplink SMS quantity can be the number of uplink SMS messages sent by the primary communication link as counted within the time rolling window, the peer link uplink SMS quantity can be the number of uplink SMS messages sent by the backup communication link as counted within the time rolling window, and the historical uplink SMS quantity can be the baseline number of uplink SMS messages sent by the primary communication link under historical normal operating conditions.

[0035] Specifically, the total number of uplink SMS messages can be calculated by summing the real-time uplink SMS messages with the uplink SMS messages on the peer link. Then, the ratio between the real-time uplink SMS messages and the total uplink SMS messages can be calculated to obtain the uplink traffic share of the primary communication link. This uplink traffic share reflects the service traffic carrying capacity of the primary communication link, as shown in the following formula: ; In the formula, The proportion of uplink traffic. The larger the value, the higher the traffic carrying capacity of the primary communication link. To show the real-time number of SMS messages sent. This refers to the number of uplink SMS messages on the peer link. It is a very small constant that approaches 0, used to avoid abnormal calculation cases where the denominator is 0.

[0036] In addition, the ratio between the real-time uplink SMS count and the historical uplink SMS count can be calculated to obtain the traffic baseline matching degree of the primary communication link. This traffic baseline matching degree reflects the degree of matching between the current traffic of the primary communication link and the historical normal operating traffic, as shown in the following formula: ; In the formula, For traffic baseline matching degree, The number of SMS messages sent in history This is a limiting function used to convert the calculation results... The constraint is within the interval [0,1].

[0037] After obtaining the heartbeat response rate, normalized link latency, uplink traffic ratio, and traffic baseline matching degree of the primary communication link, further, in step A4, the heartbeat response rate, normalized link latency, uplink traffic ratio, and traffic baseline matching degree can be weighted and fused to obtain the link health of the primary communication link. This link health is used to comprehensively evaluate the link status of the primary communication link.

[0038] It should be noted that the heartbeat response rate, normalized link latency, link uplink traffic ratio, and traffic baseline matching degree are all normalized indicators. After being weighted by various weight parameters that sum to 1, the link health can be obtained with a value in the range of [0,1], as shown in the following formula: ; In the formula, For link health, , , , These are heartbeat response rate, normalized link latency, uplink traffic percentage, and traffic baseline matching degree. ~ For each weight parameter, satisfying For example, the results obtained from the annotation of experimental data are as follows: .

[0039] Steps A1-A4 above determine the heartbeat response rate, normalized link latency, uplink traffic ratio, and traffic baseline matching degree of the primary communication link using the first operational data, thereby obtaining the link health. This comprehensively considers the connectivity, latency, traffic distribution, and traffic steady state of the primary communication link. By quantifying the link health through multi-dimensional indicators, it can accurately identify traffic transfers caused by operator equipment switching and provide quantifiable standardized inputs for subsequent risk assessment. This enables real-time perception of unannounced switching behavior and timely and accurate detection of link misalignment. Furthermore, by obtaining normalized indicators and weighting them to calculate the link health, it achieves dimensional consistency and avoids errors.

[0040] In this embodiment of the application, considering that the uplink traffic of the primary communication link is too low during the period of low service volume, which may also cause the link health to decline, in order to avoid misjudgment during the period of low service volume, the period of low service volume can be identified, and then traffic-related indicators are blocked from participating in the calculation during the calculation of link health, so as to avoid erroneously triggering the subsequent device switching risk detection.

[0041] In one example, before determining the link health of the primary communication link based on heartbeat response rate, normalized link latency, uplink traffic percentage, and traffic baseline matching, the process also includes: The system determines whether the primary communication link is in a low-traffic period based on the real-time uplink SMS volume. If so, the link health of the primary communication link is determined based on the heartbeat response rate and normalized link latency. Otherwise, the system performs the step of determining the link health of the primary communication link based on the heartbeat response rate, normalized link latency, uplink traffic ratio, and traffic baseline matching degree.

[0042] Specifically, the real-time number of uplink SMS messages can be compared with a pre-set low traffic threshold, where the low traffic threshold can be a threshold for detecting the number of SMS messages during a period when the business is underestimating its capacity, such as 10 messages.

[0043] If the number of real-time uplink SMS messages is less than the preset low traffic threshold, it can be determined that the primary communication link is in a low-traffic period. If the number of real-time uplink SMS messages is greater than or equal to the preset low traffic threshold, it can be determined that the primary communication link is in a non-low-traffic period.

[0044] In this embodiment, considering that during off-peak hours, the number of uplink SMS messages on the primary communication link is extremely small, and even a small fluctuation in SMS messages can cause a drastic jump in the uplink traffic ratio, and that off-peak traffic is far lower than the historical baseline traffic for the same period, resulting in a traffic baseline matching degree approaching 0, the uplink traffic ratio and traffic baseline matching degree are not weighted during off-peak hours to avoid significantly lowering the link health and causing incorrect judgments of primary communication link failure.

[0045] It should be noted that if the primary communication link is in a low-traffic period, the weight coefficient corresponding to the uplink traffic ratio and the traffic baseline matching degree can be released, and the released weight coefficient can be evenly distributed to the heartbeat response rate and normalized link latency. By weighted fusion of the heartbeat response rate and normalized link latency, the link health of the primary communication link can be obtained.

[0046] In addition, when the primary communication link is in a non-business off-peak period, the link health of the primary communication link is obtained by weighted fusion of heartbeat response rate, normalized link latency, link uplink traffic ratio, and traffic baseline matching degree.

[0047] The above example can identify low-traffic periods and filter out unstable traffic metrics from participating in health calculations during these periods. It retains link quality metrics such as heartbeat response rate and normalized link latency, which are not affected by the number of packets, as the basis for judgment. This can avoid false drops in link health caused by low traffic, thereby avoiding misidentification of link faults and preventing misjudgments of link misalignment.

[0048] S120. In response to the link health being lower than a preset abnormal threshold, based on the first operating data and the second operating data, determine the risk value of the switchover of the gateway communication device being used.

[0049] Specifically, after determining the health status of the primary communication link, this health status can be compared with a preset anomaly threshold. This preset anomaly threshold can be a pre-set critical health level used to identify whether the primary communication link is abnormal. For example, the preset anomaly threshold can be set to 0.5.

[0050] In this embodiment, in addition to the preset anomaly threshold, a preset alarm threshold can also be set. This preset alarm threshold is greater than the preset anomaly threshold and is used to identify a decline in the health of the primary communication link and issue an alarm in a timely manner. For example, the preset alarm threshold can be set to 0.8.

[0051] Specifically, if the link health is greater than or equal to a preset alarm threshold, the first and second running data can be collected at the preset sampling period to continue health checks on the primary communication link. If the link health is less than the preset alarm threshold but not less than a preset anomaly threshold, the preset sampling period can be increased (e.g., by doubling the sampling period) to increase the frequency of health checks on the primary communication link. If the link health is less than a preset anomaly threshold, the preset sampling period can be increased (e.g., by tripling the sampling period) to increase the frequency of health checks on the primary communication link, and risk detection for operator equipment switching is triggered. The risk value of equipment switching, i.e., the risk value of the gateway communication equipment used by the operator during switching, is determined using the first and second running data.

[0052] In this context, "device handover" refers to an operator switching from a gateway communication device bound to a primary communication link to a gateway communication device bound to a backup communication link. For example, in a scenario where an operator switches from a primary gateway device to a backup gateway device, the primary communication link is bound to the primary gateway device, and the backup communication link is bound to the backup gateway device. Specifically, device handover refers to the operator migrating service traffic from the primary gateway device to the backup gateway device. Conversely, in a scenario where an operator switches from a backup gateway device to a primary gateway device, the primary communication link is bound to the backup gateway device, and the backup communication link is bound to the primary gateway device. Specifically, device handover refers to the operator migrating service traffic from the backup gateway device to the primary gateway device.

[0053] In this embodiment, the risk value of device switching (i.e., the risk value of switching the used gateway communication device) can reflect the probability of the operator performing device switching. Considering that the essence of the operator performing device switching is to migrate service traffic from the currently used gateway communication device to another gateway communication device, while the gateway communication device used before the switch is still bound to the primary communication link, and the gateway communication device used after the switch is still bound to the backup communication link, the migration of service traffic will lead to an increase in traffic on the backup communication link, a decrease in traffic on the primary communication link, and an increase in the heartbeat response rate of the backup communication link, etc. Therefore, features such as the traffic change trend of the primary communication link and the backup communication link can be extracted through the first operating data and the second operating data, and the risk value of device switching can be determined by the extracted features.

[0054] In some implementations, determining the risk value of a switchover of the used gateway communication device based on first operating data and second operating data includes the following steps: Step B1: Based on the first operating data and the second operating data, determine whether the primary communication link and the backup communication link meet the preset device switching conditions, and obtain the condition judgment identifier of the preset device switching conditions; Step B2: Determine the risk value of switching of the gateway communication device based on the condition judgment identifier.

[0055] The preset device switching conditions can be pre-set conditions that satisfy the identification of device switching behavior, such as increased traffic on the backup communication link, decreased traffic on the primary communication link, or an increased heartbeat response rate on the backup communication link. The condition judgment flags for the preset device switching conditions can be used to describe whether the preset device switching conditions are met; for example, 1 indicates that the conditions are met, and 0 indicates that the conditions are not met.

[0056] Specifically, in step B1, the heartbeat response rate of the primary communication link can be determined based on the number of heartbeat response messages and the number of heartbeat detection messages in the first running data, and the heartbeat response rate of the backup communication link can be determined based on the number of heartbeat response messages and the number of heartbeat detection messages in the second running data. If the heartbeat response rate of the primary communication link is less than a set threshold, and the heartbeat response rate of the backup communication link is greater than the set threshold, then it is determined that the heartbeat response rate of the backup communication link increases and the heartbeat response rate of the primary communication link decreases, and the corresponding condition judgment flag is set to 1; otherwise, it is set to 0.

[0057] Furthermore, the uplink traffic ratio of the primary communication link can be determined based on the real-time uplink SMS count and the uplink SMS count of the peer link in the first operating data. The uplink traffic ratio of the backup communication link can be determined based on the real-time uplink SMS count and the uplink SMS count of the peer link in the second operating data. If the uplink traffic ratio of the primary communication link is less than a set threshold and the uplink traffic ratio of the backup communication link is greater than the set threshold, then it is determined that the uplink traffic of the backup communication link is increasing and the uplink traffic on the primary communication link is decreasing. In this case, the corresponding condition judgment flag is set to 1; otherwise, it is set to 0.

[0058] Furthermore, in step B2, all the obtained condition judgment identifiers can be weighted and fused to obtain a risk value with a range of [0,1].

[0059] Steps B1-B2 above detect whether the logical link meets the preset device switching conditions by using the first and second running data, and obtain a condition judgment identifier to describe whether the conditions are met. Then, the risk value is obtained through the condition judgment identifier. This can realize device switching risk detection based on preset device switching conditions. The risk value can be determined by multiple preset device switching conditions in concert, avoiding misjudgment of device switching caused by single data fluctuations, and ensuring the reliability of subsequent replacement of link-bound devices.

[0060] In one specific implementation, the preset device switching conditions include at least one of device fingerprint change conditions, heartbeat recovery conditions, traffic migration conditions, and protocol response conditions; based on the first operating data and the second operating data, determining whether the primary communication link and the backup communication link meet the preset device switching conditions includes: If the heartbeat message fingerprint in the second running data is the same as the device fingerprint of the gateway communication device bound to the backup communication link, and the uplink SMS fingerprint in the second running data is the same as the device fingerprint of the gateway communication device bound to the backup communication link, and all heartbeat message fingerprints and all uplink SMS fingerprints in the first running data are the same, then it is determined that the primary communication link and the backup communication link meet the device fingerprint change conditions. Based on the second operating data, the heartbeat response rate and normalized link delay of the backup communication link are determined. If the heartbeat response rate of the backup communication link is greater than the preset response rate threshold, and the round-trip delay of the message of the backup communication link is greater than the preset delay threshold, then it is determined that the primary communication link and the backup communication link meet the heartbeat recovery conditions. Based on the second operating data, the uplink traffic ratio and the increase in the traffic ratio of the backup communication link are determined. Based on the first operating data, the increase in the traffic ratio of the primary communication link is determined. If the total number of uplink SMS messages in the first and second operating data is greater than the preset uplink quantity, and the uplink traffic ratio of the backup communication link is greater than the preset ratio threshold, and the increase in the traffic ratio of the backup communication link is greater than the preset increase threshold, and the increase in the traffic ratio of the primary communication link is less than the preset decrease threshold, then it is determined that the primary communication link and the backup communication link meet the traffic migration conditions. If the first running data contains multiple consecutive non-service return messages, then it is determined that the primary communication link and the backup communication link meet the protocol response conditions.

[0061] The device fingerprint change conditions can be that the heartbeat message fingerprint and uplink SMS fingerprint on the backup communication link are the same as the device fingerprint of the gateway communication device bound to the backup communication link, and the heartbeat message fingerprint and uplink SMS fingerprint in the first running data do not change. The heartbeat recovery condition can be that the heartbeat response rate and message round-trip latency of the backup communication link are both greater than the corresponding preset thresholds. The traffic migration condition can be that the total amount of uplink SMS is greater than the corresponding preset threshold, the uplink traffic ratio and the increase in the traffic ratio of the backup communication link are both greater than the corresponding preset thresholds, and the increase in the traffic ratio of the primary communication link is less than the corresponding preset threshold.

[0062] Specifically, the device fingerprint of the gateway communication device can be extracted from the gateway communication device's metadata. The device fingerprint serves as the identity identifier of the gateway communication device. If the heartbeat message fingerprint and uplink SMS fingerprint in the second operating data are the same as the device fingerprint of the gateway communication device bound to the backup communication link, and the heartbeat message fingerprints and uplink SMS fingerprints in the first operating data are the same, it indicates that the heartbeat message and uplink SMS of the backup communication link match the gateway communication device bound to it, and the primary communication link has not experienced any changes in service traffic for a long period of time. It can be determined that the gateway communication device currently carrying traffic is the gateway communication device bound to the backup communication link, and the communication capability of the gateway communication device is restored, thus satisfying the device fingerprint change conditions.

[0063] Specifically, the heartbeat response rate and normalized link latency of the backup communication link can be calculated using the same method as the primary communication link mentioned earlier. If the heartbeat response rate of the backup communication link is greater than the preset response rate threshold, and the round-trip latency of the backup communication link is greater than the preset latency threshold, it indicates that the communication capability of the gateway communication device bound to the backup communication link has been restored, and the heartbeat recovery condition is met.

[0064] Specifically, the uplink traffic share and increase rate of the backup communication link can be calculated using the same method as the primary communication link described earlier. The increase rate can be obtained by calculating the difference between the current uplink traffic share and the historical uplink traffic share in the previous preset sampling period. If the total number of uplink SMS messages in the first and second running data is greater than the preset uplink quantity, and the uplink traffic share of the backup communication link is greater than the preset share threshold, and the increase rate of the traffic share of the backup communication link is greater than the preset increase threshold, and the increase rate of the traffic share of the primary communication link is less than the preset decrease threshold, then it indicates that the uplink traffic share of the backup communication link is increasing, the uplink traffic share of the primary communication link is decreasing, and a large-scale migration of service traffic to the gateway communication device bound to the backup communication link is achieved, thus meeting the traffic migration conditions.

[0065] The requirement that the total number of uplink SMS messages must exceed a preset uplink limit in the traffic migration conditions is designed to mitigate errors caused by traffic fluctuations during off-peak hours. For example, the preset uplink limit can be set to 10 messages, the preset percentage threshold can be set to 0.7, the preset increase threshold can be set to 40%, and the preset decrease threshold can be set to -40%.

[0066] Specifically, non-service return messages can include gateway busy messages, redirect messages, and undelivered messages. A gateway busy message indicates that the gateway communication device is currently not handling service traffic; a redirect message indicates that service traffic has been migrated to another gateway communication device; and an undelivered message indicates that the gateway communication device may have discarded the message and returned a undelivered receipt due to insufficient service traffic permissions. If the first running data contains multiple consecutive non-service return messages, it indicates that the gateway communication device bound to the primary communication link is continuously returning abnormal messages. This gateway communication device no longer carries normal service traffic and only forwards fallback abnormal messages. Service traffic has been migrated to the gateway communication device bound to the backup communication link, thus satisfying the protocol response conditions.

[0067] For example, the condition judgment identifiers for device fingerprint change conditions, heartbeat recovery conditions, traffic migration conditions, and protocol response conditions can be respectively used as... , , , The risk value for equipment switching can be obtained using the following formula: ; In the formula, This represents the risk value for device handover. A higher risk value indicates a greater probability that the operator will perform device handover. ~ For each weight coefficient, satisfying For example, .

[0068] It should be noted that when any of the above condition judgment identifiers becomes invalid due to operator restrictions or low traffic, the weight coefficient corresponding to the invalid condition judgment identifier can be proportionally distributed to the remaining valid condition judgment identifiers, ensuring that the sum of the weight coefficients is always 1. Taking the invalidation of the condition judgment identifier for traffic migration due to low traffic as an example, as shown in the following formula: ; In the formula, , , The formula represents the weighting coefficients after redistribution. It means that the traffic migration weighting coefficients are proportionally allocated to the device fingerprint change weighting coefficients, heartbeat recovery weighting coefficients, and protocol response weighting coefficients.

[0069] The above implementation method, through device fingerprint change conditions, heartbeat recovery conditions, traffic migration conditions, and protocol response conditions, can perform device switching risk detection based on at least one of the following evidence: device fingerprint, heartbeat quality, traffic changes, and protocol messages. This achieves multi-dimensional cross-validation and ensures the accuracy of device risk detection. Furthermore, by obtaining normalized condition judgment identifiers and weighting the risk value, it can achieve dimensional uniformity and avoid errors.

[0070] S130. In response to a risk value exceeding a preset risk threshold, the gateway communication device bound to the primary communication link and the backup communication link is swapped.

[0071] Specifically, after determining the risk value for device switching, the system can further detect whether the operator has engaged in device switching behavior using this risk value. If the risk value exceeds a preset risk threshold, it can be determined that the operator has engaged in device switching behavior, and the gateway communication equipment bound to the primary and backup communication links can be switched. The preset risk threshold can be a pre-set risk threshold representing the presence of device switching behavior, such as 0.6.

[0072] By comparing the risk value of device switching with the preset risk threshold, it can be determined whether the operator has engaged in device switching behavior. In the event of device switching behavior, the logical link-bound device can be updated in a timely manner, enabling link self-healing based on risk detection. This ensures the accuracy of identifying device switching behavior and the accuracy of replacing link-bound devices.

[0073] In this embodiment of the application, in order to avoid the subsequent erroneous replacement of the link-bound device due to instantaneous index fluctuations, a continuous verification mechanism can also be set. When the risk value is first determined to be greater than the preset risk threshold, the operator is first determined to be in a suspected switching state. Then, when the risk values ​​are determined to be greater than the preset risk threshold multiple times in a row, the gateway communication device bound to the primary communication link and the backup communication link is triggered to be replaced.

[0074] In one specific implementation, before swapping the gateway communication device bound to the primary communication link and the backup communication link, the following steps are further included: Step C11: Determine that the operator is in a suspected handover state, and return to reacquire the first operating data of the primary communication link and the second operating data of the backup communication link to obtain a new risk value; Step C12: In response to multiple consecutive risk values ​​exceeding a preset risk threshold during a suspected handover state, execute the step of swapping the gateway communication device bound to the primary communication link and the backup communication link.

[0075] Specifically, in step C11, if the risk value is detected to be greater than the preset risk threshold for the first time, it can be determined that the operator is in a suspected handover state. This suspected handover state can be understood as an intermediate state that needs to be further verified to determine whether the device handover is actually performed.

[0076] After determining that the operator is in a suspected handover state, the first operating data of the primary communication link and the second operating data of the backup communication link can be collected to redetermine the risk value and compare the new risk value with the preset risk threshold.

[0077] Specifically, in step C12, if after determining the suspected switching state, the risk value is detected to be greater than the preset risk threshold multiple times (e.g., 3 times), it indicates that the operator is in the device switching state. Furthermore, the gateway communication device bound to the primary communication link and the backup communication link can be swapped.

[0078] Steps C11-C12 above can first enter a suspected handover state when the risk value is greater than the preset risk threshold, and continue to detect new risk values. If multiple new risk values ​​are greater than the preset risk threshold, the gateway communication equipment bound to the primary communication link and the backup communication link will be switched. This method takes into account occasional traffic surges, single heartbeat fluctuations, and single abnormal protocol messages, which may cause the risk value to exceed the preset risk threshold once. These are temporary interferences and are not actual equipment switching by the operator. This can avoid frequent modification of link-bound equipment during temporary interferences and further ensure communication reliability.

[0079] In addition, in this embodiment of the application, an abnormal jitter mechanism can be set, which can be to permanently disable the function of link-bonded device switching when frequent triggering of link-bonded device switching is detected.

[0080] In one example, before swapping the gateway communication devices bound to the primary and backup communication links, the process also includes: Obtain the number of device replacements within a preset stable time period; in response to detecting that the number of device replacements is less than or equal to a preset threshold, execute the step of replacing the gateway communication device bound to the primary communication link and the backup communication link.

[0081] The preset stabilization period can be a pre-set duration for triggering the abnormal jitter mechanism, such as 1 hour. The preset number of times the execution link binding device is switched within the preset stabilization period can be a pre-set number of times the abnormal jitter mechanism is triggered.

[0082] Specifically, before each switch between the gateway communication devices bound to the primary and backup communication links, the number of times the link-bound devices were switched within a preset stable period before the current time can be obtained, i.e., the number of device switches.

[0083] If the number of device swaps reaches a preset threshold (e.g., 4 times) within a preset stable time period (e.g., 1 hour), it can be determined that the link is continuously jittering abnormally. At this time, the function of swapping the link-bound device can be permanently disabled, and corresponding abnormal jitter prompt information can be generated for the operation and maintenance personnel to investigate the underlying physical connection channel failure. This will prevent the frequent swapping of the link-bound device from continuously damaging the stability of the service in the event of abnormal scheduling in the operator's intranet or failure of the gateway communication equipment.

[0084] If the number of device swaps is not detected within the preset stable time period, it can be determined that the link jitter abnormality has not been triggered at this time, and the swap of the gateway communication devices bound to the primary communication link and the backup communication link can be performed.

[0085] The above example, by determining whether the number of device changes within a preset stable time period has reached a preset threshold before each change of the device bound to the link, can detect continuous link jitter in a timely manner. This avoids frequent changes of the device bound to the link in cases of abnormal scheduling in the operator's intranet or failure of the gateway communication equipment, which would continuously damage the stability of the service. This protects the service of the vehicle terminal from the continuous impact of frequent routing changes.

[0086] Specifically, swapping the gateway communication devices bound to the primary communication link and the backup communication link can involve updating the gateway communication device bound to the primary communication link to the gateway communication device bound to the backup communication link, and updating the gateway communication device bound to the backup communication link to the gateway communication device originally bound to the primary communication link.

[0087] It should be noted that, in the embodiments of this application, replacing the link binding device can be understood as performing link self-healing. After a single link self-healing is completed, the logical link group (primary communication link and backup communication link) can enter a cooling-off period (e.g., 120 seconds). During this cooling-off period, new link self-healing is prohibited to avoid frequent changes in logical binding in a short period of time, which could lead to duplicate uplink SMS messages and multiple downlink command outputs, thereby avoiding serious business failures such as billing anomalies, repeated vehicle control by the vehicle terminal, and risk control interception.

[0088] In one specific implementation, swapping the gateway communication device bound to the primary communication link and the backup communication link includes the following steps: Step C21: Pause the transmission of downlink SMS messages through the primary communication link and wait for the transmission of downlink SMS messages and heartbeat messages that are currently being transmitted in the primary communication link to complete. Step C22: Update the gateway communication device binding relationship between the primary communication link and the backup communication link, and synchronously update the global routing table according to the updated gateway communication device binding relationship, so as to refresh the gateway communication device binding relationship of all cluster service nodes based on the updated global routing table; Step C23: Resume downlink SMS transmission via the primary communication link.

[0089] Before performing step C21 above, a globally unique identifier for this link self-healing can be generated to prevent different instances (i.e., service nodes) in the entire cluster from simultaneously determining the device switching status and repeatedly initiating link self-healing.

[0090] Furthermore, a distributed single-fly lock can be applied for the logical link group. Only one instance is allowed to hold the single-fly lock to perform link self-healing at the same time, so as to avoid multiple instances performing link self-healing in parallel on the same logical link group. The single-fly lock is valid for 30 seconds. After 30 seconds, the single-fly lock is automatically released to avoid link self-healing failure and subsequent inability to continue self-healing.

[0091] Furthermore, the version number currently carried by the logical link group can be read. If the version number has not changed, the subsequent steps of C21 can be executed to avoid the link being modified and bound by other instances before the link self-healing is executed, and to further avoid repeated updates to the link binding device.

[0092] Specifically, in step C21, the platform can pause the transmission of downlink SMS messages through the primary communication link and wait for the transmission of downlink SMS messages and heartbeat messages in transit on the primary communication link to be completed, so as to clear the existing in-transit messages and prevent the two logical links from sending downlink SMS messages and heartbeat messages at the same time during the self-healing period.

[0093] Furthermore, in step C22, the gateway communication device bound to the primary communication link can be swapped with the gateway communication device bound to the backup communication link to update the gateway communication device binding relationship of the logical link group.

[0094] For example, in a scenario where an operator switches from a primary gateway device to a backup gateway device, the primary communication link can be bound to the primary gateway device, then updated to be bound to the backup gateway device, and the backup communication link can be bound to the backup gateway device, then updated to be bound to the primary gateway device.

[0095] Furthermore, the global routing table can be synchronously updated according to the updated gateway communication device binding relationships. The global routing table is a unified link mapping rule data table stored in the vehicle-to-everything (V2X) service platform cluster, used to record the binding relationships between logical link groups and the operator's gateway communication devices. After updating the global routing table, each cluster service node can update its locally cached gateway communication device binding relationships based on the global routing table to overwrite the old locally cached binding relationships, avoiding link misalignment between different instances and ensuring that the link binding mappings of all instances within the platform are fully aligned, with all uplink and downlink traffic matching the actual gateway communication devices carried by the operator.

[0096] After all cluster service nodes have been refreshed, further, in step C23, the sending of downlink SMS messages can be resumed, and downlink SMS messages can be transmitted through the primary communication link. Furthermore, the isolated fly-by can be proactively released to avoid blocking subsequent self-healing operations of the logical link group.

[0097] Steps C21-C23 above, by pausing the sending of downlink SMS messages and clearing in-transit messages, update the gateway communication device binding relationship of the logical link group and synchronously update the global routing table to refresh the gateway communication device binding relationship cached locally by all nodes in the cluster, and then resume the sending of downlink SMS messages, can avoid the repeated sending of downlink SMS messages during the self-healing period, and ensure the synchronous alignment of cluster node bindings, avoiding misalignment faults where some instances still send instructions according to the old binding relationship.

[0098] In this embodiment of the application, a three-level layered verification mechanism, including pre-verification, formal verification and business verification, can be used to verify the effectiveness of link self-healing, ensure the consistency of uplink and downlink business traffic, and set corresponding processing strategies for each level of verification failure.

[0099] In one example, before updating the gateway communication device binding relationship between the primary communication link and the backup communication link, the method further includes: verifying the connection status, protocol status, and device fingerprint matching degree of the backup communication link. If the verification fails, the update of the gateway communication device binding relationship between the primary communication link and the backup communication link is abandoned. After synchronously updating the global routing table based on the updated gateway communication device binding relationships, the following is also included: If the number of consecutive successful heartbeat detections on the primary communication link within the preset verification time is less than the preset number, or if the gateway communication device binding relationship of some cluster service nodes has not been updated, then the gateway communication device binding relationship between the primary communication link and the backup communication link before the update will be restored. Additionally, if the number of uplink SMS messages received by the primary communication link within a preset time window is less than a preset number, the preset time window is updated, and it is re-evaluated whether the number of uplink SMS messages received within the new preset time window is less than the preset number. If so, the gateway communication device binding relationship between the primary communication link and the backup communication link is restored to its previous state.

[0100] Specifically, pre-verification can be performed before updating the gateway communication device binding relationship between the primary and backup communication links. Pre-verification can verify the connection status, protocol status, and device fingerprint matching degree of the backup communication link. If the connection status and protocol status are normal, and the device fingerprint matching degree between the backup communication link and the bound gateway communication device is higher than the set threshold, the verification is confirmed to be successful, and the gateway communication device binding relationship between the primary and backup communication links can be updated. Otherwise, the verification is confirmed to be unsuccessful, and the update of the gateway communication device binding relationship between the primary and backup communication links is abandoned to avoid invalid route changes caused by faults such as physical connection channel disconnection and device identity mismatch. At the same time, the single-fly lock can also be released.

[0101] Specifically, formal verification can be performed within a preset verification time after updating the global routing table. Formal verification can be performed by conducting heartbeat probes multiple times through the primary communication link within the preset verification time. If the number of consecutive successful heartbeat probes is not less than the preset number, and the gateway communication device binding relationship of all cluster service nodes is updated, then the formal verification is successful. Otherwise, the gateway communication device binding relationship between the primary and backup communication links before the update is restored, so as to trigger link fallback in a timely manner in the event of heartbeat interruption or incomplete route synchronization. At the same time, operation and maintenance alarm information can also be pushed.

[0102] Specifically, service verification can be performed after updating the global routing table. Service verification can involve determining whether the number of uplink SMS messages received within a preset time window is less than a preset number. If so, the preset time window is extended (e.g., doubled in length) to re-evaluate whether the number of uplink SMS messages received within the new preset time window is less than the preset number. If it is still less than the preset number, the gateway communication device binding relationship between the primary and backup communication links can be restored to trigger link fallback in a timely manner when uplink traffic is unqualified. Simultaneously, maintenance alarm messages can be pushed. If the number of uplink SMS messages exceeds the preset number after updating the preset time window, the system can enter observation mode and not fall back temporarily. It should be noted that if the current period is a low-traffic period, service verification can also be completed by sending simulated probe messages.

[0103] The above example uses a three-tiered verification mechanism of pre-verification, formal verification, and business verification to achieve closed-loop verification of the entire process from the underlying connection, cluster routing, and real business traffic. Pre-verification performs upfront interception, while formal and business verifications perform post-verification. It can automatically roll back the old binding relationship when the link self-healing fails, avoiding long-term misalignment faults such as link failure after routing updates.

[0104] To ensure business data consistency, this application embodiment can assign a globally unique identifier to each downlink SMS message. After changing the gateway communication device binding relationship between the primary and backup communication links, for SMS messages in transit that have not received a response from the operator, idempotent retry is performed based on this globally unique identifier. That is, it is determined whether the message has already been sent based on the globally unique identifier, thus preventing duplicate SMS messages from being sent and preventing the vehicle terminal from receiving multiple identical vehicle control commands. This avoids repeated vehicle locking, repeated wake-up, and repeated parameter configuration, while also avoiding duplicate billing and risk control interception by the operator.

[0105] In addition, a composite de-reconstruction can be generated based on the operator's identifier, the vehicle terminal's number, the uplink SMS content, and the uplink SMS identifier. A rolling time window (e.g., 5 minutes) is maintained. If the same composite de-reconstruction is detected within the rolling time window, it can be determined that a duplicate uplink SMS has been received. The duplicate uplink SMS can then be discarded directly, avoiding the generation of a large amount of duplicate uplink data when the two gateway communication devices simultaneously forward uplink SMS when the operator switches devices, thus reducing the business processing pressure on the platform.

[0106] The communication link adjustment method provided in this application obtains first operating data of the primary communication link and second operating data of the backup communication link. The first operating data is used to determine the link health of the primary communication link, enabling real-time monitoring of its health status. This method considers that operator equipment switching can cause misalignment between the platform link-bound device and the operator's actual carrying device, leading to a decrease in the primary communication link's health. When the primary communication link's health falls below a preset abnormal threshold, the first and second operating data are used to further determine the risk value of a switchover of the used gateway communication device, accurately identifying when the operator is switching from using the primary communication link. This method identifies the operator's device switching behavior by switching from a primary communication link to a backup communication link. If the risk value exceeds a preset risk threshold, the primary and backup communication links are swapped. This approach accurately identifies operator device switching behavior based on detected switching risks, promptly replacing the platform link-bound devices to ensure consistency between the platform link-bound devices and the operator's actual carrying equipment. This guarantees communication reliability between the platform and the operator, improves the stability and service consistency of the link redundancy architecture, and avoids issues such as missing uplink packets, duplicate platform messages, out-of-order service requests, increased communication latency, and billing anomalies. Furthermore, this method can identify device switching risks and adjust link-bound devices without changing the operator's internal network equipment or adding third-party interfaces. It does not rely on manual inspections or service restarts, significantly reducing maintenance costs and adapting to various operators.

[0107] It should be noted that the method in this embodiment can be executed by a single device, such as a computer or server. The method can also be applied in a distributed scenario, where multiple devices cooperate to complete the task. In such a distributed scenario, one of these devices may execute only one or more steps of the method in this embodiment, and the multiple devices will interact with each other to complete the method described.

[0108] It should be noted that the above description describes some embodiments of this application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in a different order than that shown in the above embodiments and still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0109] Based on the same inventive concept, corresponding to any of the methods in the above embodiments, this application also provides a communication link adjustment device. Figure 2This is a schematic diagram of the structure of a communication link adjustment device provided in an embodiment of this application, as shown below. Figure 2 As shown, the communication link adjustment device includes a health detection module 210, a risk detection module 220, and a binding replacement module 230, wherein: The health detection module 210 is used to acquire the first operating data of the primary communication link and the second operating data of the backup communication link, and determine the link health of the primary communication link based on the first operating data. Risk detection module 220 is used to determine the risk value of switching of the gateway communication device based on the first operating data and the second operating data in response to the link health being lower than a preset abnormal threshold. The binding replacement module 230 is used to switch the gateway communication device bound to the primary communication link and the backup communication link in response to the risk value being greater than a preset risk threshold.

[0110] In some implementations, the health detection module 210 is specifically used for: The heartbeat response rate of the primary communication link is determined based on the number of heartbeat response messages and the number of heartbeat detection messages in the first running data. Based on the round-trip time of the messages in the first running data, determine the normalized link delay of the primary communication link; Based on the real-time uplink SMS count in the first operating data and the uplink SMS count on the peer link, the uplink traffic ratio of the primary communication link is determined, and based on the real-time uplink SMS count and the historical uplink SMS count in the first operating data, the traffic baseline matching degree of the primary communication link is determined. The link health of the primary communication link is determined based on the heartbeat response rate, normalized link latency, uplink traffic ratio, and traffic baseline matching degree of the primary communication link.

[0111] In some embodiments, the health detection module 210 is also used for: Determine whether the primary communication link is in a low-traffic period based on the real-time number of uplink SMS messages; If so, determine the link health of the primary communication link based on the heartbeat response rate and normalized link latency; otherwise, perform the steps to determine the link health of the primary communication link based on the heartbeat response rate, normalized link latency, uplink traffic ratio, and traffic baseline matching degree.

[0112] In some implementations, the risk detection module 220 includes a condition judgment unit and a risk value determination unit, wherein, The condition judgment unit is used to determine whether the primary communication link and the backup communication link meet the preset device switching conditions based on the first operating data and the second operating data, and to obtain the condition judgment identifier of the preset device switching conditions. The risk value determination unit is used to determine the risk value of the switching of the gateway communication device based on the condition judgment identifier.

[0113] In some implementations, the preset device switching conditions include at least one of device fingerprint change conditions, heartbeat recovery conditions, traffic migration conditions, and protocol response conditions; the condition judgment unit is specifically used for: If the heartbeat message fingerprint in the second running data is the same as the device fingerprint of the gateway communication device bound to the backup communication link, and the uplink SMS fingerprint in the second running data is the same as the device fingerprint of the gateway communication device bound to the backup communication link, and all heartbeat message fingerprints and all uplink SMS fingerprints in the first running data are the same, then it is determined that the primary communication link and the backup communication link meet the device fingerprint change conditions. Based on the second operating data, the heartbeat response rate and normalized link delay of the backup communication link are determined. If the heartbeat response rate of the backup communication link is greater than the preset response rate threshold, and the round-trip delay of the message of the backup communication link is greater than the preset delay threshold, then it is determined that the primary communication link and the backup communication link meet the heartbeat recovery conditions. Based on the second operating data, the uplink traffic ratio and the increase in the traffic ratio of the backup communication link are determined. Based on the first operating data, the increase in the traffic ratio of the primary communication link is determined. If the total number of uplink SMS messages in the first and second operating data is greater than the preset uplink quantity, and the uplink traffic ratio of the backup communication link is greater than the preset ratio threshold, and the increase in the traffic ratio of the backup communication link is greater than the preset increase threshold, and the increase in the traffic ratio of the primary communication link is less than the preset decrease threshold, then it is determined that the primary communication link and the backup communication link meet the traffic migration conditions. If the first running data contains multiple consecutive non-service return messages, then it is determined that the primary communication link and the backup communication link meet the protocol response conditions.

[0114] In some implementations, the binding replacement module 230 is specifically used for: Before switching the gateway communication devices bound to the primary communication link and the backup communication link, it is determined that the operator is in a suspected switching state, and the first operating data of the primary communication link and the second operating data of the backup communication link are retrieved again to obtain a new risk value. In response to multiple consecutive risk values ​​exceeding a preset risk threshold during a suspected switching state, the step of switching the gateway communication device bound to the primary communication link and the backup communication link is executed.

[0115] In some implementations, the binding replacement module 230 is specifically used for: Pause the transmission of downlink SMS messages through the primary communication link and wait for the transmission of downlink SMS messages and heartbeat messages that are currently being transmitted through the primary communication link to complete. Update the gateway communication device binding relationship between the primary communication link and the backup communication link, and synchronously update the global routing table according to the updated gateway communication device binding relationship, so as to refresh the gateway communication device binding relationship of all cluster service nodes based on the updated global routing table; Resume transmission of downlink SMS messages via the primary communication link.

[0116] In some implementations, the binding replacement module 230 is also used for: The connection status, protocol status, and device fingerprint matching degree of the backup communication link are verified. If the verification fails, the update of the gateway communication device binding relationship between the primary communication link and the backup communication link is abandoned. Additionally, if the number of consecutive successful heartbeat detections on the primary communication link within the preset verification time is less than the preset number, or if the gateway communication device binding relationship of some cluster service nodes has not been updated, then the gateway communication device binding relationship between the primary communication link and the backup communication link before the update will be restored. Additionally, if the number of uplink SMS messages received by the primary communication link within a preset time window is less than a preset number, the preset time window is updated, and it is re-evaluated whether the number of uplink SMS messages received within the new preset time window is less than the preset number. If so, the gateway communication device binding relationship between the primary communication link and the backup communication link is restored to its previous state.

[0117] In some implementations, the binding replacement module 230 is specifically used for: Before swapping the gateway communication devices bound to the primary and backup communication links, obtain the number of device swaps within a preset stable time period; In response to detecting that the number of device swaps is less than or equal to a preset threshold, the procedure of swapping the gateway communication device bound to the primary communication link and the backup communication link is executed.

[0118] Based on the same inventive concept, corresponding to the methods of any of the above embodiments, this application also provides an electronic device, 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 communication link adjustment method described in any of the above embodiments.

[0119] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 3A specific hardware structure of an electronic device is shown, which may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, memory 1020, input / output interface 1030, and communication interface 1040 are interconnected internally via the bus 1050.

[0120] The processor 1010 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.

[0121] The memory 1020 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program code is stored in the memory 1020 and is called and executed by the processor 1010.

[0122] The input / output interface 1030 is used to connect input / output modules to realize information input and output. Input / output modules can be configured as components within the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Input devices may include keyboards, mice, touchscreens, microphones, various sensors, etc., while output devices may include displays, speakers, vibrators, indicator lights, etc.

[0123] The communication interface 1040 is used to connect a communication module (not shown in the figure) to enable communication between this device and other devices. The communication module can communicate via wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).

[0124] Bus 1050 includes a pathway for transmitting information between various components of the device, such as processor 1010, memory 1020, input / output interface 1030, and communication interface 1040.

[0125] It should be noted that although the above-described device only shows the processor 1010, memory 1020, input / output interface 1030, communication interface 1040, and bus 1050, in specific implementations, the device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above-described device may only include the components necessary for implementing the embodiments of this specification, and not necessarily all the components shown in the figures.

[0126] The electronic devices described above are used to implement the corresponding communication link adjustment methods in any of the foregoing embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0127] Based on the same inventive concept, corresponding to the methods of any of the above embodiments, this application also provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the communication link adjustment method as described in any of the above embodiments.

[0128] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.

[0129] The computer instructions stored in the storage medium of the above embodiments are used to cause the computer to execute the communication link adjustment method as described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0130] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of this application (including the claims) is limited to these examples; within the framework of this application, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of the embodiments of this application as described above, which are not provided in the details for the sake of brevity.

[0131] Additionally, to simplify the description and discussion, and to avoid obscuring the embodiments of this application, the well-known power / ground connections to integrated circuit (IC) chips and other components may or may not be shown in the provided drawings. Furthermore, the apparatus may be shown in block diagram form to avoid obscuring the embodiments of this application, and this also takes into account the fact that the details of the implementation of these block diagram apparatuses are highly dependent on the platform on which the embodiments of this application will be implemented (i.e., these details should be fully understood by those skilled in the art). While specific details (e.g., circuits) have been set forth to describe exemplary embodiments of this application, it will be apparent to those skilled in the art that the embodiments of this application can be implemented without these specific details or with variations thereof. Therefore, these descriptions should be considered illustrative rather than restrictive.

[0132] Although this application has been described in conjunction with specific embodiments thereof, many substitutions, modifications, and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may be used with the embodiments discussed.

[0133] The embodiments of this application are intended to cover all such substitutions, modifications, and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the embodiments of this application should be included within the protection scope of this application.

Claims

1. A communication link adjustment method, characterized in that, include: Obtain first operating data of the primary communication link and second operating data of the backup communication link, and determine the link health of the primary communication link based on the first operating data; In response to the link health being lower than a preset abnormal threshold, a risk value for switching of the used gateway communication device is determined based on the first operating data and the second operating data; In response to the risk value exceeding a preset risk threshold, the gateway communication device bound to the primary communication link and the backup communication link is swapped.

2. The link control method according to claim 1, characterized in that, Determining the link health of the primary communication link based on the first operational data includes: The heartbeat response rate of the primary communication link is determined based on the number of heartbeat response messages and the number of heartbeat detection messages in the first running data. Based on the round-trip time of the messages in the first running data, the normalized link delay of the primary communication link is determined; Based on the real-time uplink SMS count in the first operating data and the uplink SMS count on the peer link, the uplink traffic ratio of the primary communication link is determined, and based on the real-time uplink SMS count and the historical uplink SMS count in the first operating data, the traffic baseline matching degree of the primary communication link is determined. The link health of the primary communication link is determined based on the heartbeat response rate, normalized link latency, uplink traffic ratio, and traffic baseline matching degree of the primary communication link.

3. The link control method according to claim 2, characterized in that, Before determining the link health of the primary communication link based on the heartbeat response rate, the normalized link latency, the uplink traffic percentage, and the traffic baseline matching degree, the method further includes: Based on the real-time uplink SMS volume, determine whether the primary communication link is in a low-traffic period; If so, the link health of the primary communication link is determined based on the heartbeat response rate and the normalized link delay; otherwise, the step of determining the link health of the primary communication link based on the heartbeat response rate, the normalized link delay, the uplink traffic ratio, and the traffic baseline matching degree is executed.

4. The link control method according to claim 1, characterized in that, Based on the first operating data and the second operating data, determine the risk value of the switching of the used gateway communication device, including: Based on the first operating data and the second operating data, it is determined whether the primary communication link and the backup communication link meet the preset device switching conditions, and the condition judgment identifier of the preset device switching conditions is obtained. Based on the aforementioned conditions, the risk value of switching of the gateway communication device is determined.

5. The link control method according to claim 4, characterized in that, The preset device switching conditions include at least one of the following: device fingerprint change conditions, heartbeat recovery conditions, traffic migration conditions, and protocol response conditions; Based on the first operating data and the second operating data, determining whether the primary communication link and the backup communication link meet preset device switching conditions includes: If the heartbeat message fingerprint in the second running data is the same as the device fingerprint of the gateway communication device bound to the backup communication link, and the uplink SMS fingerprint in the second running data is the same as the device fingerprint of the gateway communication device bound to the backup communication link, and all heartbeat message fingerprints and all uplink SMS fingerprints in the first running data are the same, then it is determined that the primary communication link and the backup communication link meet the device fingerprint change conditions. Based on the second operating data, the heartbeat response rate and normalized link delay of the backup communication link are determined. If the heartbeat response rate of the backup communication link is greater than a preset response rate threshold, and the round-trip delay of the message of the backup communication link is greater than a preset delay threshold, then it is determined that the primary communication link and the backup communication link meet the heartbeat recovery condition. Based on the second operating data, the uplink traffic ratio and traffic ratio increase of the backup communication link are determined. Based on the first operating data, the traffic ratio increase of the primary communication link is determined. If the total number of uplink SMS messages in the first and second operating data is greater than a preset uplink quantity, and the uplink traffic ratio of the backup communication link is greater than a preset ratio threshold, and the traffic ratio increase of the backup communication link is greater than a preset increase threshold, and the traffic ratio increase of the primary communication link is less than a preset decrease threshold, then it is determined that the primary communication link and the backup communication link meet the traffic migration conditions. If the first running data contains multiple consecutive non-service return messages, then it is determined that the primary communication link and the backup communication link meet the protocol response conditions.

6. The link control method according to claim 1, characterized in that, Before switching the gateway communication devices bound to the primary communication link and the backup communication link, the method further includes: If the operator is determined to be in a suspected handover state, the system returns to reacquire the first operating data of the primary communication link and the second operating data of the backup communication link to obtain a new risk value. In response to multiple consecutive risk values ​​exceeding the preset risk threshold during the suspected switching state, the step of switching the gateway communication device bound to the primary communication link and the backup communication link is executed.

7. The link control method according to claim 1, characterized in that, The process of swapping the gateway communication device bound to the primary communication link and the backup communication link includes: Pause the transmission of downlink SMS messages through the primary communication link and wait for the transmission of downlink SMS messages and heartbeat messages that are currently being transmitted in the primary communication link to complete. Update the gateway communication device binding relationship between the primary communication link and the backup communication link, and synchronously update the global routing table according to the updated gateway communication device binding relationship, so as to refresh the gateway communication device binding relationship of all cluster service nodes based on the updated global routing table; Resume transmission of downlink SMS messages via the primary communication link.

8. The link control method according to claim 7, characterized in that, Before updating the gateway communication device binding relationship between the primary communication link and the backup communication link, the method further includes: verifying the connection status, protocol status, and device fingerprint matching degree of the backup communication link. If the verification fails, the update of the gateway communication device binding relationship between the primary communication link and the backup communication link is abandoned. After synchronously updating the global routing table based on the updated gateway communication device binding relationships, the following is also included: If the number of consecutive successful heartbeat detections on the primary communication link within a preset verification time is less than a preset number, or if the gateway communication device binding relationships of some cluster service nodes have not been updated, then the gateway communication device binding relationships between the primary communication link and the backup communication link before the update will be restored; and, If the number of uplink SMS messages received by the primary communication link within a preset time window is less than a preset number, the preset time window is updated, and it is re-evaluated whether the number of uplink SMS messages received within the new preset time window is less than the preset number. If so, the gateway communication device binding relationship between the primary communication link and the backup communication link before the update is restored.

9. The link control method according to claim 1, characterized in that, Before switching the gateway communication devices bound to the primary communication link and the backup communication link, the method further includes: Get the number of device replacements within a preset stable duration; In response to detecting that the number of device swaps is less than or equal to a preset threshold, the step of swapping the gateway communication device bound to the primary communication link and the backup communication link is executed.

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