Topology matching method, computer equipment and storage medium

By automatically calculating the matching score between logical topology and physical topology by computer equipment, the complexity of matching between logical topology and physical topology is solved, and matching efficiency and accuracy are improved.

CN119182672APending Publication Date: 2024-12-24ZTE CORP

Patent Information

Application Number
CN202310745719.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-21
Publication Date
2024-12-24

AI Technical Summary

Technical Problem

During the software development process, the matching between logical topology and physical topology is complex, resulting in low matching efficiency and accuracy, and requires a lot of manual time.

Method used

By obtaining the attribute description file of the logical topology and the attribute information of the candidate physical device, the matching score between each network element and the candidate physical device is calculated, and the matching relationship between the logical topology and the physical topology is automatically determined.

Benefits of technology

No manual participation is required, which significantly improves the matching efficiency and accuracy between logical topology and physical topology, and reduces matching time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119182672A_ABST
    Figure CN119182672A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a topology matching method, computer equipment and a storage medium, and belongs to the field of communication. The method comprises: obtaining an attribute description file of a logical topology, the logical topology comprising N network elements, and the attribute description file comprising an attribute constraint condition of each network element; obtaining attribute information of each candidate physical device in M candidate physical devices, wherein M is an integer greater than N; according to the attribute information of each candidate physical device, determining a matching degree score of each network element and each candidate physical device under an attribute constraint condition; and determining N target physical devices matched with the logical topology from the M candidate physical devices according to the matching degree score of each network element and each candidate physical device under the attribute constraint condition. According to the technical scheme provided by the embodiment of the invention, the matching efficiency and accuracy between the logical topology and the physical topology are greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to a topology matching method, a computer device and a storage medium. Background Art

[0002] During the software development process, the software needs to be tested. In order to save manpower, time or hardware resources and improve testing efficiency, software automated testing has emerged. In automated testing, the matching between logical topology and physical topology is particularly important. Currently, it is mainly done manually by testers to match logical topology with physical topology. However, the matching between logical topology and physical topology is relatively complex, requiring high capabilities of testers, and it takes a long time to achieve the matching between logical topology and physical topology, resulting in low matching efficiency and accuracy between logical topology and physical topology. Therefore, how to improve the matching efficiency and accuracy between logical topology and physical topology is a problem that needs to be solved urgently. Summary of the invention

[0003] The embodiments of the present invention provide a topology matching method, a computer device and a storage medium, aiming to improve the matching efficiency and accuracy between a logical topology and a physical topology.

[0004] In a first aspect, an embodiment of the present invention provides a topology matching method, including:

[0005] Acquire a property description file of a logical topology, where the logical topology includes N network elements, and the property description file includes a property constraint condition of each of the network elements, where N is an integer greater than or equal to 1;

[0006] Obtaining attribute information of each of the M candidate physical devices, where M is an integer greater than N;

[0007] Determine, according to the attribute information of each of the candidate physical devices, a matching score between each of the network elements and each of the candidate physical devices under the attribute constraint condition;

[0008] According to the matching scores between each network element and each candidate physical device under the attribute constraint condition, N target physical devices matching the logical topology are determined from the M candidate physical devices.

[0009] In a second aspect, an embodiment of the present invention further provides a computer device, comprising a processor, a memory, a computer program stored in the memory and executable by the processor, and a data bus for implementing a connection and communication between the processor and the memory, wherein when the computer program is executed by the processor, the topology matching method described in the first aspect is implemented.

[0010] In a third aspect, an embodiment of the present invention further provides a storage medium for computer-readable storage, wherein the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the topology matching method as described in the first aspect.

[0011] An embodiment of the present invention provides a topology matching method, a computer device and a storage medium. The embodiment of the present invention obtains an attribute description file of a logical topology including N network elements. Since the attribute description file includes the attribute constraint conditions of each network element in the logical topology, the matching score between each network element and each candidate physical device under the attribute constraint conditions can be determined according to the attribute information of each candidate physical device in the M candidate physical devices. Then, according to the matching score between each network element and each candidate physical device under the attribute constraint conditions, N target physical devices matching the logical topology can be accurately determined from the M candidate physical devices. The whole process does not require human intervention, which greatly improves the matching efficiency and accuracy between the logical topology and the physical topology. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0013] Figure 1 is a schematic block diagram of the structure of a computer device provided by an embodiment of the present invention;

[0014] Figure 2 It is a flowchart of a topology matching method provided by an embodiment of the present invention;

[0015] Figure 3 yes Figure 2 A schematic diagram of a sub-step flow chart of a topology matching method in FIG.

[0016] Figure 4 yes Figure 3 A schematic flow chart of another sub-step of the topology matching method in FIG.

[0017] Figure 5 It is a flowchart of another topology matching method provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0018] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0019] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.

[0020] It should be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0021] During the software development process, the software needs to be tested. In order to save manpower, time or hardware resources and improve testing efficiency, software automated testing has emerged. In automated testing, the matching between logical topology and physical topology is particularly important. Currently, it is mainly done manually by testers to match logical topology with physical topology. However, the matching between logical topology and physical topology is relatively complex, requiring high capabilities of testers, and it takes a long time to achieve the matching between logical topology and physical topology, resulting in low matching efficiency and accuracy between logical topology and physical topology.

[0022] To solve the above problems, an embodiment of the present invention provides a topology matching method, a computer device and a storage medium. The topology matching method obtains an attribute description file of a logical topology including N network elements. Since the attribute description file includes the attribute constraint conditions of each network element in the logical topology, the matching score between each network element and each candidate physical device under the attribute constraint conditions can be determined according to the attribute information of each candidate physical device in the M candidate physical devices. Then, according to the matching score between each network element and each candidate physical device under the attribute constraint conditions, N target physical devices matching the logical topology can be accurately determined from the M candidate physical devices. The whole process does not require manual participation, which greatly improves the matching efficiency and accuracy between the logical topology and the physical topology.

[0023] In an embodiment of the present invention, the computer device may be a server or a terminal device. The terminal device may be a mobile phone, a tablet computer, a laptop computer, a desktop computer, a personal digital assistant or a wearable device, etc. The server may be an independent server or a server cluster composed of multiple servers. It may also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.

[0024] Some embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0025] See also Figure 1 , Figure 1 It is a schematic block diagram of the structure of a computer device provided by an embodiment of the present invention.

[0026] like Figure 1 As shown, the computer device 100 includes a processor 101 and a memory 102 , and the processor 101 and the memory 102 are connected via a bus 103 , such as an I2C (Inter-integrated Circuit) bus.

[0027] Specifically, the processor 101 is used to provide computing and control capabilities to support the operation of the entire computer device. The processor 101 can be a central processing unit (CPU), and the processor 101 can also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.

[0028] Specifically, the memory 102 may be a Flash chip, a read-only memory (ROM) disk, an optical disk, a USB flash drive, or a mobile hard disk.

[0029] Those skilled in the art will understand that Figure 1The structure shown in the figure is only a block diagram of a part of the structure related to the embodiment of the present invention, and does not constitute a limitation on the computer device to which the embodiment of the present invention is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0030] The processor 101 is used to run the computer program stored in the memory 102, and implement any one of the topology matching methods provided by the embodiments of the present invention when executing the computer program.

[0031] In some embodiments, the processor 101 is used to run a computer program stored in the memory, and implements the following steps when executing the computer program:

[0032] Acquire a property description file of a logical topology, where the logical topology includes N network elements, and the property description file includes a property constraint condition of each of the network elements, where N is an integer greater than or equal to 1;

[0033] Obtaining attribute information of each of the M candidate physical devices, where M is an integer greater than N;

[0034] Determine, according to the attribute information of each of the candidate physical devices, a matching score between each of the network elements and each of the candidate physical devices under the attribute constraint condition;

[0035] According to the matching scores between each network element and each candidate physical device under the attribute constraint condition, N target physical devices matching the logical topology are determined from the M candidate physical devices.

[0036] In some embodiments, before obtaining the attribute information of each of the M candidate physical devices, the processor 101 is further configured to implement:

[0037] Acquire a device screening condition, where the device screening condition includes at least one of a resource pool identifier and a user identifier;

[0038] Each physical device that meets the device screening condition and is in an idle state is selected from the preset resource pool as a candidate physical device, and M candidate physical devices are obtained.

[0039] In some embodiments, the attribute constraints include constraints on at least one of the device name, device type, device tag, board type, board tag, and interface information; the attribute information includes at least one of the device name, device type, device tag, board type, board tag, and interface information of the candidate physical device, and the interface information includes at least one of the number of interfaces, interface type, and interface rate.

[0040] In some embodiments, the constraints of the interface information include constraints on at least one of the number of interfaces, interface type, and interface rate, and the constraints of the interface information also include cross-board labels, which are used to constrain the interfaces of the network element to be located on different boards of the candidate physical device.

[0041] In some embodiments, the attribute constraint condition includes multiple constraints, and the processor 101 is used to implement, when determining, according to the attribute information of each candidate physical device, a matching score between each network element and each candidate physical device under the attribute constraint condition:

[0042] For each of the network elements, determining a matching score between the network element and each of the candidate physical devices under each of the constraint conditions according to the attribute information of each of the candidate physical devices;

[0043] The matching scores between the network element and each candidate physical device under each constraint condition are summed to obtain the matching scores between the network element and each candidate physical device under the attribute constraint condition.

[0044] In some embodiments, when the processor 101 determines the matching score between the network element and each of the candidate physical devices under each of the constraint conditions according to the attribute information of each of the candidate physical devices, it is configured to implement:

[0045] For each of the constraints, determining that the matching score between the candidate physical device corresponding to the constraint satisfied by the attribute information and the network element is a preset first matching score;

[0046] It is determined that the matching score between the candidate physical device corresponding to the attribute information not satisfying the constraint condition and the network element is a preset second matching score, and the first matching score is greater than the second matching score.

[0047] In some embodiments, the processor 101 is further configured to implement the following steps:

[0048] In the case where the constraint condition is an interface constraint condition, determining an interface matching score between each of the network elements and each of the candidate physical devices according to the interface information of each of the candidate physical devices and the interface constraint condition of each network element;

[0049] Constructing an interface matching score matrix according to the interface matching score between each network element and each candidate physical device;

[0050] Determining, according to the interface matching score matrix, whether there is a candidate physical device group that matches the interface constraint conditions of each of the network elements;

[0051] When it is determined that there is a candidate physical device group that matches the interface constraint condition of each of the network elements, determining a matching score between each of the network elements and each of the candidate physical devices under each of the interface constraint conditions as a first matching score;

[0052] When it is determined that there is no candidate physical device group that matches all the interface constraints of each network element, a matching score between each network element and each candidate physical device under each interface constraint is determined as a second matching score.

[0053] In some embodiments, when the processor 101 determines N target physical devices matching the logical topology from the M candidate physical devices according to the matching score between each network element and each candidate physical device under the attribute constraint condition, it is configured to implement:

[0054] Constructing a comprehensive matching score matrix according to the matching scores of each network element and each candidate physical device under the attribute constraint condition;

[0055] Based on a preset optimal matching algorithm and according to the comprehensive matching score matrix, N target physical devices matching the logical topology are determined from the M candidate physical devices.

[0056] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the computer device described above can refer to the corresponding process in the following topology matching method embodiment, which will not be repeated here.

[0057] The following will be combined Figure 1 The computer device in the embodiment of the present invention is used to introduce the topology matching method in detail. Figure 1 The computer device is only used to explain the topology matching method provided in the embodiment of the present invention, but does not constitute a limitation on the application scenario of the topology matching method provided in the embodiment of the present invention.

[0058] See also Figure 2 , Figure 2 It is a flowchart of a topology matching method provided by an embodiment of the present invention.

[0059] like Figure 2 As shown, the topology matching method includes steps S101 to S104.

[0060] Step S101: Acquire a property description file of a logical topology, where the logical topology includes N network elements, and the property description file includes a property constraint condition of each network element.

[0061] In this embodiment, N is an integer greater than or equal to 1, that is, the logical topology may include one network element or multiple network elements. The property description file describes the property constraints of each network element in the form of a key-value pair, and the property description file of the logical topology can be obtained by programming the property constraints of each network element in the logical topology based on a structured programming language. For example, the property description file of the logical topology is a property description file in the YAML (YAML Ain't a Markup Language) format or a property description file in the JSON (JavaScript Object Notation, JS object notation) format.

[0062] In some embodiments, the attribute constraint of each network element includes a constraint of at least one of the device name, device type, device label, board type, board label, and interface information. The constraint of the interface information includes a constraint of at least one of the number of interfaces, interface type, and interface rate, and the constraint of the interface information also includes a cross-board label, which is used to constrain the interface of the network element to be located on different boards of the candidate physical device.

[0063] Among them, the device name constraint is used to constrain the name of the physical device matching the network element, the device type constraint is used to constrain the type of the physical device matching the network element, the board type constraint is used to constrain the board type of the physical device matching the network element, the board label constraint is used to constrain the board label of the physical device matching the network element, the interface quantity constraint is used to constrain the number of interfaces of the physical device matching the network element, the interface type constraint is used to constrain the type of the interface of the physical device matching the network element, and the interface rate constraint is used to constrain the rate of the interface of the physical device matching the network element.

[0064] In some embodiments, the method for obtaining the attribute description file of the logical topology can be: the computer device displays an attribute constraint configuration page, which displays the logical topology and a confirmation button; in response to the user's operation of selecting a network element of the logical topology, the attribute constraint selection list of the selected network element is displayed; in response to the user's operation of selecting a constraint condition on the attribute constraint selection list, the selected constraint condition in the attribute constraint selection list is set to a checked state; in response to the user's triggering operation on the confirmation button, the attribute description file of the logical topology is generated according to the constraint conditions in the attribute constraint selection list corresponding to each network element that are in a checked state.

[0065] In some embodiments, the method of obtaining the attribute description file of the logical topology may be: the computer device obtains the attribute description file of the logical topology selected by the user from the local memory or the external memory. Or the computer device obtains the file download request triggered by the user, and downloads the attribute description file corresponding to the file identifier in the file download request from the server. Among them, the external memory may be a USB flash disk (USB flash disk) or a TF (Trans-flash) card.

[0066] Step S102: Acquire attribute information of each candidate physical device among the M candidate physical devices.

[0067] In this embodiment, M is an integer greater than N, and the M candidate physical devices may be all physical devices in the preset resource pool, or may be part of the physical devices in the preset resource pool, which is not specifically limited in this embodiment of the present invention. The attribute information of the candidate physical device includes at least one of the device name, device type, device label, board type, board label, and interface information of the candidate physical device, and the interface information of the candidate physical device includes at least one of the number of interfaces, interface type, and interface rate of the candidate physical device.

[0068] Step S103: Determine, based on the attribute information of each candidate physical device, the matching score between each network element and each candidate physical device under the attribute constraint condition.

[0069] In this embodiment, since the attribute information of the candidate physical device includes at least one of the device name, device type, device label, board type, board label and interface information of the candidate physical device, and the attribute constraint conditions of the network element include the constraint conditions of at least one of the device name, device type, device label, board type, board label and interface information, therefore, the matching score of the network element and each candidate physical device under the attribute constraint conditions of the network element can be accurately determined through the constraint conditions of at least one of the device name, device type, device label, board type, board label and interface information of the candidate physical device and at least one of the device name, device type, device label, board type, board label and interface information.

[0070] In some embodiments, Figure 3 As shown, step S103 includes: sub-step S1031 to sub-step S1032.

[0071] Sub-step S1031 : for each network element, according to the attribute information of each candidate physical device, determine the matching score between the network element and each candidate physical device under each constraint condition.

[0072] In this embodiment, the attribute constraint of each network element may include multiple constraints. For example, the logical topology includes network element A, network element B, and network element C, and the attribute constraint of network element A includes the constraint of device type, the constraint of board type, and the constraint of interface information, the attribute constraint of network element B includes the constraint of device name, the constraint of device type, the constraint of board type, the constraint of board label, and the constraint of interface information, and the attribute constraint of network element C includes the constraint of board type and the constraint of interface information.

[0073] In some embodiments, for each constraint condition, the matching score between the candidate physical device and the network element corresponding to the attribute information satisfying the constraint condition is determined to be a preset first matching score; the matching score between the candidate physical device and the network element corresponding to the attribute information not satisfying the constraint condition is determined to be a preset second matching score, and the first matching score is less than the second matching score. The first matching score and the second matching score can be set based on actual conditions, and the embodiment of the present invention does not specifically limit this. For example, the first matching score is 0 points, and the second matching score is 100 points or 10000 points.

[0074] For example, the attribute constraint of network element A includes the constraint of device type and the constraint of board type, and the device type constraint includes the device type of device_type_A, and the board type constraint includes the board type of board_type_A. The device type of candidate physical device A is device_type_A, and the board type of candidate physical device A is board_type_B. Since the device type constraint of network element A includes the device type of device_type_A, and the device type of candidate physical device A is device_type_A, that is, the device type of candidate physical device A meets the corresponding constraint, the matching score of candidate physical device A and network element A under the constraint of device type is 0. Since the board type constraint of network element A includes the board type of board_type_A, and the board type of candidate physical device A is board_type_B, that is, the board type of candidate physical device A does not meet the corresponding constraint, the matching score of candidate physical device A and network element A under the constraint of board type is 10,000.

[0075] In some embodiments, Figure 4 As shown, sub-step S1031 includes sub-steps S10311 to S10315.

[0076] Sub-step S10311: When the constraint condition is an interface constraint condition, determine the interface matching score between each network element and each candidate physical device according to the interface information of each candidate physical device and the interface constraint condition of each network element.

[0077] In this embodiment, the interface constraint is a constraint of the interface information, and the constraint of the interface information includes a constraint of at least one of the number of interfaces, the interface type, and the interface rate. The constraint of the interface information also includes a cross-board label, and the cross-board label is used to constrain the interface of the network element to be located on different boards of the candidate physical device. The candidate physical device group may include one or more candidate physical devices. This embodiment can accurately determine the matching score between the network element and the candidate physical device under the interface constraint.

[0078] In some embodiments, the interface constraint condition includes multiple interface constraint sub-conditions. According to the interface information of each candidate physical device and the interface constraint condition of each network element, the interface matching score between each network element and each candidate physical device can be determined as follows: for each network element, according to the interface information of each candidate physical device, the matching score between the network element and each candidate physical device under each interface constraint sub-condition is determined; the matching scores between the network element and each candidate physical device under each interface constraint sub-condition are summed to obtain the interface matching score between the network element and each candidate physical device under the interface constraint condition.

[0079] In some embodiments, based on the interface information of each candidate physical device, the method for determining the matching score between the network element and each candidate physical device under each interface constraint sub-condition can be: for each interface constraint sub-condition, determining the matching score between the candidate physical device and the network element corresponding to the interface information satisfying the interface constraint sub-condition as a preset first matching score; determining the matching score between the candidate physical device and the network element corresponding to the interface information not satisfying the interface constraint sub-condition as a preset second matching score, and the first matching score is less than the second matching score.

[0080] For example, the interface constraint of network element C includes two interface constraint sub-conditions, which are the interface rate constraint and the interface type constraint. If the interface rate of candidate physical device B satisfies the interface rate constraint of network element C, the matching score between network element C and candidate physical device B under the interface rate constraint is 0. If the interface type of candidate physical device B also satisfies the interface type constraint of network element C, the matching score between network element C and candidate physical device B under the interface type constraint is also 0. Therefore, the interface matching score between network element C and candidate physical device B under the interface constraint of network element C is 0+0=0.

[0081] For another example, the interface constraint of network element D includes two interface constraint sub-conditions, which are the interface rate constraint and the interface type constraint. If the interface rate of candidate physical device C meets the interface rate constraint of network element D, the matching score between network element D and candidate physical device C under the interface rate constraint is 0. If the interface type of candidate physical device C does not meet the interface type constraint of network element D, the matching score between network element D and candidate physical device C under the interface type constraint is 10000. Therefore, the interface matching score between network element D and candidate physical device C under the interface constraint of network element D is 0+10000=10000.

[0082] Sub-step S10312: construct an interface matching score matrix according to the interface matching score between each network element and each candidate physical device.

[0083] In this embodiment, any column vector of the interface matching score matrix is ​​the interface matching score between any network element and each candidate physical device, and any row vector of the interface matching score matrix is ​​the interface matching score between any candidate physical device and each network element. For example, the logical topology includes network element A, network element B, and network element C, and the interface matching scores between network element A and candidate physical device A, candidate physical device B, and candidate physical device C are all 0 points, the interface matching scores between network element B and candidate physical device A, candidate physical device B, and candidate physical device C are 0 points, 10,000 points, and 0 points respectively, and the interface matching scores between network element C and candidate physical device A, candidate physical device B, and candidate physical device C are 10,000 points, 10,000 points, and 0 points respectively, then the following interface matching score matrix can be constructed:

[0084]

[0085] In some embodiments, any column vector of the interface matching score matrix is ​​the interface matching score between any candidate physical device and each network element, and any row vector of the interface matching score matrix is ​​the interface matching score between any network element and each candidate physical device. For example, the logical topology includes network element A, network element B, and network element C, and the interface matching scores between network element A and candidate physical device A, candidate physical device B, and candidate physical device C are all 0 points, the interface matching scores between network element B and candidate physical device A, candidate physical device B, and candidate physical device C are 0 points, 10,000 points, and 0 points, respectively, and the interface matching scores between network element C and candidate physical device A, candidate physical device B, and candidate physical device C are 10,000 points, 10,000 points, and 0 points, respectively. Then, the following interface matching score matrix can be constructed:

[0086]

[0087] Sub-step S10313: Determine, based on the interface matching score matrix, whether there is a candidate physical device group that matches the interface constraint conditions of each network element.

[0088] In this embodiment, the interface matching score matrix can be optimally matched based on a preset optimal matching algorithm; if the optimal matching result of the interface matching score matrix can be calculated, it is determined that there is a candidate physical device group that matches the interface constraints of each network element among the M candidate physical devices; if the optimal matching result of the interface matching score matrix cannot be calculated, it is determined that there is no candidate physical device group that matches the interface constraints of each network element among the M candidate physical devices. Among them, the preset optimal matching algorithm can be set based on actual conditions, and the embodiment of the present invention does not make specific limitations on this. For example, the preset optimal matching algorithm can be the Hungarian algorithm.

[0089] Sub-step S10314: when it is determined that there is a candidate physical device group that matches the interface constraint conditions of each network element, determine the matching score between each network element and each candidate physical device under each interface constraint condition as a first matching score.

[0090] For example, the logical topology includes network element A, network element B, and network element C, and there are 5 candidate physical devices, which are candidate physical device A, candidate physical device B, candidate physical device C, candidate physical device D, and candidate physical device E. If there is a candidate physical device group among the 5 candidate physical devices that matches the interface constraints of network element A, network element B, and network element C, then it is determined that the matching scores of network element A and candidate physical device A, candidate physical device B, candidate physical device C, candidate physical device D, and candidate physical device E under the interface constraints of network element A are all the first matching scores. Similarly, it is determined that the matching scores of network element B and candidate physical device A, candidate physical device B, candidate physical device C, candidate physical device D, and candidate physical device E under the interface constraints of network element A are all the first matching scores. Similarly, it is determined that the matching scores of network element C and candidate physical device A, candidate physical device B, candidate physical device C, candidate physical device D, and candidate physical device E under the interface constraints of network element A are all the first matching scores.

[0091] Sub-step S10315: when it is determined that there is no candidate physical device group that matches all the interface constraints of each network element, determine the matching score between each network element and each candidate physical device under each interface constraint as a second matching score.

[0092] For example, the logical topology includes network element A, network element B, and network element C, and there are 5 candidate physical devices, which are candidate physical device A, candidate physical device B, candidate physical device C, candidate physical device D, and candidate physical device E. If there is no candidate physical device group that matches the interface constraints of network element A, network element B, and network element C among the 5 candidate physical devices, it is determined that the matching scores of network element A and candidate physical device A, candidate physical device B, candidate physical device C, candidate physical device D, and candidate physical device E under the interface constraints of network element A are all the second matching scores. Similarly, it is determined that the matching scores of network element B and candidate physical device A, candidate physical device B, candidate physical device C, candidate physical device D, and candidate physical device E under the interface constraints of network element A are all the second matching scores. Similarly, it is determined that the matching scores of network element C and candidate physical device A, candidate physical device B, candidate physical device C, candidate physical device D, and candidate physical device E under the interface constraints of network element A are all the second matching scores.

[0093] Sub-step S1032: summing the matching scores between the network element and each candidate physical device under each constraint condition to obtain the matching scores between the network element and each candidate physical device under the attribute constraint condition.

[0094] For example, the attribute constraints of network element A include device type constraints and board type constraints. The matching score between network element A and candidate physical device A under the device type constraint is 0, and the matching score between network element A and candidate physical device A under the board type constraint is 10,000. The matching score between network element A and candidate physical device A under the device type constraint and the matching score between network element A and candidate physical device A under the board type constraint are summed up to 0+10,000=10,000. Therefore, the matching score between network element A and candidate physical device A under the attribute constraints of network element A is 10,000.

[0095] For another example, the attribute constraints of network element B include device type constraints, board type constraints, and interface information constraints. The matching score between network element B and candidate physical device A under the device type constraint is 0 (the device type of candidate physical device A satisfies the device type constraint of network element B), the matching score between network element B and candidate physical device A under the board type constraint is 10,000 (the board type of candidate physical device A does not satisfy the board type constraint of network element B), and the matching score between network element B and candidate physical device A under the interface information constraint is 10,000. Therefore, the matching score between network element B and candidate physical device A under the attribute constraints of network element B is 0+10,000+10,000=20,000.

[0096] Step S104: Determine N target physical devices that match the logical topology from the M candidate physical devices according to the matching scores between each network element and each candidate physical device under the attribute constraint condition.

[0097] In this embodiment, for each network element, the candidate physical devices that meet the attribute constraints of the network element can be obtained based on the matching scores between the network element and each candidate physical device under the attribute constraints, and the candidate physical devices that meet the attribute constraints of the network element are recorded as matching physical devices, thereby obtaining the matching physical devices of each network element; based on the matching physical devices of each network element, N target physical devices that match the logical topology can be determined from the M candidate physical devices.

[0098] For example, the logical topology includes network element A, network element B and network element C, and there are 6 candidate physical devices in total. The 6 candidate physical devices are candidate physical device A, candidate physical device B, candidate physical device C, candidate physical device D, candidate physical device E and candidate physical device F. The matching scores of network element A and candidate physical device A, candidate physical device B, candidate physical device C, candidate physical device D, candidate physical device E and candidate physical device F under the attribute constraint of network element A are 0, 10000, 10000, 0, 10000 and 0 respectively. Then the matching physical devices corresponding to network element A include candidate physical device A, candidate physical device D and candidate physical device F. In a similar manner, it can be obtained that the matching physical devices corresponding to network element B include candidate physical device A, and the matching physical devices corresponding to network element C include candidate physical device F. Therefore, candidate physical device A, candidate physical device D and candidate physical device F can be selected from the 6 candidate physical devices as target physical devices.

[0099] In some embodiments, according to the matching scores between each network element and each candidate physical device under the attribute constraint, the method for determining N target physical devices that match the logical topology from M candidate physical devices may be: constructing a comprehensive matching score matrix according to the matching scores between each network element and each candidate physical device under the attribute constraint; based on a preset optimal matching algorithm, determining N target physical devices that match the logical topology from the M candidate physical devices according to the comprehensive matching score matrix. Among them, the preset optimal matching algorithm can be set based on actual conditions, and the embodiment of the present invention does not make specific limitations on this. For example, the preset optimal matching algorithm may be the Hungarian algorithm. This embodiment can quickly and accurately determine the N target physical devices that match the logical topology according to the comprehensive matching score matrix through the optimal matching algorithm, which greatly improves the matching efficiency and accuracy between the logical topology and the physical topology.

[0100] In some embodiments, any column vector of the comprehensive matching score matrix is ​​a matching score between any network element and each candidate physical device, and any row vector of the comprehensive matching score matrix is ​​a matching score between any candidate physical device and each network element. For example, based on the matching scores of each network element in N network elements and each candidate physical device in M ​​candidate physical devices under attribute constraints, a comprehensive matching score matrix with N columns and M rows can be constructed.

[0101] For example, N=3, M=5, the matching scores of network element A and candidate physical device A, candidate physical device B, candidate physical device C, candidate physical device D and candidate physical device E under the attribute constraint of network element A are 0, 0, 0, 0 and 10000 points respectively. The matching scores of network element B and candidate physical device A, candidate physical device B, candidate physical device C, candidate physical device D and candidate physical device E under the attribute constraint of network element B are 0, 10000, 0, 10000 and 0 points respectively. The matching scores of network element C and candidate physical device A, candidate physical device B, candidate physical device C, candidate physical device D and candidate physical device E under the attribute constraint of network element C are 0, 0, 10000, 0 and 10000 points respectively. Therefore, according to the above matching scores, the following interface matching score matrix with 3 columns and 5 rows can be constructed:

[0102]

[0103] In some embodiments, Figure 5 As shown, before step S102, steps S105 to S106 are also included.

[0104] Step S105: Obtain device screening conditions.

[0105] In this embodiment, the device screening condition includes at least one of a resource pool identifier and a user identifier. The resource pool identifier is used to uniquely identify the sub-resource pool where the physical device is located, and the user identifier is used to uniquely identify the user who holds the physical device. The user identifier can be a user name. The resource pool identifier included in the device screening condition can be one or more, and the user identifier included in the device screening condition can be one or more. Among them, the device screening condition can be set through global parameters, and of course it can also be set through other methods, and the embodiment of the present invention does not specifically limit this.

[0106] Step S106: Select each physical device that meets the device screening condition and is in an idle state from the preset resource pool as a candidate physical device, and obtain M candidate physical devices.

[0107] In this embodiment, the preset resource pool includes P physical devices, P is greater than or equal to M, the preset resource pool includes multiple sub-resource pools, each sub-resource pool may include one or more physical devices, and the physical device has a binding relationship with the resource pool identifier and the user identifier. For example, the resource pool identifier in the device screening condition includes resource pools_type_A and resource pools_type_B, the user identifier is user_type_A, the preset resource pool includes 10 physical devices, the resource pool identifiers of physical devices D1 and D2 in the 10 physical devices are resource pools_type_A, and the user identifiers of physical devices D1 and D2 are user_type_A, the resource pool identifiers of physical devices D3 and D4 are resource pools_type_B, and the user identifiers of physical devices D3 and D4 are user_type_A, and physical devices D1, D2, D3, and D4 are in an idle state, therefore, physical devices D1, D2, D3, and D4 are taken as candidate physical devices, and 4 candidate physical devices are obtained. This embodiment pre-screens M candidate physical devices through device screening conditions, so that in subsequent topology matching, only data related to the M candidate physical devices need to be calculated, which can reduce the amount of calculation and further improve the matching efficiency of topology matching.

[0108] In some embodiments, after determining N target physical devices that match the logical topology, the attribute description file of the logical topology is updated according to the attribute information of each target physical device in the N target physical devices and the target physical device corresponding to each network element to obtain the attribute description file of the physical topology; if the communication connection between the computer device and each target physical device is normal, the corresponding flow table is configured in the preset switch according to the attribute description file of the physical topology to build the physical topology; and a preset test case script is sent to each target physical device in the physical topology so that each target physical device executes the test case script. Among them, the preset switch and the preset test case script can be set based on actual conditions, and the embodiment of the present invention does not specifically limit this. This embodiment constructs a physical topology that matches the logical topology after determining N target physical devices that match the logical topology, and uses the physical topology to execute the test case script, which can greatly improve the efficiency and accuracy of automated testing.

[0109] For example, the logical topology includes network element A, network element B and network element C, and the target physical devices matching network element A, network element B and network element C include target physical device P1, target physical device P2 and target physical device P3, and network element A corresponds to target physical device P1, network element B corresponds to target physical device P2, and network element C corresponds to target physical device P3. Therefore, the attribute constraint conditions corresponding to network element A in the attribute description file of the logical topology can be replaced with the attribute information of the target physical device P1, the attribute constraint conditions corresponding to network element B in the attribute description file of the logical topology can be replaced with the attribute information of the target physical device P2, and the attribute constraint conditions corresponding to network element C in the attribute description file of the logical topology can be replaced with the attribute information of the target physical device P3, thereby obtaining the attribute description file of the physical topology including the target physical devices P1, the target physical devices P2 and the target physical devices P3.

[0110] An embodiment of the present invention further provides a storage medium for computer-readable storage, wherein the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement any topology matching method provided in the description of the embodiment of the present invention.

[0111] The storage medium may be an internal storage unit of the computer device described in the above embodiment, such as a hard disk or memory of the computer device. The storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device.

[0112] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In a hardware embodiment, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0113] It should be understood that the term "and / or" used in the present specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, including these combinations. It should be noted that, in this article, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "including a..." does not exclude the presence of other identical elements in the process, method, article or system including the element.

[0114] The serial numbers of the embodiments of the present invention are only for description and do not represent the advantages and disadvantages of the embodiments. The above description is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A topology matching method, characterized in that: include: Acquire a property description file of a logical topology, where the logical topology includes N network elements, and the property description file includes a property constraint condition of each of the network elements, where N is an integer greater than or equal to 1; Obtaining attribute information of each of the M candidate physical devices, where M is an integer greater than N; Determine, according to the attribute information of each of the candidate physical devices, a matching score between each of the network elements and each of the candidate physical devices under the attribute constraint condition; According to the matching scores between each network element and each candidate physical device under the attribute constraint condition, N target physical devices matching the logical topology are determined from the M candidate physical devices.

2. The topology matching method according to claim 1, characterized in that: Before acquiring the attribute information of each of the M candidate physical devices, the method further includes: Acquire a device screening condition, where the device screening condition includes at least one of a resource pool identifier and a user identifier; Each physical device that meets the device screening condition and is in an idle state is selected from the preset resource pool as a candidate physical device, and M candidate physical devices are obtained.

3. The topology matching method according to claim 1, characterized in that: The attribute constraints include constraints on at least one of the device name, device type, device label, board type, board label, and interface information; the attribute information includes at least one of the device name, device type, device label, board type, board label, and interface information of the candidate physical device, and the interface information includes at least one of the number of interfaces, interface type, and interface rate.

4. The topology matching method according to claim 3, characterized in that: The constraints of the interface information include constraints on at least one of the number of interfaces, interface type and interface rate. The constraints of the interface information also include cross-board labels, which are used to constrain the interfaces of the network element to be located on different boards of the candidate physical device.

5. The topology matching method according to any one of claims 1 to 4, characterized in that: The attribute constraint condition includes a plurality of constraint conditions, and determining, according to the attribute information of each candidate physical device, a matching score between each network element and each candidate physical device under the attribute constraint condition includes: For each of the network elements, determining a matching score between the network element and each of the candidate physical devices under each of the constraint conditions according to the attribute information of each of the candidate physical devices; The matching scores between the network element and each candidate physical device under each constraint condition are summed to obtain the matching scores between the network element and each candidate physical device under the attribute constraint condition.

6. The topology matching method according to claim 5, characterized in that: The determining, according to the attribute information of each of the candidate physical devices, a matching score between the network element and each of the candidate physical devices under each of the constraint conditions includes: For each of the constraints, determining that the matching score between the candidate physical device corresponding to the constraint satisfied by the attribute information and the network element is a preset first matching score; It is determined that the matching score between the candidate physical device corresponding to the attribute information not satisfying the constraint condition and the network element is a preset second matching score, and the first matching score is less than the second matching score.

7. The topology matching method according to claim 5, characterized in that: The method further comprises: In the case where the constraint condition is an interface constraint condition, determining an interface matching score between each of the network elements and each of the candidate physical devices according to the interface information of each of the candidate physical devices and the interface constraint condition of each network element; Constructing an interface matching score matrix according to the interface matching score between each network element and each candidate physical device; Determining, according to the interface matching score matrix, whether there is a candidate physical device group that matches the interface constraint conditions of each of the network elements; When it is determined that there is a candidate physical device group that matches the interface constraint condition of each of the network elements, determining a matching score between each of the network elements and each of the candidate physical devices under each of the interface constraint conditions as a first matching score; When it is determined that there is no candidate physical device group that matches all the interface constraints of each network element, a matching score between each network element and each candidate physical device under each interface constraint is determined as a second matching score.

8. The topology matching method according to any one of claims 1 to 4, characterized in that: The determining, according to the matching scores between each network element and each candidate physical device under the attribute constraint condition, N target physical devices matching the logical topology from the M candidate physical devices comprises: Constructing a comprehensive matching score matrix according to the matching scores of each network element and each candidate physical device under the attribute constraint condition; Based on a preset optimal matching algorithm and according to the comprehensive matching score matrix, N target physical devices matching the logical topology are determined from the M candidate physical devices.

9. A computer device, characterized in that: The computer device includes a processor, a memory, a computer program stored in the memory and executable by the processor, and a data bus for realizing connection and communication between the processor and the memory, wherein when the computer program is executed by the processor, the topology matching method according to any one of claims 1 to 8 is realized.

10. A storage medium for computer-readable storage, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the topology matching method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Physical equipment matching distribution method and device based on network topology data

    CN107104829A

  • Edge device scheduling method, system and device and computer storage medium

    CN109918205A

  • Method and system for binding logic port and physical port based on information matching degree

    CN112702284A

  • Route visualization method, system, medium and equipment

    CN116192653A

  • System and Method for Allocating Resources and Managing a Cloud Based Computer System

    US20150263983A1

Cited By

  • Automatic test method and device of switch, terminal equipment and storage medium

    CN122120156A