Interface test method, electronic equipment and storage medium

By verifying the interface test results of automated data structures and encoding verification methods in the optical transmission network, the problems of low efficiency and insufficient accuracy of existing interface tests are solved, and efficient and accurate interface testing is achieved.

CN120416697APending Publication Date: 2025-08-01ZTE CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410142679.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-31
Publication Date
2025-08-01

AI Technical Summary

Technical Problem

In optical transmission networks, existing interface testing methods are inefficient and insufficiently accurate, and are prone to missed verification points. The manual verification method increases the test complexity and cost.

Method used

By sending test instructions to network element devices in the optical transmission network, the test result data is automatically verified using data structure, data format and encoding verification methods to determine whether the interface complies with preset specifications and reduce manual intervention.

Benefits of technology

It improves the efficiency and accuracy of interface testing, simplifies the testing process, reduces labor costs, and ensures the integrity and reliability of interface testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120416697A_ABST
    Figure CN120416697A_ABST
Patent Text Reader

Abstract

The invention provides an interface testing method, electronic equipment and a storage medium, and relates to the technical field of data processing. The method comprises the steps that a test instruction is sent to network element equipment in an optical transport network OTN, the test instruction is used for testing a target interface, and the target interface is a logic interface connecting the network element equipment and other network equipment; in response to test result data fed back by the network element equipment, determining a target verification mode from the alternative verification modes according to service attribute information corresponding to the test result data; and verifying the test result data through the target verification mode to obtain a verification result, the verification result being used for representing whether the target interface accords with a preset interface specification. According to the embodiment provided by the invention, the interface test efficiency can be improved, and the test accuracy is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of data processing, and particularly to an interface testing method, an electronic device, and a storage medium. Background Art

[0002] In an Optical Transport Network (OTN), various network element devices are connected based on different functional requirements and different interfaces.

[0003] In the process of performing functional tests on each interface using traditional interface testing methods, it is necessary to use manual verification to check (or verify) multiple fields therein to determine whether the interface under test meets the preset interface specifications; the above-mentioned manual verification method has the risk of missing verification points, which not only reduces the efficiency of interface testing but also cannot guarantee the accuracy of interface testing. Summary of the Invention

[0004] This application provides an interface testing method, an electronic device, and a storage medium.

[0005] An embodiment of this application provides an interface testing method, which includes: sending a test instruction to a network element device in an Optical Transport Network (OTN), where the test instruction is used to test a target interface, and the target interface is a logical interface connecting the network element device and other network devices; in response to the test result data fed back by the network element device, determining a target verification method from alternative verification methods according to the service attribute information corresponding to the test result data; and verifying the test result data through the target verification method to obtain a verification result, where the verification result is used to indicate whether the target interface meets the preset interface specifications.

[0006] An embodiment of this application provides an electronic device, including: one or more processors; a memory storing one or more programs thereon, and when the one or more programs are executed by the one or more processors, the one or more processors implement any of the interface testing methods in the embodiments of this application.

[0007] An embodiment of this application provides a readable storage medium storing a computer program, and when the computer program is executed by a processor, it implements any of the interface testing methods in the embodiments of this application.

[0008] According to the interface testing method, electronic device, and storage medium of the embodiments of the present application, by sending a test instruction to a network element device in an optical transport network (OTN), so as to test a target interface based on the test instruction, where the target interface is a logical interface connecting the network element device and other network devices; in response to the test result data fed back by the network element device, determine a target verification method from alternative verification methods according to the service attribute information corresponding to the test result data, so as to use the target verification method to verify the test result data, thereby determining whether the target interface meets the preset interface specification, without the need for manual verification of the test result data, which not only improves the interface testing efficiency but also ensures the accuracy of the test.

[0009] More descriptions are provided in the accompanying drawings, specific embodiments, and claims regarding the above embodiments and other aspects of the present application and their implementation manners. Description of the Drawings

[0010] Figure 1 The flowchart showing the interface testing method provided by the embodiments of the present application.

[0011] Figure 2 The schematic diagram showing the key information in the interface testing process provided by the embodiments of the present application.

[0012] Figure 3 The block diagram showing the composition of the interface testing system provided by the embodiments of the present application.

[0013] Figure 4 The flowchart showing the interface testing system provided by the embodiments of the present application for performing interface testing on a network element device.

[0014] Figure 5 The block diagram showing the composition of the interface testing device provided by the embodiments of the present application.

[0015] Figure 6 The block diagram showing the composition of the electronic device provided by the embodiments of the present application. Detailed Embodiments

[0016] To enable those skilled in the art to better understand the technical solutions of the present application, the following describes exemplary embodiments of the present application in conjunction with the accompanying drawings. Various details of the embodiments of the present application are included to assist in understanding, and they should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for clarity and conciseness, the description below omits the description of well-known functions and structures.

[0017] Without conflict, the embodiments of the present application and the features in each embodiment can be combined with each other.

[0018] As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items. The terms used herein are only for describing specific embodiments and are not intended to limit the scope of the present application. As used herein, the singular forms "a" and "the" are also intended to include the plural forms unless the context clearly indicates otherwise. It will also be understood that when the terms "comprises" and / or "consists of" are used in this specification, the specified features, wholes, steps, operations, elements, and / or components are present, but do not preclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or groups thereof. "Connected" or "coupled" and similar terms are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect.

[0019] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and the present application, and will not be interpreted as having an idealized or overly formal meaning unless expressly so defined herein.

[0020] In the OTN, different network element devices are connected based on different functional requirements using different interfaces. To test whether each interface complies with the preset interface specifications, the RF (Robot Framework) framework is usually used for interface testing. Among them, RF is a framework for automated testing of interface functions, which has good scalability, can test multiple types of clients or interfaces simultaneously, and can also perform distributed testing on the interfaces between multiple network element devices.

[0021] However, the above-mentioned traditional RF framework can only test the basic configuration / query functions of each interface, and manual verification of the test results is still required; for example, for the test results of each round of interface testing, a large amount of manpower is required to check the test results to determine whether each interface complies with its corresponding interface specifications; and using the manual method for verification requires checking a large number of fields, which may lead to the phenomenon of missing verification fields and reduce the test accuracy.

[0022] Moreover, testers also need to use the tools in the RF framework to write test scripts. Among them, each function in the test script needs to call the pre-encapsulated keyword information to execute the corresponding test steps. However, the call method based on keyword information is equivalent to adding an extra layer of pseudo-code; for example, when executing simple business logic or using global variables, they need to be encapsulated as keyword information, increasing the complexity of the test script.

[0023] How to efficiently and accurately test the interfaces between various devices in a communication system has become an urgent problem to be solved. This application provides an interface test method, an electronic device, and a storage medium to solve the above problems.

[0024] Figure 1 The flowchart of the interface test method provided by the embodiments of this application is shown. This interface test method can be applied to an interface test device. As Figure 1 shown, the interface test method in the embodiments of this application includes but is not limited to the following steps.

[0025] Step S101, send a test instruction to the network element device in the optical transport network (OTN).

[0026] Among them, the test instruction is used to test the target interface, and the target interface is a logical interface connecting the network element device and other network devices.

[0027] For example, the target interface includes: the interface between the network element device and the upper-layer device (such as a network management device or a server, etc.), and / or, the interface between the network element device and the lower-layer device (such as other network devices under the jurisdiction of the network element device, etc.).

[0028] It should be noted that during the transmission of the test instruction among various network element devices in the OTN, it can be determined whether the interfaces between the network element devices are working properly, so as to realize the test of the target interface connected to the network element device.

[0029] Step S102, in response to the test result data fed back by the network element device, determine the target verification method from the alternative verification methods according to the service attribute information corresponding to the test result data.

[0030] Among them, the alternative verification methods include at least one of the following: data structure verification method, data value verification method, data format verification method, and encoding verification method.

[0031] A data structure is a way for a computer to store and organize data. A data structure refers to a collection of data elements that have one or more specific relationships with each other. Usually, a carefully selected data structure can bring higher running or storage efficiency. Correspondingly, the data structure verification method is a verification method for the data structure of the test result data, used to determine whether the data structure of the test result data is the same as the preset data structure specified in the preset interface specification.

[0032] A data format describes the rules for storing data in a file or log record. It can be a text format in character form or a compressed format in binary data form. Correspondingly, the data format verification method is a verification method for the data format of test result data, used to determine whether the data format of the test result data is the same as the preset data format specified in the preset interface specification.

[0033] The encoding verification method is a verification method for the logical relationships in the test result data and the data values corresponding to different logical relationships.

[0034] By selecting, from multiple alternative verification methods, a target verification method that matches the service attribute information corresponding to the test result data, the target verification method can be more suitable for verifying the test result data, improving the verification efficiency.

[0035] Step S103: Verify the test result data through the target verification method to obtain a verification result.

[0036] Among them, the verification result is used to represent whether the target interface conforms to the preset interface specification. The preset interface specification is a rule that describes how the target interface should be used and implemented. For example, the preset interface specification includes the preset data format, preset data structure, and service type of the data that the preset interface can transmit, etc.

[0037] The target interface is used to transmit the interaction data between two adjacent devices to achieve the cooperation and interaction between the two adjacent devices. During the verification process, the test result data can be compared with the relevant information in the preset interface specification to determine the verification result. By using the target verification method to verify the test result data, without the need to manually verify the test result data again, it can reduce the labor cost and improve the accuracy of interface testing.

[0038] It should be noted that the process executed by the above steps S101 to S103 can be characterized as a test case, that is, this test case is used to describe the task of testing the interfaces between various devices in a communication network. A test case can include at least one of the following: test plan, test method, test technology, and test strategy.

[0039] In some embodiments, the test case can also be characterized in the form of a test document, and this test document includes at least one of the following: test objective, test environment, input data, test steps, expected result, test script.

[0040] In this embodiment, a test instruction is sent to a network element device in an optical transport network (OTN) to test a target interface based on the test instruction, where the target interface is a logical interface connecting the network element device and other network devices; in response to the test result data fed back by the network element device, a target verification method is determined from alternative verification methods according to the service attribute information corresponding to the test result data, so as to use the target verification method to verify the test result data, thereby determining whether the target interface meets the preset interface specification, without the need for manual verification of the test result data, which not only improves the interface test efficiency but also ensures the accuracy of the test.

[0041] In some exemplary embodiments, the target interface includes: a northbound interface (Northbound Interface), and / or, an interface between the network element device and other network devices.

[0042] Among them, the northbound interface is an interface between the network element device and a management device (such as a network management device or a server, etc.). For example, the northbound interface is a microservice provided by the management system, and this microservice can process the interaction data between the network element device and other network devices (such as data parsing, etc.).

[0043] In some embodiments, the northbound interface includes at least one of the following: a Simple Network Management Protocol (SNMP) interface, a System log (Syslog) interface, and a CORBA interface.

[0044] The above three northbound interfaces perform different functions in network access and management. Among them, the Syslog interface is used to encapsulate the alarms generated in the SNMP agent process into the format defined by the Syslog interface and feed back the encapsulated alarm information to the data processing layer. The CORBA interface and the SNMP interface support more functions. For example, they support querying, controlling, and configuring the status of network fault data, network topology information, and communication resource data, etc.

[0045] In some exemplary embodiments, determining a target verification method from alternative verification methods according to the service attribute information corresponding to the test result data includes: determining the test type corresponding to the test instruction according to the service attribute information corresponding to the test result data; and determining the target verification method from the alternative verification methods according to the test type.

[0046] Among them, the service attribute information is used to characterize the service characteristics corresponding to the test result data, such as the processing capacity of the network element device and the characteristics corresponding to the network level where the network element device is located, etc.

[0047] For example, if the test result data corresponds to attribute information related to data query, it can be determined that the test type corresponding to the test instruction is the query type, such as query of alarm information, query of configuration parameters, etc.

[0048] For another example, if the test result data corresponds to attribute information in the business processing process, it can be determined that the test type corresponding to the test instruction is the business processing type, such as addition of business parameters, modification of business parameters, etc.

[0049] Furthermore, according to the test type corresponding to the test instruction, the target verification method that matches the test result data can be quickly determined from alternative verification methods (such as data structure verification method, data value verification method, data format verification method, coding verification method, etc.), thereby improving the verification efficiency of the test result data.

[0050] In some exemplary embodiments, the test type is the first test type, and the first test type is a type for verifying the data format of the test result data.

[0051] Determining the target verification method from the alternative verification methods according to the test type includes: selecting the data format verification method as the target verification method from the alternative verification methods according to the first test type.

[0052] Among them, the data format verification method is used to verify whether the message structure of the test result data meets the requirements of the preset data format specification. For example, the preset data format specification may include: the format specification of preset alarm data, the format specification of preset configuration parameters, the format specification of preset business parameters, the data format specification of preset communication assets, etc.

[0053] In some embodiments, the first test type includes at least one of the following: acquisition of alarm information, query of configuration parameters, query of business parameters, and query of communication assets.

[0054] For example, when the first test type is the query of business parameters, the test result data is the queried business parameters (such as the channel parameters when the queried network element device uploads data, the identification of the target device to be uploaded, etc. data). The data format verification method (such as schema verification) can be used to verify the data format of the test result data first to determine whether the queried business parameters meet the requirements of the preset data format specification of the business parameters, so as to obtain the business parameters in the correct format.

[0055] In some exemplary embodiments, validating the test result data through a target validation method to obtain a validation result in step S103 includes: validating the test result data using a data format validation method to obtain a target validation result; when the target validation result is validation success, determining that the validation result is validation success; when the target validation result is validation failure, determining that the validation result is validation failure.

[0056] Among them, the data format validation method can be a schema validation method.

[0057] By using the schema validation method to validate the test result data, it can be determined whether the test result data meets the requirements of the preset data format specification. Thus, when it is determined that the test result data meets the requirements of the preset data format specification, it is determined that the validation of the test result data is successful, that is, the target validation result is validation success; when it is determined that the test result data does not meet the requirements of the preset data format specification, it is determined that the validation of the test result data fails, that is, the target validation result is validation failure.

[0058] In some embodiments, validating the test result data using a data format validation method includes: performing format conversion on the data format of the test result data to obtain a target validation format; using the data format validation method to validate the test result data with the data format being the target validation format.

[0059] Among them, the target validation format is the data validation format corresponding to the data format validation method.

[0060] For example, converting the data format of the test result data from the preset data format to the target validation format. Among them, the preset data format can include: Extensible Markup Language (XML) format and / or text format.

[0061] XML is a simple data storage language that uses a series of simple tags to describe data, and these tags can be established in a convenient way. Although the space occupied by the data stored in XML format is much more than that of the data stored in binary format, XML is extremely simple and easy to master and use.

[0062] The target validation format includes: JavaScript Object Notation (JSON) format. JSON format is a lightweight data exchange format. It is easy for people to read and write, can exchange data between multiple languages, and at the same time, it is also easy for machines to parse and generate.

[0063] For example, when the interface test data is query data for communication assets, only the data format (or data structure) of the interface test data needs to be verified at this time. By using schema verification to verify the test result data in XML format (and / or text format), it is possible to effectively detect whether the test result data conforms to the preset interface specification; there is no need to use manual verification to check the data format of the test result data, which greatly improves the analysis speed of the test result data and enhances the efficiency of interface testing.

[0064] In some embodiments, a preset format conversion tool is used to convert the data format of the test result data to obtain test result data with a target data format of JSON format; then, a data format verification method is used to verify the test result data with a JSON data format, which can speed up the verification speed of the test result data, and then determine whether the test result data conforms to the preset interface specification, improving the verification efficiency of the test result data.

[0065] In some exemplary embodiments, the test type is a second test type, and the second test type is a type that characterizes the verification of the data format of the test result data and the service type corresponding to the test result data.

[0066] According to the test type, a target verification method is determined from alternative verification methods, including: selecting a data format verification method and a coding verification method as the target verification methods from the alternative verification methods according to the second test type.

[0067] Among them, the second test type includes at least one of the following: service performance statistics, deletion of service parameters, addition of service parameters, and modification of service parameters.

[0068] For example, when the second test type is the addition of service parameters, the test result data is the service parameters to be added (such as the type parameters of the newly added service data) queried. First, a data format verification method (such as schema verification) can be used to verify the data format of the test result data; in the case of determining that the data format verification is successful, a coding verification method is used to verify the test result data to determine whether the test result data is the same as the type parameters of the service data pre-configured for the network element device, so as to obtain the verification result.

[0069] By selecting a data format verification method and a coding verification method as the target verification methods, it is possible to adapt to interface testing in complex service scenarios, quickly and accurately verify the test result data, and improve the verification efficiency.

[0070] In some exemplary embodiments, the test result data is verified through a target verification method to obtain a verification result, including: verifying the test result data using a data format verification method to obtain a first verification result, where the data format verification method is used to verify whether the message structure of the test result data meets the requirements of a preset data format specification; and verifying the test result data again using a coding verification method to obtain a second verification result.

[0071] In the case where both the first verification result and the second verification result are verification successes, the verification result is determined to be a verification success.

[0072] In the case where at least one of the first verification result and the second verification result is a verification failure, the verification result is determined to be a verification failure.

[0073] Among them, the first verification result includes a verification success or a verification failure of the data format of the test result data; the second verification result is used to characterize whether the values of the test result data corresponding to different logical relationships match the values in the preset interface specification based on the logical relationships in the test result data, and the second verification result also includes a verification success or a verification failure.

[0074] Using the above two different verification methods to verify the test result data respectively can confirm the test result data from multiple perspectives, can measure the test result data more accurately. Compared with the traditional manual verification method, it can not only speed up the verification speed of the test result data, but also effectively ensure the verification accuracy of the test result data.

[0075] In some exemplary embodiments, verifying the test result data again using a coding verification method to obtain a second verification result includes: calling a preset application programming interface (Application Programming Interface, API) to compare the test result data with the target data stored in a preset database; in the case where it is determined that the test result data is the same as the target data, determining that the second verification result is a verification success.

[0076] Among them, the target data stored in the preset database is the target test result data determined based on the processing operations corresponding to the preset service type. The preset service type is the service type corresponding to the second test type. For example, the preset service type includes at least one of the following: service performance statistics, deleting service parameters, adding service parameters, and modifying service parameters.

[0077] The preset API can be a Representational State Transfer (REST)-style API. This REST-style API (which can be abbreviated as: REST interface) can be applied to a distributed communication system and can enable access to and operation on communication resources in the communication system.

[0078] For example, use verbs in the Hypertext Transfer Protocol (HTTP) (such as, GET, POST, PUT, and DELETE, etc.) to describe the status changes of communication resources; and use HTTP status codes to feedback the operation results.

[0079] Among them, the REST interface can locate communication resources through a Uniform Resource Identifier (URI). Moreover, the REST interface also has the characteristics of statelessness, resource location, unified interface, cacheability, and on-demand coding.

[0080] Statelessness means that in the REST interface, requests should be independent of each other, and each request should contain sufficient information to complete the request without relying on any external information.

[0081] Resource location means that in the REST interface, each resource is uniquely located by a URI. The URI of the resource is defined by the server (such as, network management devices in the communication network, etc.), and the client (such as, network element devices managed by the network management device, etc.) only needs to access the communication resources through the URI.

[0082] The unified interface means that the style of the REST interface is unified, and the client can perform operations such as obtaining, creating, modifying, and deleting communication resources through the URI and HTTP verbs.

[0083] Cacheability means that the communication resources obtained using the REST interface can be cached in a preset storage area to improve the access efficiency of communication resources and reduce the request pressure on the network management device.

[0084] On-demand coding means that the REST interface allows the network management device to transmit code to the network element device to implement certain specific functions. For example, the network management device allows the network element device to obtain a code snippet by accessing a certain URI and execute the code snippet.

[0085] By using the above REST interface, it is possible to compare the test result data with the target data stored in the preset database, flexibly perform data processing, and improve the data processing efficiency of the communication system.

[0086] In some exemplary embodiments, before sending a test instruction to a network element device in an optical transport network (OTN) in step S101, the method further includes: generating a test case based on a preset number of key information items.

[0087] Wherein, the test case includes at least a test instruction. The preset number of key information items includes at least one of the following: initialization keyword information, configuration keyword information, and clearing keyword information.

[0088] For example, Figure 2 A schematic diagram showing key information in the interface test provided by an embodiment of the present application. As Figure 2 shown, Figure 2 the left side in shows that during the interface test using a traditional test method (such as the test of "connecting the optical fibers between the OCH ports of the H4K single board"), 15 key information items (i.e., Figure 2 the "KEYWORD" in ) need to be displayed, where each "KEYWORD" corresponds to an operation step (such as step 110, step 120,..., step 144, etc.), nested layer by layer, which is very redundant; while during the interface test using the interface test method in the present application (such as "port access scenario - create / delete / modify / query - EPL - EOS service - UU port access scenario - VC4 bearer - VC protection - pre - calculation without carry SNC Type"), only two key information items ("KEYWORD"), namely, "C2.Teststeps" and "C2.Teardown", are needed, which can simplify the usage frequency of key information and realize a simple and intuitive display of the test result data corresponding to the test case.

[0089] In some exemplary embodiments, after using at least one target verification method to verify the test result data in step S103 and obtaining a verification result, the method further includes: updating the configuration parameters in a preset configuration file to obtain updated parameters; and updating the key information in the test instruction according to the updated parameters.

[0090] Wherein, the key information is information determined based on the parameters in the configuration file. During the interface test process, the separation of test data and test environment, and the separation of test scripts and test data can be realized. When multiple test cases with different test parameters are required, only by updating the configuration parameters in the preset configuration file (such as service configuration parameters, quantity parameters of communication resources, etc.), the key information in the test instruction can be updated based on the updated parameters, thereby greatly improving the modification speed of relevant parameters in the test case and quickly realizing the update of the test case.

[0091] In some exemplary embodiments, after performing the verification of the test result data by the target verification method in step S103 to obtain a verification result, the method further includes: sending a service clearing instruction to the network element device in the OTN.

[0092] Among them, the service clearing instruction is used to clear the service test data corresponding to the test instruction. For example, the service test data corresponding to the test instruction includes: configuration parameters used in the previous test case, query result data, simulated service data, etc.

[0093] By sending a service clearing instruction to the network element device in the OTN, the network element device can delete the service test data corresponding to the clearing test instruction, thereby restoring the basic test environment, preventing the relevant data of the previous test case from affecting the test result of the current test case, and improving the accuracy of the interface test.

[0094] In some exemplary embodiments, after performing the verification of the test result data by the target verification method in step S103 to obtain a verification result, the method further includes: generating a test report based on the verification result and the test result data; and displaying the test report.

[0095] Among them, the verification result is used to represent the success or failure of the verification of the test result data. By combining the test result data and the verification result to generate a test report, it is possible to automatically analyze the test result data without using the manual verification method to analyze the test result data again, enabling the tester to directly understand the test result of the target interface based on this test report, thereby determining whether the target interface meets the preset interface specification and improving the efficiency of the interface test.

[0096] Figure 3 The block diagram showing the composition of the interface test system provided by the embodiments of the present application is as follows Figure 3 As shown, the interface test system is a system built based on the OTN, and it includes but is not limited to the following devices: an interface test device 301, a network management device 302, and a network element device 303.

[0097] Among them, the network element device 303 is used to represent one or more network element devices under the jurisdiction of the gateway device 302.

[0098] The interface testing device 301 is used to simulate the operator's northbound interface system server, execute an automated script, and send a test instruction to the network management device 302, so that the network management device 302 can send the test instruction to the network element device 303 under its jurisdiction; and in the case of receiving the test result data fed back by the network element device 303 forwarded by the network management device 302, select a target verification method from the alternative verification methods according to the service attribute information corresponding to the test result data; use the target verification method to verify the test result data to obtain a verification result.

[0099] The interface testing device 301 is further used to generate a test report according to the verification result and the test result data; and display the test report.

[0100] The network management device 302 is used to forward the test instruction to the network element device 303 under its jurisdiction; in the case of determining that it has received the test response message (such as, including the test result data) fed back by the network element device 303, forward the test response information to the interface testing device 301.

[0101] The network element device 303 is used to, in the case of receiving the test instruction, feed back a test response message including the test result data to the network management device 302. Among them, the test result data is used to reflect the test result of the interface between the network management device 302 and the network element device 303, and / or, the test result of the interface between multiple network element devices.

[0102] By using the interaction between the above-mentioned multiple devices, it is possible to implement the test of the northbound interface in the OTN (such as, the interface between the network management device 302 and the interface testing device 301 that simulates the operator's northbound interface system server), and / or, the interface between the network element device 303 and other network devices, so as to determine whether each interface meets the preset interface specification, without the need to manually verify the test result data, which not only improves the interface test efficiency, but also can ensure the accuracy of the test.

[0103] Figure 4 The flowchart showing the process of the interface testing system provided by the embodiment of the present application for performing interface testing on a network element device is as follows. As Figure 4 shown, the method for the interface testing system to perform interface testing on a network element device includes but is not limited to the following steps.

[0104] Step S401, the interface testing device 301 simulates the operator's northbound interface system server and sends a test instruction to the network management device 302 according to the test case.

[0105] Among them, the test instructions include: configuring service parameters of the network element device 303 (such as the number of communication resources that the network element device 303 can occupy, parameters such as the types of communication resources), querying the parameters of the communication resources currently obtained by the network element device 303, and simulating service data (such as downloaded audio and video data, etc.) sent by the operator northbound interface system server to the network element device 303 through the network management device 302.

[0106] In some embodiments, both the test script and the verification script in the test case are implemented using Python coding, which can enhance the scalability and maintainability of automated testing.

[0107] Step S402, the network management device 302 interacts with the network element device 303 based on the test instructions, conducts tests of different service types, obtains the test result data fed back by the network element device 303, and sends the test result data to the interface test device 301.

[0108] Step S403, the interface test device 301 selects the data format verification method as the target verification method from the alternative verification methods according to the first test type corresponding to the test instructions.

[0109] Among them, the first test type includes at least one of the following: obtaining alarm information, querying configuration parameters, querying service parameters, and querying communication assets.

[0110] After executing step S403, step S409 is directly executed.

[0111] Step S404, the interface test device 301 selects the data format verification method and the encoding verification method as the target verification methods from the alternative verification methods according to the second test type corresponding to the test instructions.

[0112] Among them, the second test type includes at least one of the following: service performance statistics, deleting service parameters, adding service parameters, and modifying service parameters.

[0113] Step S405, the interface test device 301 verifies the test result data using the data format verification method to obtain the first verification result.

[0114] In some instances, when it is determined that the data format of the test result data is the preset data format, the data format of the test result data is format-converted to obtain the target verification format, and the target verification format is the data verification format corresponding to the data format verification method.

[0115] Among them, the preset data format includes at least one of the following: XML format, JSON format, and text format.

[0116] For example, if the data format of the test result data is in XML format, the data format of the test result data can be first converted from XML format to JSON format, and then the test result data can be verified by using a data format verification method (such as the schema verification method), so as to determine whether the data format of the test result data conforms to the data format specified in the preset interface specification, which can improve the speed of data verification.

[0117] For example, the xmltodict module in Python can be used to convert the data format of the test result data to obtain the test result data with the data format in JSON format.

[0118] Step S406, determine whether the first verification result is verification success.

[0119] When it is determined that the first verification result is verification success, step S407 is continued to be executed; when it is determined that the first verification result is verification failure, step S412 is executed.

[0120] Step S407, the interface test device 301 re-verifies the test result data by using an encoding verification method to obtain a second verification result.

[0121] Among them, the encoding verification method is a method for verifying the test result data based on a preset API and a preset database. For example, the preset API is called, and the test result data is compared with the target data stored in the preset database to obtain the second verification result.

[0122] Among them, the target data stored in the preset database is the target test result data determined based on the preset service processing logic. The preset API can be a REST-style API.

[0123] In some embodiments, the test cases include: 1) query of service parameters, service performance statistics, and query of communication assets; 2) issuance of simulated service data; 3) acquisition of alarm information, deletion of service parameters, addition of service parameters, and modification of service parameters.

[0124] Correspondingly, the second verification results include: 1) the verification result of the query interface obtained by verifying the query interfaces for querying service parameters, service performance statistics, and communication assets; 2) the verification result of the data processing interface obtained by verifying the data processing interfaces for processing service data; 3) the verification result of the modification interface obtained by verifying the modification interfaces for alarm information processing, addition (and / or deletion, modification) of service parameters.

[0125] ​Among them, for the verification results of the query interface, the data processing interface, and the modification interface, it is necessary to confirm them separately, so as to more comprehensively verify whether different types of interfaces between various network elements in the OTN conform to the preset interface specifications.

[0126] For example, for the test result data obtained from the query interface, it is necessary to first verify it using the schema verification method, and when it is determined that the verification is successful, then verify it using the encoding verification method to obtain the second verification result corresponding to the query interface.

[0127] When it is determined that the second verification result corresponding to the query interface is verification successful, continue to verify the test result data obtained from the data processing interface. Similarly, it is necessary to first verify it using the schema verification method, and when it is determined that the verification is successful, then verify it using the encoding verification method to obtain the second verification result corresponding to the data processing interface.

[0128] When it is determined that the second verification result corresponding to the data processing interface is verification successful, continue to verify the test result data obtained from the modification interface; similarly, it is necessary to first verify it using the schema verification method, and when it is determined that the verification is successful, then verify it using the encoding verification method to obtain the second verification result corresponding to the modification interface.

[0129] Step S408, determine whether the second verification result is verification successful.

[0130] When it is determined that the second verification result is verification successful, continue to execute step S411; when it is determined that the second verification result is verification failed, execute step S412.

[0131] Step S409, the interface test device 301 performs format conversion on the data format of the test result data to obtain the target verification format; uses the data format verification method to verify the test result data with the data format of the target verification format to obtain the verification result.

[0132] Step S410, determine whether the verification result is verification successful.

[0133] When it is determined that the verification result is verification successful, execute step S411; when it is determined that the verification result is verification failed, execute step S412.

[0134] Step S411, the interface test device 301 sends a service clearing instruction to the network management device 302, so that the network management device 302 forwards the service clearing instruction to the network element device 303.

[0135] Among them, the service clearing instruction is used to clear the service test data corresponding to the test instruction. For example, the service test data corresponding to the test instruction includes: configuration parameters used in the previous test case, query result data, simulated service data, etc.

[0136] By sending a service clearing instruction to the network management device 302, the network management device 302 can be made to delete the service test data corresponding to the clearing test instruction, thereby restoring the basic test environment, preventing the relevant data of the previous test case from affecting the test result of the current test case, and improving the accuracy of the interface test.

[0137] Step S412, the interface test device 301 generates a test report based on the verification result and the test result data; and displays the test report.

[0138] Among them, the test report can also be displayed through the network management device 302. For example, after the interface test device 301 generates a test report, it sends the test report to the network management device 302 so that the network management device 302 can display the test report on its display interface.

[0139] It should be noted that after the test report is generated, it indicates that the current test case has been completed. The interface test device 301 can return to execute step S401 and continue to execute the next test case until all test cases have been executed.

[0140] In this embodiment, by simulating the operator's northbound interface system server through the interface test device 301 and interacting with the network management device 302 and the network element device 303, it is possible to realize the automatic test and verification of the interfaces between various network element devices and the interfaces between the network management device and the network elements, greatly improving the efficiency of the interface test. Moreover, the interface test device 301 can also handle complex test tasks that are difficult to implement under the RF framework (such as loop tests, verifying test result data, and verifying data with complex data structures such as lists) based on the test cases implemented in python, effectively improving the accuracy during the interface test process. Further, the test cases implemented in python have portability and scalability, can be flexibly adapted to various different interfaces, and improve the flexibility of the interfaces.

[0141] Figure 5 The block diagram showing the composition of the interface test device provided by the embodiment of the present application is as follows Figure 5 As shown, the interface test device 500 includes but is not limited to the following modules.

[0142] The sending module 501 is configured to send a test instruction to a network element device in an optical transport network OTN.

[0143] Among them, the test instruction is used to test the target interface, and the target interface is a logical interface connecting the network element device and other network devices.

[0144] The selection module 502 is configured to, in response to the test result data fed back by the network element device, determine the target verification method from the alternative verification methods according to the service attribute information corresponding to the test result data.

[0145] The verification module 503 is configured to verify the test result data by the target verification method to obtain a verification result.

[0146] Among them, the verification result is used to represent whether the target interface conforms to the preset interface specification.

[0147] It should be noted that the interface test device 500 in this embodiment can implement any one of the interface test methods in the embodiments of the present application.

[0148] According to the interface test device of the embodiment of the present application, the sending module sends a test instruction to the network element device in the optical transport network OTN, so as to test the target interface based on the test instruction, where the target interface is a logical interface connecting the network element device and other network devices; the selection module is used to respond to the test result data fed back by the network element device, and determine the target verification method from the alternative verification methods according to the service attribute information corresponding to the test result data, so as to use the verification module to verify the test result data by the target verification method, thereby determining whether the target interface conforms to the preset interface specification, and there is no need to manually verify the test result data, which not only improves the interface test efficiency, but also can ensure the accuracy of the test.

[0149] It should be clear that the present invention is not limited to the specific configurations and processes described and illustrated in the above embodiments. For the convenience and brevity of description, the detailed description of known methods is omitted here, and the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the foregoing method embodiments, which will not be elaborated here.

[0150] Figure 6 The block diagram showing the composition of the electronic device provided by the embodiment of the present application is shown.

[0151] As Figure 6 shown, the electronic device includes: at least one processor 601, at least one memory 602, and one or more I / O interfaces 603. Among them, the processor 601, the memory 602 and the I / O interface 603 are interconnected through a bus 604. The memory 602 stores one or more computer programs, and the one or more computer programs are executed by at least one processor 601 so that at least one processor 601 can implement any one of the interface test methods described in the above embodiments.

[0152] Each module in the above electronic device can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above modules can be embedded in the processor of the computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each of the above modules.

[0153] The embodiments of the present application also provide a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements any one of the interface testing methods described in the above embodiments. The computer-readable storage medium can be a volatile or non-volatile computer-readable storage medium.

[0154] The embodiments of the present application also provide a computer program product, including computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in the processor of the electronic device, the processor in the electronic device executes the above interface testing method.

[0155] Those of ordinary skill in the art can understand that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, and appropriate combinations thereof. In the hardware implementation, the division of the functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, one physical component can have multiple functions, or one function or step can be executed by several physical components in cooperation. Some or all of the physical components can 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 can be distributed on a computer-readable storage medium, which can include a computer storage medium (or non-transitory medium) and a communication medium (or transitory medium).

[0156] As is well known to those of ordinary skill 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 program instructions, data structures, program modules, or other data. Computer storage media includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), static random access memory (SRAM), flash memory or other memory technologies, portable compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical disc storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and that can be accessed by a computer. Additionally, as is well known to those of ordinary skill in the art, communication media typically embodies computer-readable program instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and can include any information delivery media.

[0157] The computer-readable program instructions described herein can be downloaded to each computing / processing device from a computer-readable storage medium or can be downloaded to an external computer or external storage device through a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in each computing / processing device.

[0158] The computer program instructions for performing the operations of this application may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine - related instructions, microcode, firmware instructions, state - setting data, or source code or object code written in any combination of one or more programming languages, including object - oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer - readable program instructions may be executed entirely on the user's computer, partially on the user's computer, executed as a stand - alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or it may be connected to an external computer (e.g., through the Internet using an Internet service provider). In some embodiments, by using the state information of the computer - readable program instructions to customize an electronic circuit, such as a programmable logic circuit, a field - programmable gate array (FPGA), or a programmable logic array (PLA), the electronic circuit can execute the computer - readable program instructions to implement various aspects of this application.

[0159] The computer program product described herein may be implemented specifically in the form of hardware, software, or a combination thereof. In an alternative embodiment, the computer program product is specifically embodied as a computer storage medium. In another alternative embodiment, the computer program product is specifically embodied as a software product, such as a Software Development Kit (SDK), etc.

[0160] Aspects of this application are described herein with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowcharts and / or block diagrams, and the combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer - readable program instructions.

[0161] These computer-readable program instructions may be provided to a processor of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus to produce a machine such that the instructions, when executed by the processor of the computer or other programmable data processing apparatus, create means for implementing the functions / acts specified in one or more boxes of the flowchart and / or block diagram. These computer-readable program instructions may also be stored in a computer-readable storage medium that causes a computer, a programmable data processing apparatus, and / or other devices to operate in a particular manner, such that the computer-readable medium storing the instructions comprises a manufacture including instructions for implementing various aspects of the functions / acts specified in one or more boxes of the flowchart and / or block diagram.

[0162] The computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process such that the instructions executed on the computer, other programmable data processing apparatus, or other device implement the functions / acts specified in one or more boxes of the flowchart and / or block diagram.

[0163] The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present application. In this regard, each box in the flowchart or block diagram may represent a module, a segment of a program, or a portion of an instruction, which contains one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions noted in the boxes may occur out of the order noted in the figures. For example, two consecutive boxes may in fact be executed substantially in parallel, or they may sometimes be executed in the reverse order, depending on the functions involved in each box. It should also be noted that each box in the block diagrams and / or flowcharts, and combinations of boxes in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system for performing the specified functions or acts, or by a combination of dedicated hardware and computer instructions.

[0164] Example embodiments have been disclosed herein, and although specific terms are employed, they are used only and should be interpreted only as general illustrative meanings and not for the purpose of limitation. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly specified, features, characteristics, and / or elements described in connection with a particular embodiment may be used singly or in combination with features, characteristics, and / or elements described in connection with other embodiments. Accordingly, those skilled in the art will understand that various forms and details may be changed without departing from the scope of the present application as set forth by the appended claims.

Claims

1. An interface testing method, comprising: Sending a test instruction to a network element device in an optical transport network (OTN), wherein the test instruction is used to test a target interface, and the target interface is a logical interface connecting the network element device and other network devices; In response to the test result data fed back by the network element device, determining a target verification method from alternative verification methods according to the service attribute information corresponding to the test result data; Verifying the test result data through the target verification method to obtain a verification result, and the verification result is used to indicate whether the target interface conforms to a preset interface specification.

2. The method according to claim 1, wherein The determining a target verification method from alternative verification methods according to the service attribute information corresponding to the test result data includes: Determining a test type corresponding to the test instruction according to the service attribute information corresponding to the test result data; Determining the target verification method from the alternative verification methods according to the test type.

3. The method according to claim 2, wherein, The test type is a first test type, and the first test type is a type for verifying the data format of the test result data; The determining the target verification method from the alternative verification methods according to the test type includes: Selecting a data format verification method from the alternative verification methods as the target verification method according to the first test type, wherein the data format verification method is used to verify whether the message structure of the test result data meets the requirements of a preset data format specification.

4. The method according to claim 3, wherein The first test type includes at least one of the following: obtaining alarm information, querying configuration parameters, querying service parameters, and querying communication assets.

5. The method according to claim 3, wherein The verifying the test result data through the target verification method to obtain a verification result includes: Verifying the test result data using the data format verification method to obtain a target verification result; When the target verification result is verification success, determining that the verification result is verification success; When the target verification result is verification failure, determining that the verification result is verification failure.

6. The method according to claim 2, wherein The test type is a second test type, and the second test type is a type for verifying the data format of the test result data and the service type corresponding to the test result data; The determining the target verification method from the alternative verification methods according to the test type includes: Selecting a data format verification method and a coding verification method from the alternative verification methods as the target verification method according to the second test type.

7. The method according to claim 6, wherein, The second test type includes at least one of the following: service performance statistics, deleting service parameters, adding service parameters, and modifying service parameters.

8. The method according to claim 6, wherein The verifying the test result data through the target verification method to obtain a verification result includes: Verifying the test result data using the data format verification method to obtain a first verification result, and the data format verification method is used to verify whether the message structure of the test result data meets the requirements of a preset data format specification; Use the described encoding verification method to verify the test result data again to obtain a second verification result; When both the first verification result and the second verification result are verification successes, determine that the verification result is a verification success; When at least one of the first verification result and the second verification result is a verification failure, determine that the verification result is a verification failure.

9. The method according to claim 5 or 8, wherein The using the data format verification method to verify the test result data includes: Perform format conversion on the data format of the test result data to obtain a target verification format, where the target verification format is the data verification format corresponding to the data format verification method; Use the data format verification method to verify the test result data with the data format being the target verification format.

10. The method according to claim 8, wherein, The using the encoding verification method to verify the test result data again to obtain a second verification result includes: Call a preset application programming interface (API) to compare the test result data with the target data stored in a preset database; When it is determined that the test result data is the same as the target data, determine that the second verification result is a verification success; Wherein, the target data is the target test result data determined based on the processing operation corresponding to a preset service type, and the preset service type is the service type corresponding to the second test type.

11. The method according to any one of claims 1 to 8, wherein Before sending a test instruction to a network element device in an optical transport network (OTN), the method further includes: Generate a test case based on a preset number of key information, where the test case at least includes the test instruction; Wherein, the preset number of key information includes at least one of the following: initialization keyword information, configuration keyword information, and clearing keyword information.

12. An electronic device, wherein, Includes: One or more processors; A memory, on which one or more programs are stored. When the one or more programs are executed by the one or more processors, the one or more processors implement the interface test method according to any one of claims 1 to 11.

13. A readable storage medium, wherein, The readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the interface test method according to any one of claims 1 to 11.