Interface joint debugging method and device before product production and delivery
By encapsulating the Redis and ResrTemplate classes, automatic interface joint debugging and repair are realized, which solves the problem of low efficiency of traditional interface joint debugging and testing, and improves the testing efficiency and quality before product delivery.
Patent Information
- Application Number
- CN202410926756.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-11
- Publication Date
- 2024-10-15
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional interface joint debugging testing methods have long cycle times, low efficiency, and poor stability, which affect product development progress and delivery quality.
By encapsulating the Redis and ResrTemplate classes, automated interface joint debugging is realized, interface information and return values are obtained, the results are verified, test reports are exported, and automatic repair instructions are triggered when verification fails to reduce manual intervention.
It saves testers manual testing time, improves testing efficiency, automates interface joint debugging and repair, and improves testing quality and efficiency before product delivery.
Smart Images

Figure CN118779235A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer software technology, and in particular to an interface joint debugging method and device before product production and delivery. Background Art
[0002] With the development and rapid implementation of cloud computing technology, more and more large enterprises have built private clouds or public clouds. At the same time, the demand for disaster recovery, auditing, security protection and other aspects has become increasingly clear, and the amount of infrastructure has also grown rapidly. It is inevitable that it is divided into various related departments according to business needs. Apart from the business, in terms of the actual development process, there are many products from different departments and manufacturers used in the development process, and the use of products varies from customer to customer. Under the traditional method, a large amount of joint debugging and testing is required before production and delivery. Interface joint debugging and testing is a key link to ensure the functional integrity and stability of the product. With the continuous increase in product complexity, the importance of interface joint debugging and testing has become increasingly prominent. However, the traditional interface joint debugging and testing methods have problems such as long cycle, low efficiency, and poor stability, which seriously affect the development progress and delivery quality of the product. Summary of the invention
[0003] In order to solve the above technical problems, the present invention is proposed. The embodiment of the present invention provides a method and device for interface joint debugging before product production and delivery, which can automate interface joint debugging, save testers' manual testing time, and improve testing efficiency.
[0004] According to one aspect of the present invention, there is provided an interface joint debugging method before product production and delivery, comprising: encapsulating Redis and ResrTemplate classes; Redis represents a remote dictionary service, which is used to provide APIs in multiple languages and support multiple data types, and the ResrTemplate class represents a class library for sending HTTP requests and processing responses; before product production and delivery, based on the encapsulated Redis and ResrTemplate classes, an interface joint debugging start instruction is obtained; based on the interface joint debugging start instruction, interface information and interface return values involved in the joint debugging are obtained; the interface return value is verified to obtain a verification result of the interface return value; when the verification result indicates that the verification is successful, it indicates that the interface call is successful, and a test report is exported.
[0005] In one embodiment, Redis and ResrTemplate classes are encapsulated, including: re-encapsulating the ResrTemplate class and encapsulating the ResrTemplate class into a tool class; wherein a common request header and request body are constructed in the tool class to satisfy the interface request of the interface involved in the joint debugging; encapsulating Redis and changing Redis from a stand-alone mode to a cluster mode.
[0006] In one embodiment, before obtaining the interface information and interface return value involved in the joint debugging based on the interface joint debugging start instruction, the interface joint debugging method before product production delivery also includes: obtaining preset encapsulation processing settings for different data; wherein, the encapsulation processing settings include converting different data types into preset agreed types, and the preset agreed types include agreed requirements for interface return values; wherein, after obtaining the interface information and interface return value involved in the joint debugging based on the interface joint debugging start instruction, the interface joint debugging method before product production delivery also includes: checking the data type of the interface return value; when the data type is not the preset agreed type, converting the data type of the interface return value into the preset agreed type based on the encapsulation processing settings.
[0007] In one embodiment, the interface debugging method before product production and delivery also includes: secondary packaging of POI to add multiple default test report templates; wherein, when the verification result indicates that the verification is successful, it means that the interface is called successfully, and the test report is exported, including: based on the default test report template and the data of the successful interface call, the test report is exported to the front end in the form of File type.
[0008] In one embodiment, after verifying the interface return value and obtaining the verification result of the interface return value, the interface joint debugging method before product production and delivery also includes: when the verification result indicates that the verification failed, issuing an alarm suggestion; based on the verification result of the verification failure, triggering an automatic repair instruction.
[0009] In one embodiment, when the verification result indicates that the verification failed, an alarm suggestion is issued, including: obtaining the interface error cause and interface information from Redis to locate the error location; based on the error location and the interface information, sending error information to the corresponding receiver; based on the error location and the interface error cause, providing repair suggestion information to the corresponding receiver.
[0010] In one embodiment, after the automatic repair instruction is triggered based on the verification result of the verification failure, the interface joint debugging method before the product production and delivery includes: based on the automatic repair instruction, starting multiple threads to process the judgment logic and obtain interface related information; wherein, the interface related information includes: forwarding call, real-time database query, multi-interface splicing, request method, interface parameters; through the interface related information of the Mysql database product, check whether the interface is configured incorrectly, whether the configuration file is written incorrectly, whether the token is expired, and obtain the inspection result; according to the inspection result, repair the interface.
[0011] In one embodiment, after repairing the interface according to the inspection result, the interface debugging method before product production and delivery also includes: after successfully repairing the interface, re-starting the automatic debugging function suggestion to obtain a secondary interface debugging start instruction; performing a secondary interface debugging based on the secondary acquisition of the interface debugging start instruction; when the secondary interface debugging fails, issuing a secondary failure alarm suggestion.
[0012] In one embodiment, after repairing the interface according to the inspection results, the interface debugging method before product production and delivery also includes: applying for a work order when the interface repair fails and the number of failures in repairing the interface is greater than a preset number of failures; wherein the work order includes product interface error information, suggestion information and responsible person information; and pushing the work order to the preset responsible person.
[0013] According to another aspect of the present invention, there is provided an interface joint debugging device before product production and delivery, comprising: an encapsulation module, used to encapsulate Redis and ResrTemplate classes; Redis represents a remote dictionary service, used to provide APIs in multiple languages, and supports multiple data types, and the ResrTemplate class represents a class library for sending HTTP requests and processing responses; an acquisition module, used to obtain an interface joint debugging start instruction based on the encapsulated Redis and ResrTemplate classes before product production and delivery; a joint debugging module, used to obtain interface information and interface return values involved in the joint debugging based on the interface joint debugging start instruction; a verification module, used to verify the interface return value and obtain a verification result of the interface return value; an export module, used to indicate that the interface call is successful when the verification result indicates that the verification is successful, and to export a test report.
[0014] The interface joint debugging method and device before product production and delivery provided by the present invention free testers from the existing tedious testing work. Testers only need to perform product interface joint debugging according to the unified page trigger button provided by the cloud management platform. Not only do they not need to pay attention to the differences between interfaces, but the interface calls also do not require further manual analysis. The test report can be exported after the test passes, which saves a lot of time and labor costs and improves the efficiency of interface testing before product production and delivery. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The above and other purposes, features and advantages of the present invention will become more apparent by describing the embodiments of the present invention in more detail in conjunction with the accompanying drawings. The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings, the same reference numerals generally represent the same components or steps.
[0016] Figure 1It is a flowchart of an interface joint debugging method before product production and delivery provided by an exemplary embodiment of the present invention.
[0017] Figure 2 It is a flowchart of an interface joint debugging method before product production and delivery provided by another exemplary embodiment of the present invention.
[0018] Figure 3 It is a structural schematic diagram of an interface joint debugging device before product production and delivery provided by an exemplary embodiment of the present invention. DETAILED DESCRIPTION
[0019] Below, the exemplary embodiments according to the present invention will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments of the present invention, and it should be understood that the present invention is not limited to the exemplary embodiments described here.
[0020] Interface testing is an important form of product testing, focusing on the data exchange process between systems or components. During the product development process, various modules or systems interact through interfaces, and the correctness and stability of the interface directly affect the operation effect of the entire system. Therefore, interface testing has become one of the important means to ensure product quality. However, traditional interface joint debugging test methods often require manual configuration of the test environment, writing test cases, executing test steps, etc., which is time-consuming and cannot adapt to the needs of rapid iteration development. Manual testing is not only time-consuming, but also prone to errors, resulting in low test efficiency. In addition, due to different skill levels and experience of testers, test results may also vary. At present, there are already some interface joint debugging test tools and methods on the market, such as Postman, JMeter, etc. These tools have improved the test efficiency and accuracy to a certain extent, but there are still problems such as low automation and difficulty in analyzing test results.
[0021] The interface joint debugging method provided by the present invention can be implemented based on SpringBoot, vue2, Redis, Mysql, and JDK1.8. The relevant products that need joint debugging have been deployed, Redis has been deployed, and the relevant database query permissions have been opened. Based on the front-end framework of vue2 and the back-end framework of SpringBoot, the cloud management platform automatically implements the interface joint debugging method of the present invention by calling the underlying API. The present invention can automatically perform interface joint debugging, realize automatic execution and result analysis of tests, and can automatically repair, warn and suggest, and initiate work orders, thereby improving the test efficiency and quality before product delivery.
[0022] Low-level APIs (Application Programming Interfaces) usually refer to interfaces that directly interact with system hardware, operating system core functions, or low-level software libraries. These interfaces provide direct access to the computer's underlying resources (such as CPU, memory, disk, network interface, etc.), or provide access to core services provided by the operating system (such as file management, process management, thread synchronization, etc.).
[0023] Figure 1 FIG. 1 is a flow chart of an interface joint debugging method before product production and delivery provided by an exemplary embodiment of the present invention. Figure 1 As shown in the figure, the interface joint debugging method before product production and delivery includes:
[0024] S1: Encapsulate the Redis and ResrTemplate classes.
[0025] Redis (Remote Dictionary Server), or remote dictionary service, is an open source, network-supported, memory-based and persistent log-type, Key-Value database written in ANSI C language. It provides APIs in multiple languages and supports multiple data types, including string, hash, list, set and ordered set. Redis has the characteristics of fast speed, high availability and easy expansion. As an in-memory database, Redis has very fast read and write speed, which can significantly improve the performance of applications. By storing hot data in Redis, the number of accesses to relational databases can be reduced and the database load can be reduced. Redis supports multiple data types and can select appropriate data types according to different scenarios to implement distributed locks. Distributed locks and concurrency control can be implemented by caching lock information and lock status. Although Redis mainly stores data in memory, it also supports persisting data to disk. This ensures that data will not be lost after the system is restarted. Redis is encapsulated to prevent cache penetration, initialize Redis connection pool, release jedis resources, and obtain key data through fuzzy matching. To use Redis, you only need to call the encapsulated method. The ResrTemplate class represents a class library for sending HTTP requests and processing responses. RestTemplate provides convenient methods to perform various HTTP request operations, such as GET, POST, PUT, DELETE, etc. The ResrTemplate class also supports functions such as the transmission of request parameters, the setting of request headers, and the parsing of response data. The ResrTemplate class is encapsulated twice as a tool class, in which a common request header and request body are constructed, which basically meets all interface requests. When calling the interface, only the relevant URL and request method need to be passed in. The present invention will automatically encapsulate the request header, request body, and any calling interface. By encapsulating Redis and the ResrTemplate class, an interface joint debugging environment can be deployed without paying attention to the differences between interfaces, achieving unification, and improving test efficiency and test adaptability.
[0026] S2: Before product production and delivery, obtain the interface joint debugging start instruction based on the encapsulated Redis and ResrTemplate classes.
[0027] If Redis has been deployed in the current environment before (the stand-alone mode needs to be changed to cluster mode), it can be extended to the product interface joint debugging. Redis is encapsulated to prevent cache penetration, initialize the Redis connection pool, release jedis resources, and obtain key data through fuzzy matching. To use Redis, you only need to call the encapsulated method. The ResrTemplate class is encapsulated twice as a tool class. The common request header and request body are built in the tool class, which basically meets all interface requests. Therefore, after the test environment is deployed, the automatic interface joint debugging can be triggered on the cloud management platform page, without the need for testers to operate manually again and again.
[0028] S3: Based on the interface joint debugging start instruction, obtain the interface information and interface return value involved in the joint debugging.
[0029] Ensure that the environment required for joint debugging has been set up, and start automatic interface joint debugging based on the interface joint debugging start instruction. Interface joint debugging is an important part of the software development process. Based on the above environment, when calling the interface, you only need to pass in the relevant URL and request method. For example, use HTTP request (such as GET or POST) to send a request to the target interface. After the target interface receives the request, it will perform corresponding processing according to the content of the request. After the interface processes the request, it will generate a response and return it to the client that initiated the request. The response usually includes a status code, a response header, and a response body. After the client receives the response, it needs to parse the response to obtain the required data.
[0030] S4: Verify the interface return value and obtain the verification result of the interface return value.
[0031] Verify whether the returned interface value meets expectations by comparing it with the expected result, checking the error code, or executing other verification logic. In addition, the interface return value often varies depending on the product and the way of obtaining data, resulting in different return value types. Based on this, a public method for encapsulating and processing different data types can be used, including Json to List, JSONObject to entity class, String to JSONArrayd and other type conversions.
[0032] S5: When the verification result indicates that the verification is successful, it means that the interface is called successfully and the test report is exported.
[0033] After successful verification, the test report can be directly exported based on the default test report template added in advance and the relevant information of the successful interface call, without the need for testers to write it manually. In addition, if there are mandatory requirements for the test report template, testers can also upload the specified test report template, providing flexible and convenient export types.
[0034] In one embodiment, S1 (encapsulating Redis and ResrTemplate classes) includes: performing secondary encapsulation on the ResrTemplate class and encapsulating the ResrTemplate class into a tool class; wherein a common request header and request body are constructed in the tool class to satisfy the interface requests of the interfaces involved in the joint debugging; encapsulating Redis and changing Redis from a stand-alone mode to a cluster mode.
[0035] The ResrTemplate class is encapsulated twice as a tool class. A common request header and request body are constructed in the tool class, which basically meets all interface requests. When calling the interface, you only need to pass in the relevant URL and request method. The present invention will automatically encapsulate the request header, request body, and any calling interface. If Redis has been deployed in the current environment, the stand-alone mode needs to be changed to cluster mode, which can be extended to product interface joint debugging. If Redis is not deployed, Redis is encapsulated to prevent cache penetration, initialize the Redis connection pool, release jedis resources, obtain key data through fuzzy matching, etc. To use Redis, you only need to call the encapsulated method.
[0036] In one embodiment, before S3 (obtaining interface information and interface return values involved in the joint debugging based on the interface joint debugging start instruction), the interface joint debugging method before product production and delivery may also include: obtaining preset encapsulation processing settings for different data; wherein, the encapsulation processing settings include converting different data types into preset agreed types, and the preset agreed types include agreed requirements for interface return values; wherein, after S3 (obtaining interface information and interface return values involved in the joint debugging based on the interface joint debugging start instruction), the interface joint debugging method before product production and delivery may also include: checking the data type of the interface return value; when the data type is not the preset agreed type, converting the data type of the interface return value into the preset agreed type based on the encapsulation processing settings.
[0037] The preset encapsulation processing settings for different data include the use of common encapsulation processing for different data types, such as Json to List, JSONObject to entity class, String to JSONArrayd and other type conversions. When the interface return value does not meet the agreed requirements of the product and the customer for the interface return value (for example, JSONObject type), the interface return value is converted to JSONObject type through common encapsulation processing, and Boolean type is returned to indicate that the verification is passed. Data types include but are not limited to the types in the above examples, and the preset agreed types are set according to the agreed requirements of the product and the customer for the interface return value, and can be flexibly changed.
[0038] In one embodiment, the interface debugging method before the above-mentioned product production and delivery may also include: secondary packaging of POI to add multiple default test report templates; wherein, S5 (when the verification result indicates that the verification is successful, it means that the interface is called successfully and the test report is exported) may include: based on the default test report template and the data of the successful interface call, the test report is exported to the front end in the form of File type.
[0039] POI refers to Apache POI, which is an open source project of the Apache Software Foundation. It provides a set of APIs that allow Java programmers to create, modify, and display MS Office documents. These documents include Excel (.xls and .xlsx formats), Word (.doc and .docx formats), etc. Through Apache POI, Java developers can read data from Excel files, modify the data, and write the modified data back to the file. In addition, it can also create new Excel files and format them. POI's secondary encapsulation refers to developers further encapsulating the Apache POI API to simplify the use process and improve the readability and maintainability of the code. This encapsulation usually hides the complex details of the underlying Apache POI and provides a set of more advanced and easier-to-use APIs. The main purpose of secondary encapsulation is to reduce the amount of code that developers need to write when processing Excel files and improve development efficiency. At the same time, through encapsulation, some common functions can be more easily implemented, such as exporting a list of Java objects to an Excel file, or importing data from an Excel file into a Java object. Through encapsulation, developers can complete the reading and writing operations of Excel files more intuitively. The encapsulated code can be shared by multiple projects or modules, thereby improving the reusability of the code. When the API of Apache POI changes, only the code of the encapsulation layer needs to be modified without modifying all places where Apache POI is used.
[0040] POI is encapsulated twice, and multiple default test report templates are added in the form of code for testers to choose from. If there are mandatory requirements for the test report template, the tester can also upload the specified test report template and return it to the front end as a File type to complete the export function. After the test report template is arranged, after the interface return value is verified, Redis obtains the interface call information, that is, the data of successful interface call, and then selects the export template, generates a test report based on the interface call information and the export template, and ends the interface call to complete the interface call.
[0041] Figure 2 FIG. 1 is a flow chart of an interface joint debugging method before product production and delivery provided by another exemplary embodiment of the present invention. Figure 2 As shown, after S4 (verifying the interface return value and obtaining the verification result of the interface return value), the interface joint debugging method before product production and delivery may also include:
[0042] S6: When the verification result indicates that the verification fails, an alarm suggestion is issued.
[0043] S7: triggering an automatic repair instruction based on the verification result of the verification failure.
[0044] Testers only need to perform product interface joint debugging according to the unified page trigger button provided by the cloud management platform. If the test passes, the test report can be exported. If the test fails, the bug can be quickly handled and the person in charge can be clearly identified to initiate an alarm suggestion. It can also be automatically repaired based on the corresponding exception handling logic, thereby reducing the workload of testers.
[0045] In one embodiment, S6 (issuing an alarm suggestion when the verification result indicates that the verification failed) may include: obtaining the interface error cause and interface information from Redis to locate the error location; based on the error location and interface information, sending error information to the corresponding receiver; based on the error location and interface error cause, providing repair suggestion information to the corresponding receiver.
[0046] The reason for the interface error and interface information are obtained from Redis to locate the source of the BUG. For example, if the original interface of the product is called successfully, and an error is reported when calling the interface after forwarding, then the error information and repair suggestion information need to be sent to the developer of this interface for processing. Conversely, if the original interface of the interface also reports an error, the error information and repair suggestion information need to be sent to the product R&D personnel for processing. At the same time, the present invention not only outputs the error information, but also proposes repair suggestion information based on the error information (such as a serious bug that has no authority to repair, it can be suggested to initiate a work order for the person in charge to handle) to improve the efficiency of BUG repair.
[0047] In one embodiment, after S7 (triggering automatic repair instructions based on the verification result of failed verification), the interface joint debugging method before the above-mentioned product production and delivery may include: based on the automatic repair instructions, starting multiple threads to process the judgment logic and obtain interface related information; wherein the interface related information includes: forwarding calls, real-time database queries, multi-interface splicing, request methods, and interface parameters; through the interface related information of the Mysql database product, check whether the interface is incorrectly configured, whether the configuration file is incorrectly written, and whether the token is expired to obtain the inspection results; according to the inspection results, repair the interface.
[0048] After the interface joint debugging fails, the automatic repair instruction is triggered, and multi-threading is started to process the judgment logic (optimal number of threads = number of CPU cores + 1). The interface related information (forwarding call, real-time database query, multi-interface splicing, request method, interface parameters) is judged. Through the relevant information of the Mysql database product interface, check whether the interface is forwarded, whether the database is directly obtained, whether multi-interface query splicing, interface request method, interface request parameters, etc. After the repair is successful, the automatic joint debugging function is started again. If the repair fails, an alarm suggestion is issued. Automatic repair information is stored in Redis.
[0049] In one embodiment, after the interface is repaired according to the inspection results, the interface debugging method before the above-mentioned product production and delivery may also include: after the interface is successfully repaired, re-starting the automatic debugging function suggestion to obtain a secondary interface debugging start instruction; performing a secondary interface debugging based on the secondary acquisition of the interface debugging start instruction; when the secondary interface debugging fails, issuing a secondary failure alarm suggestion.
[0050] like Figure 2 As shown, after S7, if the repair is successful, execute S8: After the interface is repaired successfully, restart the automatic joint debugging function suggestion, which can be understood as continuing to execute S2 (obtaining the interface joint debugging start instruction)-S3 after S8. When the secondary interface joint debugging fails, a secondary failure alarm suggestion is issued. According to the secondary failure alarm suggestion, the automatic repair instruction can continue to be triggered, but after multiple failure alarms, it is necessary to apply for a work order and request manual intervention for repair. At this time, the problem cannot be solved by automatic repair.
[0051] In one embodiment, if Figure 2 As shown, after repairing the interface according to the inspection results, the interface joint debugging method before the above-mentioned product production and delivery may also include: S9: when the interface repair fails and the number of failures in repairing the interface is greater than the preset number of failures, applying for a work order; wherein the work order includes product interface error information, suggestion information and person in charge information; and pushing the work order to the preset person in charge.
[0052] For serious bugs that cannot be fixed with permission, a work order needs to be sent to the developer for processing. After the front-end initiates the work order command, the back-end redirects to the work order system and carries the product interface error information, suggestion information and responsible person information, and assigns it to the front-end page of the work order system, which helps testers send work orders without having to edit the work order information.
[0053] In one embodiment, a public method for message notification is provided, which realizes the notification of information in Java. In the present invention, it is mainly used to trigger automatic repair and alarm suggestion functions. The implementation steps are: notify the sender, create a java class as the notification sender, responsible for sending notifications; notify the receiver, create a java class as the notification receiver, responsible for receiving and processing notifications; register the notification receiver, register to receive in the sender; send notifications; receive and process notifications.
[0054] In the present invention, the tester only needs to perform joint debugging of the product interface according to the unified page trigger button provided by the cloud management platform. If the test passes, the test report can be exported. If the test fails, the bug can be quickly handled and the person in charge can be clearly identified to initiate a work order, thereby reducing the workload of the tester. Therefore, the present invention can realize functions such as automatic joint debugging of interfaces, output of test reports, automatic problem handling, automatic alarm, and initiation of work orders.
[0055] Figure 3 FIG. 1 is a schematic diagram of the structure of an interface joint debugging device before product production and delivery provided by an exemplary embodiment of the present invention. Figure 3 As shown, the interface joint debugging device 9 before product production and delivery includes: an encapsulation module 91, which is used to encapsulate Redis and ResrTemplate classes; Redis represents a remote dictionary service, which is used to provide APIs in multiple languages and support multiple data types, and the ResrTemplate class represents a class library for sending HTTP requests and processing responses; an acquisition module 92, which is used to obtain the interface joint debugging start instruction based on the encapsulated Redis and ResrTemplate classes before product production and delivery; a joint debugging module 93, which is used to obtain the interface information and interface return value involved in the joint debugging based on the interface joint debugging start instruction; a verification module 94, which is used to verify the interface return value and obtain the verification result of the interface return value; an export module 95, which is used to indicate that the interface call is successful when the verification result indicates that the verification is successful, and to export a test report.
[0056] The interface debugging device before product production and delivery provided by the present invention frees testers from the existing tedious testing work. Testers only need to perform product interface debugging according to the unified page trigger button provided by the cloud management platform. The test report can be exported after the test passes, which saves a lot of time and labor costs and improves the efficiency of interface testing before product production and delivery.
[0057] In one embodiment, the encapsulation module 91 includes: secondary encapsulation of the ResrTemplate class, encapsulating the ResrTemplate class into a tool class; wherein a common request header and request body are constructed in the tool class to satisfy the interface request of the interface involved in the joint debugging; encapsulating Redis, and changing Redis from a stand-alone mode to a cluster mode.
[0058] In one embodiment, the interface debugging device 9 before product production and delivery can also be configured to: obtain preset encapsulation processing settings for different data; wherein, the encapsulation processing settings include converting different data types into preset agreed types, and the preset agreed types include agreed requirements for interface return values; wherein, the interface debugging device 9 before product production and delivery can also include: checking the data type of the interface return value; when the data type is not the preset agreed type, converting the data type of the interface return value into the preset agreed type based on the encapsulation processing settings.
[0059] In one embodiment, the interface debugging device 9 before product production and delivery can also be configured to: perform secondary packaging on the POI to add multiple default test report templates; wherein the export module 95 can be configured to: based on the default test report template and the data of successful interface call, return the exported test report to the front end in the form of File type.
[0060] In one embodiment, the interface joint debugging device 9 before product production and delivery can also be configured as: an alarm module, which is used to issue an alarm suggestion when the verification result indicates verification failure. A repair module, which is used to trigger an automatic repair instruction based on the verification result of verification failure.
[0061] In one embodiment, the alarm module can be configured to: obtain the interface error cause and interface information from Redis to locate the error location; send error information to the corresponding receiver based on the error location and interface information; and provide repair suggestion information to the corresponding receiver based on the error location and interface error cause.
[0062] In one embodiment, the interface joint debugging device 9 before product production and delivery can also be configured as: based on the automatic repair instruction, start multiple threads to process the judgment logic and obtain interface related information; wherein, the interface related information includes: forwarding call, real-time database query, multi-interface splicing, request method, interface parameters; through the interface related information of the Mysql database product, check whether the interface is configured incorrectly, whether the configuration file is written incorrectly, whether the token is expired, and obtain the inspection result; according to the inspection result, repair the interface.
[0063] In one embodiment, the interface debugging device 9 before product production and delivery can also be configured as: after the interface is repaired successfully, the automatic debugging function suggestion is started again to obtain the secondary interface debugging start instruction; based on the secondary acquisition of the interface debugging start instruction, a secondary interface debugging is performed; when the secondary interface debugging fails, a secondary failure alarm suggestion is issued.
[0064] In one embodiment, the interface debugging device 9 before product production and delivery can also be configured as follows: when the interface repair fails and the number of interface repair failures is greater than the preset number of failures, a work order is applied; wherein the work order includes product interface error information, suggestion information and person in charge information; and the work order is pushed to the preset person in charge.
[0065] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising: a processor; a memory for storing instructions executable by the processor; and a processor for executing the interface joint debugging method before product production and delivery of any of the above embodiments.
[0066] An electronic device includes one or more processors and memory.
[0067] The processor may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions.
[0068] The memory may include one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor may run the program instructions to implement the interface joint debugging method before product production and delivery of the various embodiments of the present invention described above and / or other desired functions. Various contents such as input signals, signal components, noise components, etc. may also be stored in the computer-readable storage medium.
[0069] In one example, the electronic device may further include: an input device and an output device, and these components are interconnected via a bus system and / or other forms of connection mechanisms.
[0070] When the electronic device is a stand-alone device, the input device may be a communication network connector for receiving collected input signals from the first device and the second device.
[0071] In addition, the input device may also include, for example, a keyboard, a mouse, and the like.
[0072] The output device can output various information to the outside, including the determined distance information, direction information, etc. The output device can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, and the like.
[0073] Of course, the above embodiments only show some of the components in the electronic device related to the present invention, omitting components such as bus, input / output interface, etc. In addition, the electronic device may further include any other appropriate components according to specific application conditions.
[0074] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the storage medium stores a computer program for executing the interface joint debugging method before product production and delivery of any of the above embodiments.
[0075] An embodiment of the present invention may also be a computer-readable storage medium having computer program instructions stored thereon. When the computer program instructions are executed by a processor, the processor executes the steps of the interface debugging method before product production and delivery according to various embodiments of the present invention described above in this specification.
[0076] Computer readable storage media can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0077] The computer program product may be written in any combination of one or more programming languages to write program code for performing the operations of embodiments of the present invention, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0078] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. An interface joint debugging method before product production and delivery, It is characterized in that include: Encapsulate the Redis and ResrTemplate classes; Redis represents the remote dictionary service, which is used to provide APIs in multiple languages and support multiple data types; the ResrTemplate class represents the class library used to send HTTP requests and process responses; Before product production and delivery, obtain the interface joint debugging start instruction based on the encapsulated Redis and ResrTemplate classes; Based on the interface joint debugging start instruction, obtain the interface information and interface return value involved in the joint debugging; Verify the interface return value and obtain the verification result of the interface return value; When the verification result indicates that the verification is successful, it means that the interface is called successfully and a test report is exported.
2. The interface joint debugging method before product production and delivery according to claim 1, It is characterized in that Encapsulate the Redis and ResrTemplate classes, including: The ResrTemplate class is encapsulated twice and encapsulated as a tool class; wherein a common request header and request body are constructed in the tool class to satisfy the interface request of the interface involved in the joint debugging; Encapsulate Redis and change Redis from stand-alone mode to cluster mode.
3. The interface joint debugging method before product production and delivery according to claim 1, It is characterized in that Before obtaining the interface information and interface return value involved in the joint debugging based on the interface joint debugging start instruction, the interface joint debugging method before product production and delivery also includes: Obtaining preset encapsulation processing settings for different data; wherein the encapsulation processing settings include converting different data types into preset agreed types, and the preset agreed types include agreed requirements for interface return values; Among them, after obtaining the interface information and interface return value involved in the joint debugging based on the interface joint debugging start instruction, the interface joint debugging method before product production and delivery also includes: Check the data type of the interface return value; When the data type is not a preset agreed type, based on the encapsulation processing setting, the data type of the interface return value is converted into the preset agreed type.
4. The interface joint debugging method before product production and delivery according to claim 1, It is characterized in that The interface joint debugging method before product production and delivery also includes: Repackage POI to add multiple default test report templates; When the verification result indicates that the verification is successful, it means that the interface is successfully called, and a test report is exported, including: Based on the default test report template and the data of successful interface call, the test report is exported to the front end in the form of File type.
5. The interface joint debugging method before product production and delivery according to claim 1, It is characterized in that After verifying the interface return value and obtaining the verification result of the interface return value, the interface joint debugging method before product production and delivery also includes: When the verification result indicates that the verification fails, issuing an alarm suggestion; Based on the verification result of the verification failure, an automatic repair instruction is triggered.
6. The interface joint debugging method before product production and delivery according to claim 5, It is characterized in that When the verification result indicates that the verification fails, an alarm suggestion is issued, including: Obtain the interface error cause and interface information from Redis to locate the error location; Based on the error location and the interface information, sending error information to a corresponding receiver; Based on the error location and the cause of the interface error, repair suggestion information is provided to the corresponding recipient.
7. The interface joint debugging method before product production and delivery according to claim 5, It is characterized in that After triggering an automatic repair instruction based on the verification result of the verification failure, the interface joint debugging method before the product production and delivery includes: Based on the automatic repair instruction, multithreading is started to process the judgment logic and obtain interface related information; wherein the interface related information includes: forwarding call, real-time database query, multi-interface splicing, request mode, and interface parameters; Through the interface-related information of the MySQL database product, check whether the interface is configured incorrectly, whether the configuration file is written incorrectly, whether the token is expired, and obtain the inspection results; According to the inspection result, the interface is repaired.
8. The interface joint debugging method before product production and delivery according to claim 7, It is characterized in that After the interface is repaired according to the inspection result, the interface joint debugging method before the product production and delivery also includes: After the interface is repaired successfully, it is recommended to start the automatic joint debugging function again to obtain the second interface joint debugging start instruction; Based on the secondary acquisition interface joint debugging start instruction, perform secondary interface joint debugging; When the secondary interface joint debugging fails, a secondary failure alarm suggestion is issued.
9. The interface joint debugging method before product production and delivery according to claim 7, It is characterized in that After the interface is repaired according to the inspection result, the interface joint debugging method before product production and delivery also includes: When the interface repair fails and the number of times the interface repair fails is greater than the preset number of failures, a work order is applied; wherein the work order includes product interface error information, suggestion information and person in charge information; Push the work order to the preset person in charge.
10. An interface joint debugging device before product production and delivery, It is characterized in that include: Encapsulation module, used to encapsulate Redis and ResrTemplate classes; Redis represents the remote dictionary service, which is used to provide APIs in multiple languages and support multiple data types; ResrTemplate class represents the class library used to send HTTP requests and process responses; The acquisition module is used to obtain the interface joint debugging start instruction based on the encapsulated Redis and ResrTemplate classes before product production and delivery; A joint debugging module, used to obtain interface information and interface return values involved in the joint debugging based on the interface joint debugging start instruction; A verification module, used to verify the interface return value and obtain a verification result of the interface return value; The export module is used to indicate that the interface call is successful and export the test report when the verification result indicates that the verification is successful.
