Interface information synchronization method and apparatus, computer device, and storage medium
By automatically acquiring and converting interface data through the interface information synchronization function, the problem of time-consuming and error-prone manual data entry is solved, and efficient and accurate interface information synchronization is achieved.
Patent Information
- Application Number
- CN202211131308.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-16
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2042-09-16
AI Technical Summary
In existing technologies, interface information synchronization is time-consuming and has a high error rate, mainly due to the large amount of manual input of interfaces.
Through a preset information synchronization function, the automation platform obtains the configuration and identification information of the interface development platform, uses the interface identification information to obtain detailed data information of the interface, and generates synchronization results, supporting interface type conversion and visual display.
It enables efficient and accurate input and synchronization of large amounts of interface data, reduces human error, and improves the efficiency and accuracy of interface information synchronization.
Smart Images

Figure CN115422298B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of digital data processing, and in particular to an interface information synchronization method and device, computer equipment and a storage medium. BACKGROUND
[0002] With the increasing complexity of software applications and the increasing scale of software development, testers need to perform main flow regression on all functions of a product before its release. To achieve automatic regression of interfaces, all function interfaces need to be entered into an interface automation platform. In traditional techniques, technical personnel manually enter information such as interface methods, paths, and request parameters. The manual entry of a large number of interfaces is time-consuming and labor-intensive and increases the risk of errors.
[0003] Currently, there is no effective solution to the problem that a large number of interfaces can only be entered manually in related techniques, resulting in a time-consuming and high-error-rate interface information synchronization. SUMMARY
[0004] Therefore, it is necessary to provide an interface information synchronization method, device, computer equipment, and storage medium to solve the problem of time-consuming and high-error-rate interface information synchronization in related techniques.
[0005] In a first aspect, the present application provides an interface information synchronization method, which comprises:
[0006] obtaining at least one to-be-synchronized interface and interface development platform configuration information associated with the to-be-synchronized interface;
[0007] using a preset first information synchronization function, sending a first data acquisition request to the interface development platform based on the interface development platform configuration information, and obtaining interface identification information corresponding to the to-be-synchronized interface sent by the interface development platform in response to the first data acquisition request;
[0008] transmitting the interface identification information into a preset second information synchronization function;
[0009] using the second information synchronization function, sending a second data acquisition request to the interface development platform based on the interface identification information, and obtaining all data information corresponding to the to-be-synchronized interface sent by the interface development platform in response to the second data acquisition request, and generating an interface synchronization result based on the all data information.
[0010] In one embodiment, the method is applied to an automation platform, and after obtaining all the data information, the method further comprises:
[0011] Obtaining a preset target interface type matched with the interface synchronization platform; converting all data information of the interface to be synchronized to the preset target interface type according to different data information types and different transmission modes of the interface to be synchronized, and obtaining target interface information corresponding to the target interface type.
[0012] In one of the embodiments, the interface development platform configuration information includes a project name, and the sending of the first data acquisition request to the interface development platform based on the interface development platform configuration information by using the preset first information synchronization function further includes:
[0013] The project name is transmitted to the first information synchronization function, and the first data acquisition request is sent to the interface development platform based on the project name by using the first information synchronization function.
[0014] The interface identification information corresponding to the interface to be synchronized sent by the interface development platform in response to the first data acquisition request is obtained, including:
[0015] The interface tree information sent by the interface development platform in response to the first data acquisition request is obtained, wherein the interface tree information includes the interface identification information.
[0016] In one of the embodiments, the interface tree information sent by the interface development platform in response to the first data acquisition request is obtained, including:
[0017] The interface category information and the interface list information sent by the interface development platform in response to the first data acquisition request are obtained, and the interface list information includes the interface identification information.
[0018] The interface tree information is generated according to the interface category information and the interface list information.
[0019] The interface synchronization result is generated based on all the data information, including:
[0020] The interface synchronization result is generated according to all the data information and the interface tree information, and the interface synchronization result is stored in a preset database.
[0021] In one of the embodiments, the interface information synchronization method further includes:
[0022] If it is detected that the interface development platform configuration information is missing, error information is sent to the terminal device; if it is detected that the interface development platform configuration information exists, a visual result is generated according to the interface synchronization result, and the visual result is sent to the terminal device for display.
[0023] Further, the generation of the visual result according to the interface synchronization result includes:
[0024] obtaining a query instruction input by a user for a target interface to be tested, the target interface to be tested being an interface corresponding to the query instruction in the interfaces to be synchronized;
[0025] in response to the query instruction, obtaining all interface information of the target interface to be tested, generating a test case according to the all interface information of the target interface, and generating a visual result according to the interface synchronization result and the test interface.
[0026] In a second aspect, the present application further provides an interface information synchronization device. The device comprises:
[0027] a configuration information collection module configured to obtain at least one interface to be synchronized and interface development platform configuration information, the interface development platform configuration information being associated with the interfaces to be synchronized;
[0028] an interface information collection module configured to send a first data acquisition request to the interface development platform based on the interface development platform configuration information by using a preset first information synchronization function, and obtain interface identification information corresponding to the interfaces to be synchronized sent by the interface development platform in response to the first data acquisition request;
[0029] an information transmission module configured to transmit the interface identification information into a preset second information synchronization function;
[0030] an interface synchronization module configured to send a second data acquisition request to the interface development platform based on the interface identification information by using the second information synchronization function, obtain all data information corresponding to the interfaces to be synchronized sent by the interface development platform in response to the second data acquisition request, and generate an interface synchronization result based on the all data information.
[0031] Further, after the interface synchronization result is generated based on the all data information, the device further comprises a display module,
[0032] the display module is configured to send error information to a terminal device if it is detected that the interface development platform configuration information is missing, and generate a visual result according to the interface synchronization result and send the visual result to the terminal device for display if it is detected that the interface development platform configuration information exists.
[0033] In a third aspect, the present application further provides a computer device. The computer device comprises a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0034] obtaining at least one interface to be synchronized and interface development platform configuration information, the interface development platform configuration information being associated with the interfaces to be synchronized;
[0035] The first data acquisition request is sent to the interface development platform based on the interface development platform configuration information by using a preset first information synchronization function, and interface identification information corresponding to the interface to be synchronized is acquired, which is sent by the interface development platform in response to the first data acquisition request.
[0036] The interface identification information is transmitted into a preset second information synchronization function.
[0037] The second data acquisition request is sent to the interface development platform based on the interface identification information by using the second information synchronization function, and all data information corresponding to the interface to be synchronized is acquired, which is sent by the interface development platform in response to the second data acquisition request, and an interface synchronization result is generated based on the all data information.
[0038] In a fourth aspect, the present application also provides a computer readable storage medium. The computer readable storage medium has a computer program stored thereon, and the computer program is executed by a processor to implement the following steps:
[0039] At least one interface to be synchronized and interface development platform configuration information are acquired, and the interface development platform configuration information is associated with the interface to be synchronized;
[0040] The first data acquisition request is sent to the interface development platform based on the interface development platform configuration information by using a preset first information synchronization function, and interface identification information corresponding to the interface to be synchronized is acquired, which is sent by the interface development platform in response to the first data acquisition request;
[0041] The interface identification information is transmitted into a preset second information synchronization function.
[0042] The second data acquisition request is sent to the interface development platform based on the interface identification information by using the second information synchronization function, and all data information corresponding to the interface to be synchronized is acquired, which is sent by the interface development platform in response to the second data acquisition request, and an interface synchronization result is generated based on the all data information.
[0043] Compared with the related art, the interface information synchronization method provided by the embodiment of the present application synchronizes the interface data on the interface development platform to the automation platform through the preset information synchronization function, solves the problems of time-consuming and easy to make mistakes when manually entering a large amount of interface data, and realizes efficient and accurate entry of a large amount of interface data.
[0044] Details of one or more embodiments of the present application are presented in the following drawings and description to make other features, objects and advantages of the present application more clear and easy to understand. BRIEF DESCRIPTION OF DRAWINGS
[0045] The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application. In the drawings:
[0046] Figure 1 A flow chart of the interface information synchronization method in an embodiment;
[0047] Figure 2 A flow chart of the interface information synchronization method in a preferred embodiment;
[0048] Figure 3 A block diagram of the interface information synchronization device in an embodiment;
[0049] Figure 4 An internal structure diagram of the interface information synchronization device in an embodiment. DETAILED DESCRIPTION
[0050] In order to make the objects, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and should not be used to limit the present application.
[0051] In an embodiment, as shown in Figure 1 , a method for synchronizing interface information is provided, Figure 1 A flow chart of the interface information synchronization method according to an embodiment of the present application, as shown in Figure 1 , includes the following steps:
[0052] In step S110, at least one interface to be synchronized and interface development platform configuration information associated with the interface to be synchronized are obtained.
[0053] In actual applications, there are usually thousands of interfaces to be synchronized; the interface development platform configuration information includes interface development platform path, project unique identification information, project name and other information. The interface development platform configuration information is used to indicate the path, unique identification information and ID name of the project. One project includes many functional modules, and each functional module includes a large number of interfaces to be synchronized. A project usually includes several thousand interfaces.
[0054] In step S120, a first data acquisition request is sent to the interface development platform based on the interface development platform configuration information by using a preset first information synchronization function, and interface identification information corresponding to the interface to be synchronized sent by the interface development platform in response to the first data acquisition request is obtained.
[0055] Specifically, the project name in the interface development platform is input into a first information synchronization function, the first information synchronization function obtains the project name, and according to the project indicated by the project name, sends a request for obtaining first data to the interface development platform, and then obtains interface identification information sent by the interface development platform in response to the first data obtaining request, the interface identification information being used to indicate specific category information of an interface corresponding thereto.
[0056] In one embodiment, the interface development platform sends interface tree information in response to the first data obtaining request, the interface tree information including the interface identification information. Further, the interface tree information includes interface category information and interface list information, the interface list information including the interface identification information, the interface category information being mainly used to classify different functional modules in the project, and the interface list information being usually used to distinguish to which functional module the interface belongs, and the interface list information not including detailed information of the interface. The first information synchronization function is used to obtain the interface identification information from the interface development platform, and the first information synchronization function can be set by a user in advance, for example, the first information synchronization function can be a custom syncInterface function, and a code example of the syncInterface function is as follows:
[0057] def syncInterface(yapi_url, yapi_token, project_id);
[0058] In step S130, the interface identification information is input into a preset second information synchronization function.
[0059] The second information synchronization function can be set by a user in advance, for example, the second information synchronization function can be a custom syncInterfaceinfo function, and the syncInterfaceinfo function is used to receive all data information corresponding to the interface to be synchronized returned by the interface development platform, and a code example of the syncInterfaceinfo function is as follows:
[0060] def syncInterfaceinfo(yapi_url, yapi_token, interface_id);
[0061] In step S140, the second information synchronization function is used to send a second data obtaining request to the interface development platform based on the interface identification information, and all data information corresponding to the interface to be synchronized sent by the interface development platform in response to the second data obtaining request is obtained, and an interface synchronization result is generated based on the all data information.
[0062] Wherein, all the data information above includes request state, parameter type, request parameter, etc. The second information synchronization function is used to obtain detailed information of the interface from the interface development platform according to the interface identification information transmitted, and return all the data information of the interface to the first information synchronization function. After the first information synchronization function receives all the data information of the interface, it saves all the data information and the previously obtained interface tree information to the database.
[0063] Through the above steps S110 to S140, in the interface information synchronization method, first, the project to be synchronized and the interface development platform configuration information corresponding to the project are obtained through the interface development platform configuration information, then the interface identification information corresponding to the interface to be synchronized is obtained according to the interface development platform configuration information by using the first information synchronization function, the interface identification information is transmitted to the preset second information synchronization function, finally, the second information synchronization function is used to obtain all the data information corresponding to the interface to be synchronized according to the interface identification information, and the interface synchronization result is generated based on the all the data information. As can be seen, the technical solution in the present application can completely get rid of the method of synchronizing a large number of interfaces to be synchronized by using manual input in the traditional technology, and the method of obtaining interface identification information and then synchronizing the interface to be synchronized according to the interface identification information can accurately and efficiently complete the synchronization of a large number of interfaces. One interface identification information corresponds to one interface to be synchronized. The interface identification information not only indicates the interface to be synchronized it represents, but also indicates which functional module of the project the interface to be synchronized belongs to. The technical solution of the present application can not only accurately and quickly synchronize a large number of interfaces, but also can quickly call the interfaces when the related technical personnel tests the synchronized interfaces, because the different functional modules to which each interface belongs are determined.
[0064] In the present embodiment, after obtaining all the interface data information, the interface information synchronization method further comprises:
[0065] A preset target interface type is obtained, which matches the interface synchronization platform. According to the different types of all the data information of the interface to be synchronized and the different transmission modes, all the data information of the interface to be synchronized is converted to the preset target interface type, and target interface information corresponding to the target interface type is obtained.
[0066] Specifically, since the interface development platform and the automation platform have different requirements on the format type of the interface data information of the interface to be synchronized, format conversion is usually performed when synchronizing the interface to the automation platform, so as to obtain the interface data information meeting the requirements of the automation platform. For example, in the request parameter type in the interface data information, different interface type conversion processing is required according to different formats of the request parameter type and different types of request methods. The format of the request parameter type can be raw, form, json, etc., and the common request methods include GET, POST, etc.
[0067] Converting the format type of the obtained interface data information by the automation platform is conducive to the quick and convenient calling of the interface data information by the automation platform in subsequent operations, and better subsequent processing of the interface data information synchronized from the interface development platform.
[0068] In some embodiments, the interface information synchronization method further includes: passing a project name included in the interface development platform configuration information to the first information synchronization function, sending a first data acquisition request to the interface development platform based on the project name by using the first information synchronization function, and then obtaining interface tree information sent by the interface development platform in response to the first data acquisition request, wherein the interface tree information includes interface identification information.
[0069] Specifically, when the interface development platform returns the interface tree information in response to the first data acquisition request sent by the first information synchronization function, the interface development platform returns the interface tree information corresponding to the project name to the automation platform through a first open interface. The first open interface can be an open API interface provided by the interface development platform, which can be / api / interface / list_menu.
[0070] In some embodiments, the interface information synchronization method further includes: obtaining interface category information and interface list information sent by the interface development platform in response to the first data acquisition request; wherein the interface list information includes interface identification information; generating the interface tree information according to the interface category information and the interface list information; generating the interface synchronization result according to the interface data information and the interface tree information, and storing the interface synchronization result to a preset database.
[0071] Specifically, after the interface tree information is generated according to the interface category information and the interface list information, the second information synchronization function sends a second data acquisition request to the interface development platform according to the interface identification information in the interface tree information, and the interface development platform returns all data information through a second open interface in response to the second data acquisition request. The second open interface can be another open API interface provided by the interface development platform, which can be / api / interface / get. Then, the interface synchronization result is generated according to the all data information and the interface tree information, and the interface synchronization result includes all data information of each interface and information indicating the functional module to which each interface belongs.
[0072] As can be seen from the above, the interface tree information is first acquired from the interface development platform according to the first information synchronization function. The interface tree information does not contain detailed data information of the interface to be synchronized, but only indicates the functional module category in the project, the interface name under the functional module, the interface identification information, etc., which is used to distinguish which functional module the interface belongs to. Then, the all data information of the interface to be synchronized is acquired through the second information synchronization function according to the interface identification information in the interface tree information. As can be seen from the above, the tree-shaped interface tree information is first acquired, and then the detailed information of the interface to be synchronized is acquired, which helps to save the detailed data information of all interfaces in a classified and planned manner, and is beneficial to efficient completion of subsequent tasks such as calling and testing of the required interface. In addition, through the interface tree information, the all data information of the interface to be synchronized is acquired from the interface development platform, which is beneficial to efficient and accurate acquisition of a large amount of all data information of the interface to be synchronized.
[0073] In the interface information synchronization method in the present application, the interface tree information and the all data information of the interface are transmitted to the interface development platform through two different API interfaces provided by the interface development platform, which can efficiently and clearly complete the task of interface information synchronization. The two different API interfaces do not affect each other, and efficiently complete their respective data transmission tasks.
[0074] In some embodiments, the above interface information synchronization method further includes: if it is detected that the interface development platform configuration information is missing, sending error information to the terminal device; and if it is detected that the interface development platform configuration information exists, generating a visual result according to the interface synchronization result, and sending the visual result to the terminal device for display.
[0075] Specifically, if the interface development platform configuration information is detected to be missing, the terminal device can prompt the relevant technical personnel in the form of text content or sound alarm based on the error information sent by the automatic platform, so as to remind the relevant technical personnel to supplement the interface development platform configuration information in time. If it is detected that the interface development platform configuration information exists, the visual result of interface synchronization is displayed in the terminal device. The visual result includes all data information of all interfaces that are synchronized, such as encoding type, return data type, parameter data, and further includes data information corresponding to each parent node in the interface tree information.
[0076] If the interface development platform configuration information is missing, an alarm is given, and if the interface development platform configuration information exists, all data information of the synchronized interface is visualized and displayed. This step is beneficial to better adapt the interface information synchronization method of the present application to different environments in real application, can timely respond to different configuration information, and efficiently realize successful configuration of the interface development platform and display of detailed data information of the synchronized interface.
[0077] In some embodiments, the above interface information synchronization method further includes obtaining a query instruction input by a user for a target interface to be tested, the target interface to be tested being an interface corresponding to the query instruction in the interface to be synchronized; in response to the query instruction, obtaining all interface information of the target interface to be tested, generating a test case according to all interface information of the target interface, and generating a visual result according to the interface synchronization result and the test interface.
[0078] The query instruction for the target interface to be tested can be a query for the target interface by querying the interface name or the interface address, and after the query for the target interface is completed, the automatic platform automatically fills in all interface information of the target interface, such as the request method and the interface path of the target interface, directly generates a test case, and visualizes and displays the test case of the target interface. If a part of the interfaces in the interface development platform are adjusted and changed after the synchronization of the interface to be synchronized is completed, the data of the next interface to be synchronized will overwrite the synchronization data of the historical interface in the next synchronization of the interface to be synchronized, but the test case of the historical interface will not be overwritten, and the record of the test case will be saved at all times, facilitating subsequent viewing by the relevant technical personnel. Further, the design of the automatic platform in the present application can efficiently and intuitively complete the query and test of the target interface, greatly saving manpower and resources. Moreover, the saving of the test case facilitates the relevant technical personnel to view the test situation of the interface, combines the test situation of the current interface with the test situation of the historical interface for analysis, and is beneficial to further improvement of the interface.
[0079] The embodiment also provides a specific embodiment of an interface information synchronization method, as shown in the following table:Figure 2 as shown, Figure 2 is a flow chart of the interface information synchronization method in a preferred embodiment.
[0080] Firstly, the automation platform acquires a large number of interfaces to be synchronized and interface development platform configuration information, the interface development platform configuration information including interface development platform path, project unique identification information and project name. Then, the project name is transmitted into a first information synchronization function, wherein the first information synchronization function is used to send a first data acquisition request to the interface development platform. When the first information synchronization function acquires the project name, a first data acquisition request is sent to the interface development platform according to the project name. The interface development platform returns interface tree information to the first information synchronization function through a first open interface provided by the interface development platform according to the first data acquisition request, the interface tree information including interface category information and interface list information, wherein the interface list information includes interface identification information, which is used to indicate a specific interface in the large number of interfaces to be synchronized. Moreover, the interface tree information does not include detailed data information of the interfaces to be synchronized. The interface identification information is transmitted into a second information synchronization function, which sends a second data acquisition request to the interface development platform according to the interface identification information. The interface development platform returns all data information corresponding to the interface to be synchronized in response to the second data acquisition request to the second information synchronization function through a second open interface provided by the interface development platform according to the interface identification information. After the second information synchronization function acquires all data information of the interface to be synchronized, the all data information is returned to the first information synchronization function, and then the first information synchronization function saves the all data information of the interface to be synchronized and the interface tree information to a database together, and generates an interface synchronization result based on the all data information and the interface tree information. Finally, if the interface development platform configuration information is successful, a visual result is generated according to the interface synchronization result that has been synchronized, and the visual result is sent to a terminal device for display. After the interface information synchronization is completed, if the target interface needs to be tested, a query instruction input by a user is acquired, and then all interface information of the target interface to be tested is acquired in response to the query instruction. A test case is generated according to the all interface information of the target interface, and a visual result is generated according to a test result, which is displayed on the terminal device. The interface information synchronization method can completely synchronize a large number of interfaces through the automation platform and the interface development platform, and according to the technical features of synchronizing the interface tree information first and then synchronizing the all data information of the interface, it can be seen that the interface information synchronization method can clearly and efficiently synchronize a large number of interfaces and call the synchronized interface data according to needs in subsequent operations, saving a lot of manpower and resources and accurately completing the synchronization of a large number of interfaces.
[0081] It should be understood that although the steps in the flowcharts involved in the embodiments described above are shown in sequence according to the arrows, the steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, the execution of the steps is not strictly limited in sequence, and the steps can be executed in other sequences. Moreover, at least some of the steps in the flowcharts involved in the embodiments described above can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence of the steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least part of other steps or steps or stages in other steps.
[0082] Based on the same inventive concept, the embodiments of the present application also provide an interface information synchronization device for implementing the above-mentioned interface information synchronization method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more interface information synchronization device embodiments provided below can refer to the limitations of the interface information synchronization method described above, which will not be repeated here. As used below, the terms "module", "unit", "sub-unit" and the like can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, hardware or a combination of software and hardware is also possible and contemplated.
[0083] In one embodiment, an interface information synchronization device is provided, as shown in Figure 3 FIG. 1 is a structural block diagram of an interface information synchronization device, which includes a configuration information collection module 31, an interface information collection module 32, an information transmission module 33, an interface synchronization module 34 and a display module 35, wherein:
[0084] The configuration information collection module 31 is configured to obtain at least one to-be-synchronized interface and interface development platform configuration information, the interface development platform configuration information being associated with the to-be-synchronized interface.
[0085] The interface information collection module 32 is configured to send a first data acquisition request to an interface development platform based on the interface development platform configuration information by using a preset first information synchronization function, and obtain interface identification information corresponding to the to-be-synchronized interface sent by the interface development platform in response to the first data acquisition request.
[0086] The information transmission module 33 is configured to transmit the interface identification information into a preset second information synchronization function.
[0087] The interface synchronization module 34 is configured to send the second data acquisition request to the interface development platform based on the interface identification information by using the second information synchronization function, and acquire the complete data information corresponding to the interface to be synchronized sent by the interface development platform in response to the second data acquisition request, and generate an interface synchronization result based on the complete data information.
[0088] The display module 35 is configured to send error information to the terminal device if the interface development platform configuration information is detected to be missing, and generate a visual result based on the interface synchronization result and send the visual result to the terminal device for display if the interface development platform configuration information is detected to exist.
[0089] Specifically, the configuration information collection module 31 is configured to acquire at least one interface to be synchronized and interface development platform configuration information. In actual application, a large number of interfaces to be synchronized are usually acquired, and the interface development platform configuration information includes interface development platform path, project unique identification information, project name and other information. The interface development platform configuration information is associated with the interface to be synchronized. Then, the interface information collection module 32 calls the first information synchronization function, and the project name in the configuration information collected by the configuration information collection module 31 is transmitted into the first information synchronization function. The first information synchronization function sends a first data acquisition request to the interface development platform according to the project name. The interface development platform sends corresponding interface tree information to the interface information collection module 32 through the first open interface, and the interface tree information includes interface identification information. Then, the information transmission module 33 is configured to transmit the interface identification information into a preset second information synchronization function. The information transmission module 33 is connected with the interface synchronization module 34. The interface synchronization module 34 sends a second data acquisition request to the interface development platform according to the interface identification information by using the second information synchronization function. The interface development platform sends corresponding complete data information to the interface synchronization module 34 through the second open interface. The interface synchronization module 34 generates an interface synchronization result according to the complete data information. Then, if the interface development platform configuration information is detected to be missing, an error prompt can be given in the display module 35, and a voice prompt can be given. If the interface development platform configuration information is detected to exist, a visual result is generated based on the interface synchronization result, and the visual result is displayed in the display module 35.
[0090] By using the above interface information synchronization device, the synchronization of a large number of interfaces to be synchronized can be quickly and accurately completed. Moreover, the interface data information and the tree-shaped interface tree information after synchronization are saved together, which is beneficial to the quick and accurate calling and testing of target interfaces by technicians.
[0091] In one embodiment, a computer device can be provided, which can be a terminal. The internal structure diagram of the computer device can be as shown inFigure 4 The computer device shown in the figure includes a processor, a memory, a communication interface, a display screen and an input device connected by a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium to run. The communication interface of the computer device is used to communicate with external terminals in a wired or wireless manner. The wireless manner can be achieved through WIFI, mobile cellular network, NFC (Near Field Communication) or other technologies. The computer program is executed by the processor to implement an interface information synchronization method. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer overlaid on the display screen, or a key, trackball or touchpad arranged on the shell of the computer device, or an external keyboard, touchpad or mouse, etc.
[0092] Those skilled in the art can understand that, Figure 4 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the segmented data statistical device to which the scheme of the present application is applied. The specific segmented data statistical device can include more or fewer components than those shown in the figure, or combine certain components, or have a different component arrangement.
[0093] It should be understood that, although the steps in the flowcharts involved in the above-described embodiments are shown in sequence according to the arrows, these steps are not necessarily executed in sequence according to the arrows. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other sequences. Moreover, at least part of the steps in the flowcharts involved in the above-described embodiments can include multiple steps or stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence of these steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least part of other steps or steps or stages in other steps.
[0094] Those skilled in the art should understand that the technical features of the above-described embodiments can be combined in any way. In order to make the description concise, all possible combinations of the technical features in the above-described embodiments are not described, but as long as the combination of the technical features does not exist contradictory, it should be considered as the scope of the present disclosure.
[0095] The above-described embodiments are merely illustrative of several embodiments of the present application, which are described in more detail and in a specific and detailed manner, but should not be construed as limiting the scope of the patent. It should be noted that for those skilled in the art, several modifications and improvements can be made without departing from the concept of the present application, and these are all within the scope of the present application. Therefore, the scope of protection of the patent of the present application should be subject to the appended claims.
Claims
1. A method for synchronizing interface information, characterized in that, The method includes: Obtain at least one interface to be synchronized and the interface development platform configuration information, wherein the interface development platform configuration information is associated with the interface to be synchronized; The interface development platform configuration information includes the project name; Using a preset first information synchronization function, a first data acquisition request is sent to the interface development platform based on the interface development platform configuration information, including: passing the project name as a parameter to the first information synchronization function, and using the first information synchronization function to send the first data acquisition request to the interface development platform based on the project name; Obtaining the interface identifier information corresponding to the interface to be synchronized, sent by the interface development platform in response to the first data acquisition request, includes: obtaining the interface tree information sent by the interface development platform in response to the first data acquisition request; the interface tree information includes interface category information and interface list information; wherein, the interface list information includes interface identifier information; The interface identification information is passed into a preset second information synchronization function; Using the second information synchronization function, a second data acquisition request is sent to the interface development platform based on the interface identification information, and all data information corresponding to the interface to be synchronized is acquired by the interface development platform in response to the second data acquisition request. An interface synchronization result is generated based on the all data information.
2. The interface information synchronization method according to claim 1, characterized in that, When applied to an automation platform, after acquiring all the data information, the method further includes: Obtain a preset target interface type, which is matched with the interface synchronization platform; Based on the different data information types and transmission methods of the interface to be synchronized, all data information of the interface to be synchronized is converted to the preset target interface type to obtain target interface information corresponding to the target interface type.
3. The interface information synchronization method according to claim 1, characterized in that, The interface synchronization result generated based on all the data information includes: The interface synchronization result is generated based on all the data information and the interface tree information, and the interface synchronization result is stored in a preset database.
4. The interface information synchronization method according to any one of claims 1 to 3, characterized in that, The method further includes: If the interface development platform configuration information is found to be missing, an error message is sent to the terminal device; if the interface development platform configuration information is found to exist, a visualization result is generated based on the interface synchronization result, and the visualization result is sent to the terminal device for display.
5. The interface information synchronization method according to claim 4, characterized in that, The step of generating visualization results based on the interface synchronization results includes: Obtain the query command input by the user for the target interface to be tested, wherein the target interface to be tested is the interface in the interface to be synchronized that corresponds to the query command; In response to the query command, all interface information of the target interface to be tested is obtained, test cases are generated based on all interface information of the target interface to be tested, and the visualization results are generated based on the interface synchronization results and the target interface to be tested.
6. An interface information synchronization device, characterized in that, The device includes: A configuration information collection module is used to obtain at least one interface to be synchronized and interface development platform configuration information, wherein the interface development platform configuration information is associated with the interface to be synchronized; the interface development platform configuration information includes the project name. An interface information collection module is used to send a first data acquisition request to the interface development platform based on the interface development platform configuration information using a preset first information synchronization function, including: passing the project name as a parameter to the first information synchronization function, and using the first information synchronization function to send the first data acquisition request to the interface development platform based on the project name; The interface information collection module is further configured to obtain interface identification information corresponding to the interface to be synchronized, sent by the interface development platform in response to the first data acquisition request, including: obtaining interface tree information sent by the interface development platform in response to the first data acquisition request; the interface tree information includes interface category information and interface list information; wherein, the interface list information includes interface identification information; The information input module is used to input the interface identification information into a preset second information synchronization function; The interface synchronization module is used to send a second data acquisition request to the interface development platform based on the interface identification information using the second information synchronization function, and to acquire all data information corresponding to the interface to be synchronized sent by the interface development platform in response to the second data acquisition request, and to generate an interface synchronization result based on the all data information.
7. The interface information synchronization device according to claim 6, characterized in that, The device also includes a display module. The display module is used to send an error message to the terminal device if it detects that the interface development platform configuration information is missing; if the display module detects that the interface development platform configuration information exists, it generates a visualization result based on the interface synchronization result and sends the visualization result to the terminal device for display.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Protocol interface testing method and device, computer equipment and storage medium thereof
CN110287109A
Interface document synchronization method and device, electronic equipment and storage medium
CN114201213A