Interface testing method and device, electronic equipment and computer readable storage medium
Through an interface testing method, interface test request information is obtained and processed, target interface and test scripts are selected, and interface testing is carried out, which solves the problem that the existing technology cannot effectively simulate and test internal interface errors in the financial system, and improves the efficiency of interface testing and system development.
Patent Information
- Application Number
- CN202411582422.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-07
- Publication Date
- 2025-02-25
AI Technical Summary
The existing simulation platform cannot effectively simulate the internal interface error, unresponsiveness and timeout scenarios of the financial system, making it difficult for testers to quickly test the internal interface of the system, affecting the efficiency of the system's expansion and development.
Provide an interface testing method, by obtaining interface test request information, extracting interface attribute information and interface test execution information, filtering the target test interface and selecting the target interface test script, performing interface test processing, and obtaining the interface test results.
The efficiency of interface testing has been improved, and the efficiency of system development has been improved, so that interface problems can be discovered and solved more quickly.
Smart Images

Figure CN119512952A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to but are not limited to the field of interface testing technology, and in particular, to an interface testing method, device, electronic device, and computer-readable storage medium. Background Art
[0002] At present, various financial systems are increasingly used to store and operate related financial data. In the process of developing financial systems, it is often necessary to test and process the relevant ports of the financial systems. At present, the existing simulation platforms in the industry do not support interface errors, no response, and timeout scenarios within the simulation system. Testers cannot test and process the internal interfaces of the system quickly and easily, which affects the expansion and development efficiency of the system. Summary of the invention
[0003] The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.
[0004] In order to solve the problems mentioned in the above background technology, the embodiments of the present application provide an interface testing method, device, electronic device and computer-readable storage medium, which can improve the efficiency of interface testing and thus greatly improve the efficiency of system development.
[0005] In a first aspect, an embodiment of the present application provides an interface testing method, the method comprising:
[0006] Get interface test request information;
[0007] Extracting information from the interface test request information to obtain interface attribute information and interface test execution information;
[0008] Filtering a target test interface from a preset system interface pool according to the interface attribute information;
[0009] Selecting a target interface test script from a preset interface test script set according to the interface test execution information;
[0010] Perform interface test processing on the target test interface according to the target interface test script to obtain an interface test result.
[0011] According to some embodiments of the present application, extracting information from the interface test request information to obtain interface attribute information and interface test execution information includes:
[0012] Perform information splitting processing on the interface test request information to obtain attribute marking information and interface execution marking information;
[0013] Matching the attribute tag information with a preset attribute tag set to obtain the interface attribute information;
[0014] The interface execution mark information is matched with a preset interface execution event set to obtain the interface test execution information.
[0015] According to some embodiments of the present application, the system interface pool includes a plurality of test interfaces, each of the test interfaces carries interface tag information, and the target test interface is obtained by screening from a preset system interface pool according to the interface attribute information, including:
[0016] Matching the interface attribute information with the interface tag information of each test interface in the system interface pool to obtain target interface tag information;
[0017] The test interface corresponding to the target interface mark information is determined as the target test interface.
[0018] According to some embodiments of the present application, the interface test script set includes multiple interface test scripts, each of which carries interface execution marking information, and the target interface test script is selected from the preset interface test script set according to the interface test execution information, including:
[0019] Matching the interface test execution information with the interface execution tag information of each interface test script in the interface test script set to obtain target interface execution tag information;
[0020] The interface test script corresponding to the target interface execution mark information is determined as the target interface test script.
[0021] According to some embodiments of the present application, performing interface test processing on the target test interface according to the target interface test script to obtain an interface test result includes:
[0022] Determine test execution event information and test execution sequence information according to the target interface test script;
[0023] According to the test execution event information and the test execution sequence information, interface test processing is performed on the target test interface to obtain the interface test result.
[0024] According to some embodiments of the present application, after performing interface test processing on the target test interface according to the target interface test script and obtaining the interface test result, the method further includes at least one of the following:
[0025] When the interface test result indicates that the target test interface test is normal, determining the target test interface as a data transceiver interface;
[0026] When the interface test result indicates that the target test interface test is abnormal, stopping sending data to the target test interface.
[0027] According to some embodiments of the present application, when the interface test result indicates that the target test interface test is normal, after determining the target test interface as a data transceiver interface, the method further includes:
[0028] Receive data to be forwarded;
[0029] The data to be forwarded is processed through the target test interface.
[0030] In a second aspect, an embodiment of the present application further provides an interface testing device, comprising:
[0031] The first processing module is used to obtain interface test request information;
[0032] A second processing module is used to extract information from the interface test request information to obtain interface attribute information and interface test execution information;
[0033] A third processing module, configured to filter and obtain a target test interface from a preset system interface pool according to the interface attribute information;
[0034] A fourth processing module, configured to select a target interface test script from a preset interface test script set according to the interface test execution information;
[0035] The fifth processing module is used to perform interface test processing on the target test interface according to the target interface test script to obtain an interface test result.
[0036] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the interface testing method as described in the first aspect above is implemented.
[0037] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the interface testing method described in the first aspect above.
[0038] The interface testing method according to the embodiment provided in the present application has at least the following beneficial effects: in the process of interface testing, interface test request information is first obtained; then, interface attribute information and interface test execution information can be obtained by extracting information from the interface test request information; then, the target test interface is screened from the preset system interface pool according to the interface attribute information; and the target interface test script is selected from the preset interface test script set according to the interface test execution information; finally, interface test processing is performed on the target test interface according to the target interface test script, and the interface test result can be obtained; through the above technical scheme, the interface testing efficiency of the system can be greatly improved, and then the development efficiency of the system can be greatly improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The accompanying drawings are used to provide further understanding of the technical solution of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present application and do not constitute a limitation on the technical solution of the present application.
[0040] Figure 1 is a flow chart of an interface testing method provided by an embodiment of the present application;
[0041] Figure 2 is a specific flow chart of step S200 provided in one embodiment of the present application;
[0042] Figure 3 is a specific flow chart of step S300 provided in one embodiment of the present application;
[0043] Figure 4 is a specific flow chart of step S400 provided in one embodiment of the present application;
[0044] Figure 5 is a specific flow chart of step S500 provided in one embodiment of the present application;
[0045] Figure 6 is a flow chart of an interface testing method provided by another embodiment of the present application;
[0046] Figure 7 This is a specific flow chart after step S610 provided in one embodiment of the present application;
[0047] Figure 8 is a schematic diagram of an interface testing device provided by an embodiment of the present application;
[0048] Fig. 9 It is a schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0049] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0050] It should be noted that although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification and claims and the above drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0051] It should be noted that, unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0052] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0053] AI is a new technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence. Artificial intelligence is a branch of computer science. Artificial intelligence attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Research in this field includes robots, language recognition, image recognition, natural language processing and expert systems. Artificial intelligence can simulate the information process of human consciousness and thinking. Artificial intelligence is also a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0054] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0055] Artificial intelligence is AI. AI is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0056] The servers involved in artificial intelligence technology can be independent servers or cloud servers that provide 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 (CDN), as well as big data and artificial intelligence platforms.
[0057] The present application provides an interface testing method, device, electronic device and computer-readable storage medium. In the process of interface testing, interface test request information is first obtained; then, interface test request information is extracted to obtain interface attribute information and interface test execution information; then, a target test interface is screened from a preset system interface pool according to the interface attribute information; and a target interface test script is selected from a preset interface test script set according to the interface test execution information; finally, interface test processing is performed on the target test interface according to the target interface test script to obtain an interface test result; through the above technical scheme, the interface testing efficiency of the system can be well improved, and thus the development efficiency of the system can be well improved.
[0058] The interface testing method provided in the embodiment of the present application relates to the field of interface testing technology. The interface testing method provided in the embodiment of the present application can be applied to a terminal, can be applied to a server side, or can be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or can be configured as a server cluster or a distributed system composed of multiple physical servers, or can be configured as 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, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the interface testing method, etc., but is not limited to the above forms.
[0059] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0060] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with relevant laws, regulations, and standards. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.
[0061] The embodiments of the present application are further described below in conjunction with the accompanying drawings.
[0062] like Figure 1 As shown, Figure 1 It is a flowchart of an interface testing method provided by an embodiment of the present application. The interface testing method includes but is not limited to steps S100 to S500.
[0063] Step S100, obtaining interface test request information;
[0064] Step S200, extracting information from the interface test request information to obtain interface attribute information and interface test execution information;
[0065] Step S300, filtering a target test interface from a preset system interface pool according to interface attribute information;
[0066] Step S400, selecting a target interface test script from a preset interface test script set according to the interface test execution information;
[0067] Step S500: perform interface test processing on the target test interface according to the target interface test script to obtain an interface test result.
[0068] It should be noted that in the process of interface testing, the interface test request information is first obtained; then, the interface test request information is extracted to obtain the interface attribute information and the interface test execution information; then, the target test interface is screened from the preset system interface pool according to the interface attribute information; and the target interface test script is selected from the preset interface test script set according to the interface test execution information; finally, the target test interface is subjected to interface test processing according to the target interface test script to obtain the interface test result; through the above technical scheme, the interface testing efficiency of the system can be greatly improved, and then the development efficiency of the system can be greatly improved.
[0069] It is worth noting that the embodiments of the present application will obtain the user's permission or consent before obtaining the interface test request information, and the collection, use and processing of such data will comply with relevant laws, regulations and standards. In addition, when the embodiments of the present application need to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After the user's separate permission or consent is clearly obtained, the necessary user-related data for the normal operation of the embodiments of the present application will be obtained.
[0070] It is worth noting that after obtaining the interface test request information, the interface test request information can be extracted, and then the interface attribute information and interface test execution information can be obtained; subsequently, the target test interface can be screened from the pre-set system interface pool according to the interface attribute information; according to the interface test execution information, the target test interface can be selected from the pre-set interface test script set; and according to the interface test execution information, the target interface test script can be selected from the pre-set multiple interface test script sets, and subsequently, the target test interface can be processed according to the target interface test script, so as to make the prerequisite preparations for improving the efficiency of interface testing.
[0071] It is worth noting that the system interface pool contains multiple test interfaces. According to the interface attribute information obtained, multiple test interfaces in the system interface pool can be screened and processed, and the corresponding target test interface can be obtained quickly and easily, so as to prepare for the subsequent interface test. According to the interface test execution information, the target interface test script can be selected from the pre-set interface test script set, and then the target test interface can be tested according to the selected target interface test script. Finally, the interface test result can be obtained. In the above way, the test efficiency of the interface in the system can be greatly accelerated, which is beneficial to the expansion and development of the system.
[0072] It is worth noting that the system interface pool usually refers to a mechanism used in the software architecture to manage and reuse system interface requests. This mechanism can improve resource utilization, reduce system overhead, and enhance the maintainability of the system. The following are some key points of the definition, application, and technical implementation of the system interface pool: The system interface pool is a resource management strategy that allows the system to reduce the overhead of creating and destroying interface connections by reusing existing interface connections when processing multiple requests. This pooling technology is similar to the concept of thread pools, which can improve system performance and reduce resource consumption. The system interface pool has a wide range of applications in many fields, including but not limited to: Network server: handles connection requests from multiple clients, manages connection processing threads through thread pools, and improves concurrent processing capabilities. Database connection pool: manages database connections, reduces the overhead of frequent creation and destruction of database connections, and improves database access efficiency. Task scheduling: When executing tasks regularly, use the scheduled task thread pool to manage task execution threads to improve task scheduling efficiency. Parallel computing: In parallel computing, the thread pool is used to manage computing task execution threads to improve parallel computing efficiency. Technical implementation, in terms of technical implementation, the system interface pool usually involves the following core components: Task submission: Provides interface reception task submission. Task management: Select the appropriate queue to manage submitted tasks, including setting rejection policies. Task execution: The worker thread executes the submitted tasks. Thread pool management: includes basic parameter settings, task monitoring, worker thread management, etc. System interface pool is an effective resource management strategy that improves system performance and resource utilization by reducing the number of times interface connections are created and destroyed. In actual applications, it is very important to select the appropriate thread pool type and configuration according to specific business needs and scenarios.
[0073] It is worth noting that an interface test script collection refers to a set of automated test scripts used to test application interfaces. These scripts are usually used to verify the functionality, performance, security, and reliability of the interface. They can be written manually or generated by automated testing tools. The following are some key components and features of an interface test script collection: Test cases, each of which is a script used to verify specific aspects of the interface, such as input parameters, expected output, error handling, etc. Assertions are used to verify that the interface response is as expected. They can check status codes, response times, response bodies, etc. Many test scripts use external data sources to drive tests, so that different input data can be tested without modifying the scripts. Test scripts are usually run in test frameworks that provide test organization, execution, and reporting capabilities. Interface test scripts can be written and executed in a variety of tools. Test coverage refers to the extent to which the test script covers the interface functionality. High coverage means that most of the functionality of the interface has been tested. After the test is completed, a test report is generated showing the test results, failed test cases, and possible errors. During the test, it may be necessary to simulate the response of external services. Interface test scripts can also include security tests to ensure that the interface is not subject to common security threats. Interface test scripts are the core of interface testing work, which help developers and testers ensure the quality and performance of interfaces. By automating these scripts, testing efficiency can be improved, human errors can be reduced, and interfaces can be ensured to remain stable and reliable throughout the development life cycle.
[0074] In some embodiments of the present application, after selecting the target interface test script, the target test interface can be subjected to interface test processing according to the target interface test script, and finally the corresponding interface test results can be obtained conveniently and quickly, making the interface testing process simpler and faster.
[0075] In some embodiments, Figure 2 As shown, the above step S200 may include but is not limited to steps S210 to S230.
[0076] Step S210, performing information splitting processing on the interface test request information to obtain attribute marking information and interface execution marking information;
[0077] Step S220, matching the attribute tag information with a preset attribute tag set to obtain interface attribute information;
[0078] Step S230, matching the interface execution mark information with a preset interface execution event set to obtain interface test execution information.
[0079] It should be noted that in the process of extracting information from the interface test request information to obtain the interface attribute information and the interface test execution information, the interface test request information is first subjected to information splitting processing to obtain the attribute tag information and the interface execution tag information; then the attribute tag information is matched with a preset attribute tag set to obtain the interface attribute information; finally, the interface execution tag information is matched with a preset interface execution event set to obtain the interface test execution information. Through the above technical scheme, the interface test request information is subjected to information splitting processing to obtain the attribute tag information and the interface execution tag information; subsequently, the attribute tag information can be matched with a preset attribute tag set; then, the interface execution tag information can be matched with the interface execution event, and finally, the corresponding interface test execution information can be obtained, so as to make the prerequisite preparation for the subsequent interface test.
[0080] It is worth noting that by matching the attribute tag information with a pre-set attribute tag set, the corresponding interface attribute information can be obtained; by matching the interface execution tag information with a pre-set interface execution event set, the corresponding interface test execution information can be obtained; through the above technical solution, the determination of interface attribute information and interface test execution information can be more accurate.
[0081] It is worth noting that the attribute tag set includes multiple attribute tags. By matching the attribute tag information with the multiple attribute tags in the attribute tag set, the corresponding interface attribute information can be obtained. The interface execution event set includes multiple interface execution events. By matching the interface execution tag information with the pre-set interface execution event set, the interface test execution information can also be quickly and accurately determined.
[0082] In some embodiments, Figure 3 As shown, the system interface pool includes multiple test interfaces, each test interface carries interface tag information, and the above step S300 may include but is not limited to steps S310 to S320.
[0083] Step S310, matching the interface attribute information with the interface tag information of each test interface in the system interface pool to obtain the target interface tag information;
[0084] Step S320: determine the test interface corresponding to the target interface mark information as the target test interface.
[0085] It should be noted that in the process of screening the target test interface from the preset system interface pool according to the interface attribute information, the interface attribute information and the interface tag information of each test interface in the system interface pool are first matched and processed to obtain the target interface tag information; finally, the test interface corresponding to the target interface tag information is determined as the target test interface. Through the above technical solution, the determination of the target test interface can be more accurate and rapid.
[0086] It is worth noting that the system interface pool includes multiple test interfaces, and each test interface carries interface tag information. Therefore, it is only necessary to match the interface attribute information with the interface tag information of each test interface to obtain the corresponding target interface tag information; finally, the test interface corresponding to the target interface tag information is determined as the corresponding target test interface.
[0087] In some embodiments, Figure 4 As shown, the interface test script set includes multiple interface test scripts, each interface test script carries interface execution marking information, and the above step S400 may include but is not limited to steps S410 to S420.
[0088] Step S410, matching the interface test execution information with the interface execution tag information of each interface test script in the interface test script set to obtain target interface execution tag information;
[0089] Step S420: determine the interface test script corresponding to the target interface execution mark information as the target interface test script.
[0090] It should be noted that in the process of selecting the target interface test script from a preset interface test script set based on the interface test execution information, the interface test execution information and the interface execution tag information of each interface test script in the interface test script set are first matched and processed to obtain the target interface execution tag information; finally, the interface test script corresponding to the target interface execution tag information is determined as the target interface test script, and then the interface test processing can be performed according to the target interface test script.
[0091] It is worth noting that the interface test script set includes multiple interface test scripts, and each interface test script carries interface execution marking information. Therefore, by matching the interface test execution information with the interface execution marking information of each interface test script in the interface test script set, the target interface execution marking information can be obtained; finally, the interface test script corresponding to the target interface execution marking information is determined as the target interface test script, so that the entire target interface test script determination process is accurate and fast.
[0092] In some embodiments, Figure 5 As shown, the above step S500 may include but is not limited to step S510 to step S520.
[0093] Step S510, determining test execution event information and test execution sequence information according to the target interface test script;
[0094] Step S520: Perform interface test processing on the target test interface according to the test execution event information and the test execution sequence information to obtain an interface test result.
[0095] It should be noted that in the process of performing interface testing on the target test interface according to the target interface test script to obtain the interface test result, the test execution event information and the test execution sequence information are first determined according to the target interface test script; then, according to the test execution event information and the test execution sequence information, the interface test is performed on the target test interface to obtain the interface test result; through the above technical scheme, the interface testing process can be more flexible, convenient and reliable.
[0096] It is worth noting that in the process of interface testing, the test execution event information and test execution sequence information are first determined according to the target interface test script; then, the target test interface can be subjected to interface testing according to the test execution event information and the test execution sequence information, and finally the interface test result can be obtained. The entire interface testing process is flexible, simple and reliable.
[0097] In some embodiments, Figure 6 As shown, after executing the above step S500, it may include but not be limited to steps S610 to S620.
[0098] Step S610, when the interface test result indicates that the target test interface test is normal, determining the target test interface as a data transceiver interface;
[0099] Step S620: When the interface test result indicates that the target test interface is abnormal, stop sending data to the target test interface.
[0100] It should be noted that after the target test interface is subjected to interface test processing according to the target interface test script to obtain the interface test result, if the interface test result indicates that the target test interface test is normal, the target test interface will be determined as the data sending and receiving interface to prepare for subsequent data transmission; if the interface test result indicates that the target test interface test is abnormal, sending data to the target test interface will be stopped, which will effectively prevent further transmission of abnormal data and ensure the security of data transmission.
[0101] It is worth noting that the interface test results are used to determine whether the target test interface test is normal. Only when the target test interface test is normal will the interface be further used for subsequent data transmission; if the target test interface test is abnormal, the interface will not be used for subsequent data transmission, thereby ensuring the reliability of subsequent data transmission.
[0102] In some embodiments, Figure 7 As shown, after executing the above step S610, it may include but not be limited to steps S611 to S612.
[0103] Step S611, receiving data to be forwarded;
[0104] Step S612: forwarding the data to be forwarded through the target test interface.
[0105] It should be noted that when the interface test results indicate that the target test is normal, after the target test interface is determined as the data transceiver interface, it can also receive data to be forwarded; then the data to be forwarded is forwarded through the target test interface so that the relevant data to be forwarded can be transmitted and processed stably and reliably.
[0106] In addition, if Figure 8 As shown, an embodiment of the present application further provides an interface testing device 10, comprising:
[0107] The first processing module 100 is used to obtain interface test request information;
[0108] The second processing module 200 is used to extract information from the interface test request information to obtain interface attribute information and interface test execution information;
[0109] The third processing module 300 is used to filter and obtain a target test interface from a preset system interface pool according to the interface attribute information;
[0110] The fourth processing module 400 is used to select a target interface test script from a preset interface test script set according to the interface test execution information;
[0111] The fifth processing module 500 is used to perform interface test processing on the target test interface according to the target interface test script to obtain an interface test result.
[0112] It should be noted that in the process of interface testing, the interface test request information is first obtained; then, the interface test request information is extracted to obtain the interface attribute information and the interface test execution information; then, the target test interface is screened from the preset system interface pool according to the interface attribute information; and the target interface test script is selected from the preset interface test script set according to the interface test execution information; finally, the target test interface is subjected to interface test processing according to the target interface test script to obtain the interface test result; through the above technical scheme, the interface testing efficiency of the system can be greatly improved, and then the development efficiency of the system can be greatly improved.
[0113] It is worth noting that the embodiments of the present application will obtain the user's permission or consent before obtaining the interface test request information, and the collection, use and processing of such data will comply with relevant laws, regulations and standards. In addition, when the embodiments of the present application need to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After the user's separate permission or consent is clearly obtained, the necessary user-related data for the normal operation of the embodiments of the present application will be obtained.
[0114] It is worth noting that after obtaining the interface test request information, the interface test request information can be extracted, and then the interface attribute information and interface test execution information can be obtained; subsequently, the target test interface can be screened from the pre-set system interface pool according to the interface attribute information; according to the interface test execution information, the target test interface can be selected from the pre-set interface test script set; and according to the interface test execution information, the target interface test script can be selected from the pre-set multiple interface test script sets, and subsequently, the target test interface can be processed according to the target interface test script, so as to make the prerequisite preparations for improving the efficiency of interface testing.
[0115] It is worth noting that the system interface pool contains multiple test interfaces. According to the interface attribute information obtained, multiple test interfaces in the system interface pool can be screened and processed, and the corresponding target test interface can be obtained quickly and easily, so as to prepare for the subsequent interface test. According to the interface test execution information, the target interface test script can be selected from the pre-set interface test script set, and then the target test interface can be tested according to the selected target interface test script. Finally, the interface test result can be obtained. In the above way, the test efficiency of the interface in the system can be greatly accelerated, which is beneficial to the expansion and development of the system.
[0116] It is worth noting that the system interface pool usually refers to a mechanism used in the software architecture to manage and reuse system interface requests. This mechanism can improve resource utilization, reduce system overhead, and enhance the maintainability of the system. The following are some key points of the definition, application, and technical implementation of the system interface pool: The system interface pool is a resource management strategy that allows the system to reduce the overhead of creating and destroying interface connections by reusing existing interface connections when processing multiple requests. This pooling technology is similar to the concept of thread pools, which can improve system performance and reduce resource consumption. The system interface pool has a wide range of applications in many fields, including but not limited to: Network server: handles connection requests from multiple clients, manages connection processing threads through thread pools, and improves concurrent processing capabilities. Database connection pool: manages database connections, reduces the overhead of frequent creation and destruction of database connections, and improves database access efficiency. Task scheduling: When executing tasks regularly, use the scheduled task thread pool to manage task execution threads to improve task scheduling efficiency. Parallel computing: In parallel computing, the thread pool is used to manage computing task execution threads to improve parallel computing efficiency. Technical implementation, in terms of technical implementation, the system interface pool usually involves the following core components: Task submission: Provides interface reception task submission. Task management: Select the appropriate queue to manage submitted tasks, including setting rejection policies. Task execution: The worker thread executes the submitted tasks. Thread pool management: includes basic parameter settings, task monitoring, worker thread management, etc. System interface pool is an effective resource management strategy that improves system performance and resource utilization by reducing the number of times interface connections are created and destroyed. In actual applications, it is very important to select the appropriate thread pool type and configuration according to specific business needs and scenarios.
[0117] The specific implementation of the interface testing device 10 is substantially the same as the specific implementation of the above-mentioned interface testing method, and will not be described in detail here.
[0118] In addition, if Fig. 9 As shown, an embodiment of the present application further provides an electronic device 700 , which includes: a memory 720 , a processor 710 , and a computer program stored in the memory 720 and executable on the processor 710 .
[0119] The processor 710 and the memory 720 may be connected via a bus or in other ways.
[0120] The non-transient software programs and instructions required to implement the interface testing methods of the above embodiments are stored in the memory 720 , and when executed by the processor 710 , the interface testing methods of the above embodiments are executed.
[0121] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0122] In addition, an embodiment of the present application also provides a computer-readable storage medium, which stores computer-executable instructions, and the computer-executable instructions are executed by a processor 710 or a controller, for example, by a processor 710 in the above-mentioned device embodiment, so that the above-mentioned processor 710 can execute the interface testing method in the above-mentioned embodiment.
[0123] The above embodiments may be used in combination, and modules with the same name in different embodiments may be the same or different.
[0124] The above describes specific embodiments of the present application, and other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily have to be performed in the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0125] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment, and computer-readable storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0126] The apparatus, device, computer-readable storage medium and method provided in the embodiments of the present application correspond to each other. Therefore, the apparatus, device and non-volatile computer storage medium also have similar beneficial technical effects as the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the corresponding apparatus, device and computer storage medium will not be repeated here.
[0127] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0128] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.
[0129] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0130] For the convenience of description, the above devices are described in terms of functions and are divided into various units. Of course, when implementing the embodiments of the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0131] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the embodiments of the present application may adopt the form of complete hardware embodiments, complete software embodiments, or embodiments in combination with software and hardware. Moreover, the embodiments of the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0132] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0133] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0134] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0135] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0136] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0137] Computer readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0138] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0139] In the embodiments of the present application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. Among them, A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c can be represented by: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, c can be single or multiple.
[0140] Embodiments of the present application may be described in the general context of computer executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. Embodiments of the present application may also be practiced in distributed computing environments, where tasks are performed by remote processing devices connected via a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0141] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0142] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. An interface testing method, characterized in that: The method comprises: Get interface test request information; Extracting information from the interface test request information to obtain interface attribute information and interface test execution information; Filtering a target test interface from a preset system interface pool according to the interface attribute information; Selecting a target interface test script from a preset interface test script set according to the interface test execution information; Perform interface test processing on the target test interface according to the target interface test script to obtain an interface test result.
2. The interface testing method according to claim 1, characterized in that: The extracting the interface test request information to obtain interface attribute information and interface test execution information includes: Perform information splitting processing on the interface test request information to obtain attribute marking information and interface execution marking information; Matching the attribute tag information with a preset attribute tag set to obtain the interface attribute information; The interface execution mark information is matched with a preset interface execution event set to obtain the interface test execution information.
3. The interface testing method according to claim 1, characterized in that: The system interface pool includes a plurality of test interfaces, each of which carries interface tag information, and the target test interface is obtained by screening from the preset system interface pool according to the interface attribute information, including: Matching the interface attribute information with the interface tag information of each test interface in the system interface pool to obtain target interface tag information; The test interface corresponding to the target interface mark information is determined as the target test interface.
4. The interface testing method according to claim 1, characterized in that: The interface test script set includes a plurality of interface test scripts, each of which carries interface execution mark information, and the step of selecting a target interface test script from a preset interface test script set according to the interface test execution information includes: Matching the interface test execution information with the interface execution tag information of each interface test script in the interface test script set to obtain target interface execution tag information; The interface test script corresponding to the target interface execution mark information is determined as the target interface test script.
5. The interface testing method according to claim 1, characterized in that: The performing interface test processing on the target test interface according to the target interface test script to obtain an interface test result includes: Determine test execution event information and test execution sequence information according to the target interface test script; According to the test execution event information and the test execution sequence information, interface test processing is performed on the target test interface to obtain the interface test result.
6. The interface testing method according to claim 1, characterized in that: After performing interface test processing on the target test interface according to the target interface test script and obtaining the interface test result, the method further includes at least one of the following: When the interface test result indicates that the target test interface test is normal, determining the target test interface as a data transceiver interface; When the interface test result indicates that the target test interface test is abnormal, stopping sending data to the target test interface.
7. The interface testing method according to claim 6, characterized in that: When the interface test result indicates that the target test interface test is normal, after determining the target test interface as a data transceiver interface, the method further includes: Receive data to be forwarded; The data to be forwarded is processed through the target test interface.
8. An interface testing device, characterized in that: include: The first processing module is used to obtain interface test request information; A second processing module is used to extract information from the interface test request information to obtain interface attribute information and interface test execution information; A third processing module, configured to filter and obtain a target test interface from a preset system interface pool according to the interface attribute information; A fourth processing module, configured to select a target interface test script from a preset interface test script set according to the interface test execution information; The fifth processing module is used to perform interface test processing on the target test interface according to the target interface test script to obtain an interface test result.
9. An electronic device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the interface testing method as claimed in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing computer-executable instructions, characterized in that: The computer executable instructions are used to execute the interface testing method described in any one of claims 1 to 7.