Metric value determination method and device, computer equipment and storage medium
By obtaining the role information of adjacent devices and target devices, the metric values of the connected link attributes are automatically configured, solving the error problem caused by manual configuration of metric values in IGP networks, achieving efficient and accurate metric value determination, and avoiding network failures.
Patent Information
- Application Number
- CN202510644202.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-19
- Publication Date
- 2025-09-12
AI Technical Summary
In an IGP network, manually configuring metric values is a huge workload and prone to errors, leading to traffic flow confusion, network congestion, and even packet loss.
By obtaining the role information of the adjacent device and the target device, the connected link attributes are determined. The reference metric values corresponding to the connected link attributes are determined based on the mapping relationship, and the interface metric values of the target device and the adjacent device are automatically configured.
Improves the efficiency and accuracy of metric value determination, preventing traffic flow confusion, network congestion, and packet loss.
Smart Images

Figure CN120639685A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the fields of network technology and security technology, and in particular to a metric value determination method, apparatus, computer equipment, and storage medium. Background Art
[0002] In an IGP (Interior Gateway Protocol) network, adding a new route or device requires configuring metrics (a numerical value used in routing protocols to measure link quality). Metric configuration requires operations personnel to identify the network layer at which all newly added links reside, calculate metric values based on the metric configuration policy, write the new metrics into a configuration script, and then distribute them to the device using a configuration protocol such as Netconfig.
[0003] In large-scale IP networks, a single device may involve hundreds of IGP links (depending on the number of local directions and bandwidth of the device). Therefore, manual metric configuration is labor-intensive and prone to the risk of incorrect metric value determination, which can lead to traffic flow confusion, network congestion, and even packet loss. Summary of the Invention
[0004] Based on this, it is necessary to provide a metric value determination method, apparatus, computer device and storage medium that can avoid metric value determination errors in response to the above technical problems.
[0005] In a first aspect, the present application provides a metric value determination method, applied to a target device, the method comprising:
[0006] Obtain the first role information of the adjacent device;
[0007] determining a connected link attribute according to the first role information and the second role information of the target device;
[0008] The reference metric value corresponding to the connected link attribute is used as the target metric value of the interface corresponding to the target device and the adjacent device.
[0009] In one embodiment, determining the connected link attribute based on the first role information and the second role information of the target device includes:
[0010] determining a first role attribute of the neighboring device according to the first role information;
[0011] determining a second role attribute of the target device according to the second role information of the target device;
[0012] Determine a connected link attribute according to the first role attribute and the second role attribute.
[0013] In one embodiment, determining the connected link attribute based on the first role attribute and the second role attribute includes:
[0014] Obtain at least one candidate link attribute included in the metric configuration policy; wherein each candidate link attribute corresponds to two candidate role attributes;
[0015] The two candidate role attributes corresponding to the first role attribute and the second role attribute are used as the candidate link attributes.
[0016] In one embodiment, the method further comprises:
[0017] Obtaining a mapping relationship contained in the metric configuration policy; wherein the mapping relationship records different candidate metric values corresponding to different candidate attribute links;
[0018] According to the mapping relationship, a reference metric value corresponding to the connected link attribute is determined.
[0019] In one embodiment, determining the reference metric value corresponding to the connected link attribute according to the mapping relationship includes:
[0020] Selecting a reference attribute link having the same attribute as the connected link from each candidate attribute link included in the mapping relationship;
[0021] The candidate metric value corresponding to the reference attribute link in the mapping relationship is used as the reference metric value corresponding to the connected link attribute.
[0022] In one embodiment, obtaining the first role information of the neighboring device includes:
[0023] Receive greeting messages from neighboring devices;
[0024] The first role information of the neighboring device is obtained from the hello message.
[0025] In a second aspect, the present application further provides a metric value determination device, which is configured on a target device, and includes:
[0026] An acquisition module, configured to acquire first role information of an adjacent device;
[0027] A first determining module, configured to determine a connected link attribute based on the first role information and the second role information of the target device;
[0028] The second determining module is configured to use the reference metric value corresponding to the connected link attribute as the target metric value of the interface corresponding to the target device and the adjacent device.
[0029] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are performed:
[0030] Obtain the first role information of the adjacent device;
[0031] determining a connected link attribute according to the first role information and the second role information of the target device;
[0032] The reference metric value corresponding to the connected link attribute is used as the target metric value of the interface corresponding to the target device and the adjacent device.
[0033] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the following steps:
[0034] Obtain the first role information of the adjacent device;
[0035] determining a connected link attribute according to the first role information and the second role information of the target device;
[0036] The reference metric value corresponding to the connected link attribute is used as the target metric value of the interface corresponding to the target device and the adjacent device.
[0037] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the following steps:
[0038] Obtain the first role information of the adjacent device;
[0039] determining a connected link attribute according to the first role information and the second role information of the target device;
[0040] The reference metric value corresponding to the connected link attribute is used as the target metric value of the interface corresponding to the target device and the adjacent device.
[0041] The above-mentioned metric value determination method, device, computer device and storage medium, by obtaining the first role information of the adjacent device, realizes determining the connected link attribute according to the first role information and the second role information of the target device, and then uses the reference metric value corresponding to the connected link attribute as the target metric value of the interface corresponding to the target device and the adjacent device. According to the above content, when the metric value needs to be obtained, the present application will pre-acquire the first role information of the adjacent device and the second role information of the target device, and then, according to the first role information and the second role information, determine the connected link attribute corresponding to the target device and the adjacent device, and determine the final target metric value through the connected link attribute, thereby ensuring that the determination of the target metric value is associated with the connected link attribute corresponding to the target device and the adjacent device, and further ensuring the accuracy of the target metric value determination. Compared with the method of manually determining the metric value in the prior art, the present application can not only effectively improve the efficiency of determining the target metric value, but also ensure the accuracy of determining the target metric value, and prevent the occurrence of traffic flow confusion, network congestion and even packet loss due to the deviation of the target metric value determination. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 A diagram illustrating an application environment of a metric value determination method provided in an embodiment of the present application;
[0043] Figure 2 A flowchart of the first metric value determination method provided in an embodiment of the present application;
[0044] Figure 3 A flowchart of the second metric value determination method provided in an embodiment of the present application;
[0045] Figure 4 A flowchart of the third metric value determination method provided in an embodiment of the present application;
[0046] Figure 5 A schematic diagram of device relationships provided in an embodiment of the present application;
[0047] Figure 6 A flowchart of the fourth metric value determination method provided in an embodiment of the present application;
[0048] Figure 7 A structural block diagram of a metric value determination device provided in an embodiment of the present application;
[0049] Figure 8 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0051] The metric value determination method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. The target device 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. By obtaining the first role information of the adjacent device, the connected link attributes are determined according to the first role information and the second role information of the target device, and then the reference metric value corresponding to the connected link attribute is used as the target metric value of the corresponding interface between the target device and the adjacent device. The terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablets, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented as an independent server or a server cluster consisting of multiple servers.
[0052] In one embodiment, Figure 2 As shown, a metric value determination method is provided, which is applied to Figure 1 Taking the target device in as an example, the following steps are included:
[0053] S201: Acquire first role information of a neighboring device.
[0054] It should be noted that the first role information refers to the ROLE information corresponding to the adjacent device; specifically, when the first role information of the adjacent device needs to be obtained, a greeting message of the adjacent device can be received, and the first role information of the adjacent device can be obtained from the greeting message.
[0055] In one embodiment of the present application, after the target device accesses the network, ISIS neighbor negotiation may be triggered; further, during the ISIS neighbor negotiation process, a hello message from a neighboring device is received, and the first role information of the neighboring device is obtained from the hello message.
[0056] S202: Determine a connected link attribute according to the first role information and the second role information of the target device.
[0057] It should be noted that the second role information of the target device can be configured after the target device is connected to the network in combination with the pre-settings of the operation and maintenance personnel; the role information may include but is not limited to: core, aggregation, access, etc.
[0058] Specifically, after the target device is connected to the network, the device role is defined in combination with the pre-set settings of the operation and maintenance personnel and written into the newly defined ROLE TLV, which is encapsulated in the hello message. Among them, the ROLE TLV contains a one-byte role code (RoleCode), which is the second role information of the target device. An example is shown below:
[0059] Type:256(0x0100)
[0060] Length:2
[0061] Value: [Role Code (1 byte) Priority (1 byte)]
[0062] It is further explained that when it is necessary to determine the attributes of the connected link based on the first role information and the second role information of the target device, all possible candidate link attributes can be obtained in advance, and then the correspondence between the target device and the adjacent device and each candidate link attribute can be judged based on the first role information and the second role information of the target device. If the target device and the adjacent device correspond to a candidate link attribute, the candidate link attribute is used as the connected link attribute.
[0063] Specifically, each candidate link attribute is a link attribute connecting two devices. If the role information of the target device and the adjacent device of the two devices connected by a candidate link attribute are the same, then it is considered that the target device and the adjacent device correspond to each other.
[0064] S203: Using the reference metric value corresponding to the connected link attribute as the target metric value of the corresponding interface between the target device and the adjacent device.
[0065] In one embodiment of the present application, a correspondence between at least one candidate link attribute and at least one candidate metric value can be obtained in advance; the correspondence records different candidate metric values corresponding to different candidate link attributes, and then, based on the correspondence, a reference metric value corresponding to the connected link attribute is determined; and the reference metric value corresponding to the connected link attribute is used as the target metric value of the corresponding interface between the target device and the adjacent device.
[0066] The above-mentioned metric value determination method obtains the first role information of the adjacent device, and determines the attributes of the connected link according to the first role information and the second role information of the target device, and then uses the reference metric value corresponding to the attributes of the connected link as the target metric value of the interface corresponding to the target device and the adjacent device. According to the above content, when the metric value needs to be obtained, the present application will pre-acquire the first role information of the adjacent device and the second role information of the target device, and then, according to the first role information and the second role information, determine the attributes of the connected link corresponding to the target device and the adjacent device, and determine the final target metric value through the attributes of the connected link, thereby ensuring that the determination of the target metric value is associated with the attributes of the connected link corresponding to the target device and the adjacent device, and further ensuring the accuracy of the determination of the target metric value. Compared with the method of manually determining the metric value in the prior art, the present application can not only effectively improve the efficiency of determining the target metric value, but also ensure the accuracy of determining the target metric value, and prevent the occurrence of traffic flow confusion, network congestion and even packet loss due to the deviation in the determination of the target metric value.
[0067] In one embodiment, if Figure 3 As shown, when it is necessary to determine the attributes of the connected link based on the first role information and the second role information of the target device, the following may be specifically included:
[0068] S301: Determine a first role attribute of a neighboring device according to first role information.
[0069] In an embodiment of the present application, when it is necessary to determine the first role attribute of the neighboring device according to the first role information, the following may be included: parsing the first role information to obtain the first role attribute of the neighboring device.
[0070] As an example, the first role information may include a first attribute identifier corresponding to the first role attribute; when it is necessary to determine the first role attribute of the adjacent device, the first attribute identifier contained in the first role information may be extracted, and then, based on the role attribute corresponding to the first attribute identifier, the first role attribute of the adjacent device may be determined.
[0071] S302: Determine a second role attribute of the target device according to the second role information of the target device.
[0072] In another embodiment of the present application, when it is necessary to determine the second role attribute of the target device according to the second role information of the target device, the following may be included: parsing the second role information of the target device to obtain the second role attribute of the target device.
[0073] As an example, the second role information may include a second attribute identifier corresponding to the second role attribute; when it is necessary to determine the second role attribute of the adjacent device, the second attribute identifier contained in the second role information may be extracted, and then, based on the role attribute corresponding to the second attribute identifier, the second role attribute of the target device may be determined.
[0074] S303: Determine the attributes of the connected link according to the first role attributes and the second role attributes.
[0075] In one embodiment of the present application, when it is necessary to determine the connected link attribute based on the first role attribute and the second role attribute, the following contents may be included: obtaining at least one candidate link attribute included in the Metric configuration policy; wherein each candidate link attribute corresponds to two candidate role attributes; and taking the candidate link attributes corresponding to the first role attribute and the second role attribute, respectively, of the two candidate role attributes as the connected link attributes.
[0076] The above-mentioned metric value determination method, by obtaining the first role attribute of the adjacent device and the second role attribute of the target device, realizes the determination of the connected link attribute based on the first role attribute and the second role attribute, and provides a data basis for the subsequent determination of the target metric value of the corresponding interface between the target device and the adjacent device. It ensures that the first role attribute of the adjacent device and the second role attribute of the target device can be combined when determining the target metric value, thereby improving the accuracy of the subsequent determination of the target metric value.
[0077] In one embodiment, if Figure 4 As shown in the figure, when determining the reference metric value corresponding to the connected link attribute, the following contents may also be included:
[0078] S401: Obtain the mapping relationship included in the Metric configuration policy.
[0079] The mapping relationship records different candidate metric values corresponding to different candidate attribute links.
[0080] It should be noted that the mapping relationship can be set or adjusted according to the historical experience and actual situation of the operation and maintenance personnel, and the specific content of the mapping relationship is not limited here.
[0081] As an example, the relationship table corresponding to the mapping relationship can be shown as follows:
[0082]
[0083] S402: Determine a reference metric value corresponding to the connected link attribute according to the mapping relationship.
[0084] It should be noted that when it is necessary to determine the reference metric value corresponding to the connected link attribute based on the mapping relationship, the following may be included: selecting a reference attribute link with the same attribute as the connected link from the candidate attribute links contained in the mapping relationship; and using the candidate metric value corresponding to the reference attribute link in the mapping relationship as the reference metric value corresponding to the connected link attribute.
[0085] In one embodiment of the present application, Figure 5 As shown, if there are five adjacent devices in total, the five adjacent devices are adjacent device A, adjacent device B, adjacent device C, adjacent device D and adjacent device E; if the second role attribute of the target device is core, the first role attribute of adjacent device A is core, the first role attribute of adjacent device B is core, the first role attribute of adjacent device C is aggregation, the first role attribute of adjacent device D is aggregation and the first role attribute of adjacent device E is access; therefore, the relationship table corresponding to the mapping relationship is as shown in the above table, therefore, it can be determined that the link attribute between the target device and the adjacent device A is between cores, therefore, the target metric value of the corresponding interface between the target device and the adjacent device A is 6000; it can also be determined that the target device The link attribute between the target device and neighboring device B is core-to-core. Therefore, the target metric value of the corresponding interface between the target device and neighboring device B is 6000. The link attribute between the target device and neighboring device C is core-aggregation. Therefore, the target metric value of the corresponding interface between the target device and neighboring device C is 12000. The link attribute between the target device and neighboring device D is core-aggregation. Therefore, the target metric value of the corresponding interface between the target device and neighboring device D is 12000. The link attribute between the target device and neighboring device E is core-access. Therefore, the target metric value of the corresponding interface between the target device and neighboring device D is 30000.
[0086] The above-mentioned metric value determination method obtains the mapping relationship contained in the metric configuration policy and determines the reference metric value corresponding to the connected link attribute based on the mapping relationship. This provides a data judgment basis for subsequently determining the target metric value of the corresponding interface between the target device and the adjacent device, ensuring the accuracy of the target metric value.
[0087] In one embodiment, if Figure 6 As shown in the figure, when you need to determine the target metric value of the corresponding interface of the target device and the adjacent device, you can include the following:
[0088] S601: Acquire first role information of a neighboring device.
[0089] S602: Determine a first role attribute of a neighboring device according to the first role information.
[0090] S603: Determine a second role attribute of the target device according to the second role information of the target device.
[0091] S604: Obtain at least one candidate link attribute included in the metric configuration policy; wherein each candidate link attribute corresponds to two candidate role attributes.
[0092] S605: Take the two candidate role attributes corresponding to the first role attribute and the second role attribute respectively as the candidate link attributes.
[0093] S606: Obtain a mapping relationship included in the metric configuration policy, wherein the mapping relationship records different candidate metric values corresponding to different candidate attribute links.
[0094] S607: Select a reference attribute link having the same attribute as the connected link from each candidate attribute link included in the mapping relationship.
[0095] S608: Use the candidate metric value corresponding to the reference attribute link in the mapping relationship as the reference metric value corresponding to the connected link attribute.
[0096] S609: Use the reference metric value corresponding to the connected link attribute as the target metric value of the interface corresponding to the target device and the adjacent device.
[0097] The above-mentioned metric value determination method obtains the first role information of the adjacent device, and determines the attributes of the connected link according to the first role information and the second role information of the target device, and then uses the reference metric value corresponding to the attributes of the connected link as the target metric value of the interface corresponding to the target device and the adjacent device. According to the above content, when the metric value needs to be obtained, the present application will pre-acquire the first role information of the adjacent device and the second role information of the target device, and then, according to the first role information and the second role information, determine the attributes of the connected link corresponding to the target device and the adjacent device, and determine the final target metric value through the attributes of the connected link, thereby ensuring that the determination of the target metric value is associated with the attributes of the connected link corresponding to the target device and the adjacent device, and further ensuring the accuracy of the determination of the target metric value. Compared with the method of manually determining the metric value in the prior art, the present application can not only effectively improve the efficiency of determining the target metric value, but also ensure the accuracy of determining the target metric value, and prevent the occurrence of traffic flow confusion, network congestion and even packet loss due to the deviation in the determination of the target metric value.
[0098] It should be understood that, although the steps in the flowcharts of the above embodiments are shown in sequence as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the flowcharts of the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily to be performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0099] Based on the same inventive concept, embodiments of the present application also provide a metric value determination device for implementing the aforementioned metric value determination method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations of one or more metric value determination device embodiments provided below can be found in the limitations of the metric value determination method described above and will not be repeated here.
[0100] In one embodiment, Figure 7 As shown, a metric value determination device is provided, including: an acquisition module 10, a first determination module 20 and a second determination module 30, wherein:
[0101] The acquisition module 10 is configured to acquire first role information of an adjacent device.
[0102] The first determining module 20 is configured to determine a connected link attribute according to the first role information and the second role information of the target device.
[0103] The second determining module 30 is configured to use the reference metric value corresponding to the connected link attribute as the target metric value of the interface corresponding to the target device and the adjacent device.
[0104] In one embodiment, determining a first role attribute of the neighboring device based on the first role information;
[0105] determining a second role attribute of the target device according to the second role information of the target device;
[0106] Determine the connected link attribute according to the first role attribute and the second role attribute.
[0107] In one embodiment, at least one candidate link attribute included in the metric configuration policy is obtained; wherein each candidate link attribute corresponds to two candidate role attributes;
[0108] The candidate link attributes corresponding to the two candidate role attributes and the first role attribute and the second role attribute respectively are used as the connected link attributes.
[0109] In one embodiment, a mapping relationship included in a metric configuration policy is obtained; wherein the mapping relationship records different candidate metric values corresponding to different candidate attribute links;
[0110] Based on the mapping relationship, the reference metric value corresponding to the connected link attribute is determined.
[0111] In one embodiment, a reference attribute link having the same attribute as the connected link is selected from each candidate attribute link included in the mapping relationship;
[0112] The candidate metric value corresponding to the reference attribute link in the mapping relationship is used as the reference metric value corresponding to the connected link attribute.
[0113] In one embodiment, receiving a hello message from a neighboring device;
[0114] Get the first role information of the neighboring device from the hello message.
[0115] The above-mentioned metric value determination device obtains the first role information of the adjacent device, and determines the attributes of the connected link according to the first role information and the second role information of the target device, and then uses the reference metric value corresponding to the attributes of the connected link as the target metric value of the interface corresponding to the target device and the adjacent device. According to the above content, when the metric value needs to be obtained, the present application will pre-acquire the first role information of the adjacent device and the second role information of the target device, and then, according to the first role information and the second role information, determine the attributes of the connected link corresponding to the target device and the adjacent device, and determine the final target metric value through the attributes of the connected link, thereby ensuring that the determination of the target metric value is associated with the attributes of the connected link corresponding to the target device and the adjacent device, and further ensuring the accuracy of the determination of the target metric value. Compared with the method of manually determining the metric value in the prior art, the present application can not only effectively improve the efficiency of determining the target metric value, but also ensure the accuracy of determining the target metric value, and prevent the occurrence of traffic flow confusion, network congestion and even packet loss due to the deviation of the target metric value determination.
[0116] Each module in the aforementioned metric value determination device may be implemented in whole or in part through software, hardware, or a combination thereof. Each module may be embedded in or independent of a processor in a computer device in the form of hardware, or may be stored in a memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.
[0117] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 8 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface, the display unit and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a metric value determination method is implemented. The display unit of the computer device is used to form a visually visible image, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse.
[0118] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0119] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0120] Obtain the first role information of the adjacent device;
[0121] determining a connected link attribute based on the first role information and the second role information of the target device;
[0122] The reference metric value corresponding to the connected link attribute is used as the target metric value for the corresponding interface between the target device and the adjacent device.
[0123] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0124] Determining a first role attribute of the adjacent device according to the first role information;
[0125] determining a second role attribute of the target device according to the second role information of the target device;
[0126] Determine the connected link attribute according to the first role attribute and the second role attribute.
[0127] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0128] Obtain at least one candidate link attribute included in the metric configuration policy; each candidate link attribute corresponds to two candidate role attributes;
[0129] The candidate link attributes corresponding to the two candidate role attributes and the first role attribute and the second role attribute respectively are used as the connected link attributes.
[0130] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0131] Obtain the mapping relationship contained in the metric configuration policy; wherein the mapping relationship records different candidate metric values corresponding to different candidate attribute links;
[0132] Based on the mapping relationship, the reference metric value corresponding to the connected link attribute is determined.
[0133] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0134] Selecting a reference attribute link having the same attribute as the connected link from each candidate attribute link included in the mapping relationship;
[0135] The candidate metric value corresponding to the reference attribute link in the mapping relationship is used as the reference metric value corresponding to the connected link attribute.
[0136] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0137] Receive greeting messages from neighboring devices;
[0138] Get the first role information of the neighboring device from the hello message.
[0139] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0140] Obtain the first role information of the adjacent device;
[0141] determining a connected link attribute based on the first role information and the second role information of the target device;
[0142] The reference metric value corresponding to the connected link attribute is used as the target metric value for the corresponding interface between the target device and the adjacent device.
[0143] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0144] Determining a first role attribute of the adjacent device according to the first role information;
[0145] determining a second role attribute of the target device according to the second role information of the target device;
[0146] Determine the connected link attribute according to the first role attribute and the second role attribute.
[0147] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0148] Obtain at least one candidate link attribute included in the metric configuration policy; each candidate link attribute corresponds to two candidate role attributes;
[0149] The candidate link attributes corresponding to the two candidate role attributes and the first role attribute and the second role attribute respectively are used as the connected link attributes.
[0150] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0151] Obtain the mapping relationship contained in the metric configuration policy; wherein the mapping relationship records different candidate metric values corresponding to different candidate attribute links;
[0152] Based on the mapping relationship, the reference metric value corresponding to the connected link attribute is determined.
[0153] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0154] Selecting a reference attribute link having the same attribute as the connected link from each candidate attribute link included in the mapping relationship;
[0155] The candidate metric value corresponding to the reference attribute link in the mapping relationship is used as the reference metric value corresponding to the connected link attribute.
[0156] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0157] Receive greeting messages from neighboring devices;
[0158] Get the first role information of the neighboring device from the hello message.
[0159] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0160] Obtain the first role information of the adjacent device;
[0161] determining a connected link attribute based on the first role information and the second role information of the target device;
[0162] The reference metric value corresponding to the connected link attribute is used as the target metric value for the corresponding interface between the target device and the adjacent device.
[0163] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0164] Determining a first role attribute of the adjacent device according to the first role information;
[0165] determining a second role attribute of the target device according to the second role information of the target device;
[0166] Determine the connected link attribute according to the first role attribute and the second role attribute.
[0167] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0168] Obtain at least one candidate link attribute included in the metric configuration policy; each candidate link attribute corresponds to two candidate role attributes;
[0169] The candidate link attributes corresponding to the two candidate role attributes and the first role attribute and the second role attribute respectively are used as the connected link attributes.
[0170] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0171] Obtain the mapping relationship contained in the metric configuration policy; wherein the mapping relationship records different candidate metric values corresponding to different candidate attribute links;
[0172] Based on the mapping relationship, the reference metric value corresponding to the connected link attribute is determined.
[0173] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0174] Selecting a reference attribute link having the same attribute as the connected link from each candidate attribute link included in the mapping relationship;
[0175] The candidate metric value corresponding to the reference attribute link in the mapping relationship is used as the reference metric value corresponding to the connected link attribute.
[0176] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0177] Receive greeting messages from neighboring devices;
[0178] Get the first role information of the neighboring device from the hello message.
[0179] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions.
[0180] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, and the like.
[0181] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0182] The above embodiments merely illustrate several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art may make various modifications and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A metric value determination method, characterized in that: Applied to a target device, the method includes: Obtain the first role information of the adjacent device; determining a connected link attribute according to the first role information and the second role information of the target device; The reference metric value corresponding to the connected link attribute is used as the target metric value of the interface corresponding to the target device and the adjacent device.
2. The method according to claim 1, characterized in that The determining, according to the first role information and the second role information of the target device, a connected link attribute includes: determining a first role attribute of the neighboring device according to the first role information; determining a second role attribute of the target device according to the second role information of the target device; Determine a connected link attribute according to the first role attribute and the second role attribute.
3. The method according to claim 2, characterized in that The determining, according to the first role attribute and the second role attribute, the connected link attribute includes: Obtain at least one candidate link attribute included in the metric configuration policy; wherein each candidate link attribute corresponds to two candidate role attributes; The two candidate role attributes corresponding to the first role attribute and the second role attribute are used as the candidate link attributes.
4. The method according to claim 1, wherein The method further comprises: Obtaining a mapping relationship contained in the metric configuration policy; wherein the mapping relationship records different candidate metric values corresponding to different candidate attribute links; According to the mapping relationship, a reference metric value corresponding to the connected link attribute is determined.
5. The method according to claim 4, characterized in that The determining, according to the mapping relationship, a reference metric value corresponding to the connected link attribute includes: Selecting a reference attribute link having the same attribute as the connected link from each candidate attribute link included in the mapping relationship; The candidate metric value corresponding to the reference attribute link in the mapping relationship is used as the reference metric value corresponding to the connected link attribute.
6. The method according to any one of claims 1 to 5, characterized in that The obtaining of the first role information of the adjacent device includes: Receive greeting messages from neighboring devices; The first role information of the neighboring device is obtained from the hello message.
7. A metric value determination device, characterized in that: Configured on a target device, the apparatus includes: An acquisition module, configured to acquire first role information of an adjacent device; A first determining module, configured to determine a connected link attribute based on the first role information and the second role information of the target device; The second determining module is configured to use the reference metric value corresponding to the connected link attribute as the target metric value of the interface corresponding to the target device and the adjacent device.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.