CN117763026A - Interface docking method and device, electronic equipment and storage medium - Google Patents

Interface docking method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN117763026A
CN117763026A CN202311776309.5A CN202311776309A CN117763026A CN 117763026 A CN117763026 A CN 117763026A CN 202311776309 A CN202311776309 A CN 202311776309A CN 117763026 A CN117763026 A CN 117763026A
Authority
CN
China
Prior art keywords
interface
update
database
calling
configuration file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311776309.5A
Other languages
Chinese (zh)
Inventor
应泽霖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202311776309.5A priority Critical patent/CN117763026A/en
Publication of CN117763026A publication Critical patent/CN117763026A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses an interface docking method and device, electronic equipment and storage medium, and relates to the field of financial science and technology or other related fields, wherein the method comprises the following steps: reading the modified target interface document to obtain N interface modification fields, wherein the target interface document is used for recording interfaces and interface use modes which are called by a target financial system when providing target service, and N is a positive integer; modifying an interface configuration file, an interface calling program and an interface database corresponding to the target interface document based on the N interface modification fields to obtain an update configuration file, an update calling program and an update interface database; and calling the interface object recorded in the target interface document based on the update configuration file, the update calling program and the update interface database to complete interface docking. The invention solves the technical problems of complicated process and low efficiency of the re-docking process of the interface without automatic docking process when the interface document is modified in the related technology.

Description

Interface docking method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of financial science and technology or other related fields, and in particular, to an interface docking method and apparatus, an electronic device, and a storage medium.
Background
In the related art, the interface docking mode when a financial institution operates a target service is mostly a manual docking mode, an interface document is provided by a service provider, a service consumer performs field comparison according to the interface document, an upstream developer and a downstream developer are often required to communicate with service personnel again for fuzzy fields which cannot be clearly understood in the interface document, if a new docking requirement exists for the interface document which is already docked, the interface document is required to be manually modified, a program instance is regenerated again, and comprehensive docking is performed again after conversion.
In view of the above problems, no effective solution has been proposed at present.
Disclosure of Invention
The embodiment of the invention provides an interface docking method and device, electronic equipment and storage medium, which at least solve the technical problems of complex process and low efficiency of re-docking the interface without an automatic docking process when an interface document is modified in the related technology.
According to an aspect of an embodiment of the present invention, there is provided an interface interfacing method, including: reading the modified target interface document to obtain N interface modification fields, wherein the target interface document is used for recording interfaces and interface use modes which are called by a target financial system when providing target service, and N is a positive integer; modifying an interface configuration file, an interface calling program and an interface database corresponding to the target interface document based on the N interface modification fields to obtain an update configuration file, an update calling program and an update interface database; and calling the interface object recorded in the target interface document based on the update configuration file, the update calling program and the update interface database to complete interface docking.
Optionally, modifying the interface configuration file, the interface calling program and the interface database corresponding to the target interface document based on the N interface modification fields to obtain an update configuration file, an update calling program and an update interface database, which includes: acquiring a document identification of the target interface document; positioning the interface configuration file, the interface calling program and the interface database corresponding to the target interface document based on the document identification; modifying a configuration item related to the current modification in the interface configuration file based on the N interface modification fields to obtain the update configuration file, wherein the configuration item is used for describing a mapping relation between the interface modification fields and entity type fields in the interface calling program; and modifying the interface calling program and the interface database based on the N interface modification fields and the update configuration file to obtain the update calling program and the update interface database.
Optionally, the step of modifying the interface calling program and the interface database based on the N interface modification fields and the update configuration file to obtain the update calling program and the update interface database includes: converting the N interface modification fields into N entity class fields through a preset field reflection mechanism, wherein the entity class fields are used for describing object attributes of interface objects in the interface calling program; injecting N entity class fields into the appointed position in the interface calling program to obtain the updating calling program; and executing migration operation on the interface database based on the update configuration file and the update calling program to obtain the update interface database.
Optionally, the step of performing a migration operation on the interface database based on the update configuration file and the update calling program to obtain the update interface database includes: analyzing the update configuration file and the change information in the update calling program through a preset database analysis tool to obtain an analysis result, wherein the analysis result is used for describing the change content related to the interface database in the current modification; creating a database migration script based on the analysis result, wherein the database migration script writes all the change contents into executable script sentences by using a preset grammar specification; and executing the database migration script on the interface database to obtain the updated interface database.
Optionally, before invoking the interface object recorded in the target interface document based on the update configuration file, the update caller, and the update interface database, the method further includes: and carrying out calling test on the updating calling program and the updating interface database according to a preset test strategy to obtain a test result, wherein the preset test strategy comprises at least one of the following steps: unit test strategy, integrated test strategy and system test strategy; under the condition that the test result indicates that the calling process has no error, calling the interface object recorded in the target interface document based on the updating configuration file, the updating calling program and the updating interface database; or under the condition that the test result indicates that the calling process has error reporting, acquiring an error reporting log, and correcting error calling information according to the error position indicated by the error reporting log.
Optionally, the step of calling the update calling program and the update interface database according to a preset test policy to obtain a test result includes: writing a unit test case based on the unit test strategy, wherein the unit test case at least comprises: first input data and first desired output data; copying the update configuration file, the update calling program and the update interface database, and packaging the copied update configuration file, update calling program and update interface database into a test mirror image; inputting the unit test case into the test mirror image to obtain first output data, wherein the test mirror image is used for calling an interface object recorded in the target interface document based on the first input data and returning the first output data; the test result is generated based on the first expected output data and the first output data.
Optionally, the step of calling the update calling program and the update interface database according to a preset test policy to obtain a test result further includes: defining an integrated test scene and an integrated test case based on the integrated test policy, wherein the integrated test scene comprises R integrated points, each integrated point is used for describing a dependency relationship between database objects in the update interface database, and the integrated test case at least comprises: the second input data and the second expected output data, R is a positive integer; copying the update configuration file, the update calling program and the update interface database, and packaging the copied update configuration file, update calling program and update interface database into a test mirror image; inputting the integrated test scene and the integrated test case into the test mirror image to obtain second output data, wherein the test mirror image is used for calling an interface object recorded in the target interface document based on the second input data and returning the second output data; the test result is generated based on the second desired output data and the second output data.
According to another aspect of the embodiment of the present invention, there is also provided an interface docking apparatus, including: the reading unit is used for reading the modified target interface document to obtain N interface modification fields, wherein the target interface document is used for recording interfaces and interface use modes which are called by a target financial system when providing target service, and N is a positive integer; the modification unit is used for modifying the interface configuration file, the interface calling program and the interface database corresponding to the target interface document based on the N interface modification fields to obtain an update configuration file, an update calling program and an update interface database; and the calling unit is used for calling the interface object recorded in the target interface document based on the updating configuration file, the updating calling program and the updating interface database to finish interface butt joint.
Optionally, the modification unit includes: the acquisition module is used for acquiring the document identification of the target interface document; the positioning module is used for positioning the interface configuration file, the interface calling program and the interface database corresponding to the target interface document based on the document identification; the first modification module is used for modifying the configuration items related to the current modification in the interface configuration file based on the N interface modification fields to obtain the updated configuration file, wherein the configuration items are used for describing the mapping relation between the interface modification fields and entity type fields in the interface calling program; and the second modification module is used for modifying the interface calling program and the interface database based on the N interface modification fields and the update configuration file to obtain the update calling program and the update interface database.
Optionally, the second modification module includes: the conversion sub-module is used for converting the N interface modification fields into N entity class fields through a preset field reflection mechanism, wherein the entity class fields are used for describing object attributes of interface objects in the interface calling program; the injection submodule is used for injecting N entity class fields to the appointed position in the interface calling program to obtain the updating calling program; and the first execution sub-module is used for executing migration operation on the interface database based on the update configuration file and the update calling program to obtain the update interface database.
Optionally, the second modification module further includes: the analysis sub-module is used for analyzing the update configuration file and the change information in the update calling program through a preset database analysis tool to obtain an analysis result, wherein the analysis result is used for describing the change content related to the interface database in the current modification; the creation sub-module is used for creating a database migration script based on the analysis result, wherein the database migration script writes all the change contents into executable script sentences by using a preset grammar specification; and the second execution sub-module is used for executing the database migration script on the interface database to obtain the updated interface database.
Optionally, the interface docking device further comprises: the test module is used for calling and testing the update calling program and the update interface database according to a preset test strategy to obtain a test result, wherein the preset test strategy comprises at least one of the following steps: unit test strategy, integrated test strategy and system test strategy; the calling module is used for calling the interface object recorded in the target interface document based on the updating configuration file, the updating calling program and the updating interface database under the condition that the test result indicates that the calling process has no error; or the correction module is used for acquiring an error report log and correcting error call information according to the error position indicated by the error report log under the condition that the test result indicates that the call process has error report.
Optionally, the test module includes: and a writing sub-module, configured to write a unit test case based on the unit test policy, where the unit test case at least includes: first input data and first desired output data; the first copying sub-module is used for copying the updating configuration file, the updating calling program and the updating interface database and packaging the copied updating configuration file, updating calling program and updating interface database into a test mirror image; the first input sub-module is used for inputting the unit test cases into the test mirror image to obtain first output data, wherein the test mirror image is used for calling an interface object recorded in the target interface document based on the first input data and returning the first output data; and the first generation sub-module is used for generating the test result based on the first expected output data and the first output data.
Optionally, the test module further comprises: the defining sub-module is configured to define an integrated test scenario and an integrated test case based on the integrated test policy, where the integrated test scenario includes R integration points, each of the integration points is configured to describe a dependency relationship between database objects in the update interface database, and the integrated test case at least includes: the second input data and the second expected output data, R is a positive integer; the second replication sub-module is used for replicating the update configuration file, the update calling program and the update interface database and packaging the replicated update configuration file, the update calling program and the update interface database into a test mirror image; the second input sub-module is used for inputting the integrated test scene and the integrated test case into the test mirror image to obtain second output data, wherein the test mirror image is used for calling an interface object recorded in the target interface document based on the second input data and returning the second output data; and a second generation sub-module for generating the test result based on the second expected output data and the second output data.
According to another aspect of the embodiment of the present invention, there is further provided a computer readable storage medium, where the computer readable storage medium includes a stored computer program, and when the computer program runs, controls a device in which the computer readable storage medium is located to execute the interface docking method described in any one of the foregoing.
According to another aspect of the embodiments of the present invention, there is also provided an electronic device including one or more processors and a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement any of the interface interfacing methods described above.
The invention provides an interface docking method, which comprises the steps of firstly reading a modified target interface document to obtain N interface modification fields, wherein the target interface document is used for recording interfaces and interface use modes which are called by a target financial system when a target service is provided, N is a positive integer, modifying an interface configuration file, an interface calling program and an interface database which correspond to the target interface document based on the N interface modification fields to obtain an update configuration file, an update calling program and an update interface database, and finally calling interface objects recorded in the target interface document based on the update configuration file, the update calling program and the update interface database to complete interface docking.
According to the invention, all interface modification fields are obtained by reading the modified target interface document, modification details of the calling interface and the interface using mode are obtained by the target financial system in the process of providing the target service, the interface configuration file, the interface calling program and the interface database corresponding to the target interface document are directly modified based on all the interface modification fields, the updating configuration file, the updating calling program and the updating interface database are obtained, the updating configuration file, the updating calling program and the updating interface database are used for implementing interface calling, and the interface modification fields corresponding to all calling interfaces and interface using modes needing to be modified are obtained by reading the target interface document.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiments of the invention and together with the description serve to explain the invention and do not constitute a limitation on the invention. In the drawings:
FIG. 1 is a flow chart of an alternative interface docking method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of an alternative interface intelligent docking flow mode in accordance with an embodiment of the present invention;
FIG. 3 is a flow chart of an alternative method of interface intelligent docking based on a center payment center, in accordance with an embodiment of the present invention;
FIG. 4 is a schematic diagram of an alternative interface docking apparatus, according to an embodiment of the present invention;
fig. 5 is a block diagram of a hardware structure of an electronic device (or mobile device) for an interface docking method according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be noted that, the interface docking method and the device thereof in the present invention may be used in the case of docking a docked interface in the financial and technological field when the interface configuration is changed, and may also be used in any field other than the financial and technological field when docking a docked interface is changed when the interface configuration is changed.
It should be noted that, the relevant information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, presented data, etc.) related to the present invention are information and data authorized by the user or fully authorized by each party, and the collection, use and processing of the relevant data need to comply with laws and regulations and standards of the relevant area, and a corresponding operation entry is provided for the user to select authorization or rejection. For example, an interface is provided between the system and the relevant user or institution, before acquiring the relevant information, the system needs to send an acquisition request to the user or institution through the interface, and acquire the relevant information after receiving the consent information fed back by the user or institution.
The embodiments described below can be applied to various systems/applications/devices that need to perform docking modification on a docked interface when the configuration of the interface is changed, and can implement interface calling directly on the interface related to the modification, so as to complete interface docking. The invention obtains the interface modification field corresponding to all calling interfaces needing to be modified and the interface using mode by reading the target interface document, directly changes the configuration items in the interface configuration file, the program instance in the interface calling program and the structure information in the interface database, and applies the updated configuration file, the updated calling program and the updated interface database after the change to implement the interface calling related to the modification.
The present invention will be described in detail with reference to the following examples.
Example 1
In accordance with an embodiment of the present invention, an embodiment of an interface interfacing method is provided, it being noted that the steps shown in the flowchart of the figures may be performed in a computer system, such as a set of computer executable instructions, and, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in an order other than that shown or described herein.
FIG. 1 is a flow chart of an alternative interface docking method according to an embodiment of the present invention, as shown in FIG. 1, comprising the steps of:
step S101, reading a modified target interface document to obtain N interface modification fields, wherein the target interface document is used for recording interfaces and interface use modes which are called by a target financial system when providing target services, and N is a positive integer.
Step S102, modifying the interface configuration file, the interface calling program and the interface database corresponding to the target interface document based on the N interface modification fields to obtain an update configuration file, an update calling program and an update interface database.
Step S103, based on the update configuration file, the update calling program and the update interface database, calling the interface object recorded in the target interface document, and completing interface docking.
Through the steps, the modified target interface document can be read first to obtain N interface modification fields, wherein the target interface document is used for recording interfaces and interface use modes which are called by a target financial system when providing target services, N is a positive integer, then the interface configuration file, the interface calling program and the interface database corresponding to the target interface document are modified based on the N interface modification fields to obtain an update configuration file, an update calling program and an update interface database, and finally the interface objects recorded in the target interface document are called based on the update configuration file, the update calling program and the update interface database to complete interface docking.
In the embodiment of the invention, all interface modification fields are obtained by reading the modified target interface document, the modification details of the calling interface and the interface using mode in the process of providing the target service are obtained by the target financial system, the interface configuration file, the interface calling program and the interface database corresponding to the target interface document are directly modified based on all the interface modification fields, the updated configuration file, the updated calling program and the updated interface database are obtained, and the interface calling is implemented by using the updated configuration file, the updated calling program and the updated interface database.
Embodiments of the present invention will be described in detail with reference to the following steps.
The implementation subject of the embodiment of the invention can be a financial information exchange system, and is combined with a version control system, a scripting language automation tool, a database management system and a test verification tool to track and record each change of a target interface document, so that an executable script is edited to modify interface configuration files and interface calling programs in batches and database table structures in an interface database and fields in the database table.
Step S101, reading a modified target interface document to obtain N interface modification fields, wherein the target interface document is used for recording interfaces and interface use modes which are called by a target financial system when providing target services, and N is a positive integer.
It should be noted that, the content recorded in the target interface document includes, but is not limited to: interface name, interface role description, interface request mode (e.g., HTTP request mode GET, POST, PUT or request protocol HTTP, HTTPs, etc.), interface request parameters (including information about request parameter name, type, whether to fill in, default value, description, etc.), return results (including information about format, data type, description, etc. of interface return results), error code definition (including error code and corresponding error information that the interface may return), interface instance (referring to interface call instance, so that service consumer can quickly learn the use mode and parameter requirements of the interface), version control (to record version number and change history of the interface, so as to track evolution and change of the interface).
Step S102, modifying the interface configuration file, the interface calling program and the interface database corresponding to the target interface document based on the N interface modification fields to obtain an update configuration file, an update calling program and an update interface database.
Optionally, step S102 includes: acquiring a document identification of a target interface document; locating an interface configuration file, an interface calling program and an interface database corresponding to the target interface document based on the document identification; modifying a configuration item related to the modification in the interface configuration file based on the N interface modification fields to obtain an updated configuration file, wherein the configuration item is used for describing the mapping relation between the interface modification fields and entity type fields in the interface calling program; and modifying the interface calling program and the interface database based on the N interface modification fields and the update configuration file to obtain the update calling program and the update interface database.
It should be noted that, when locating the interface configuration file, the interface calling program and the interface database corresponding to the target interface document based on the document identification, the method may include: searching configuration files (such as properties, yaml, etc.) of the system according to interface names or other identification information provided in the interface document; determining the position of a calling program according to information such as interface names, request modes, paths and the like provided in an interface document; and positioning to the corresponding database table structure according to the table names, field names and other information in the interface document, and further positioning to the position of the interface database. In the embodiment of the invention, configuration items related to the interface, such as database connection information, third-party service configuration and the like, can be generally found in the configuration file, and a code file where a calling program is located can be found according to example codes or calling description in the interface file, and corresponding debugging or modification is performed.
Optionally, modifying the interface calling program and the interface database based on the N interface modification fields and the update configuration file to obtain the update calling program and the update interface database, including: converting the N interface modification fields into N entity class fields through a preset field reflection mechanism, wherein the entity class fields are used for describing object attributes of interface objects in an interface calling program; injecting N entity class fields into the appointed position in the interface calling program to obtain an updated calling program; and executing migration operation on the interface database based on the update configuration file and the update calling program to obtain an update interface database.
It should be noted that, the preset field reflection mechanism refers to rules and parameters defined in the interface configuration file, and dynamically loads and dynamically analyzes the rules and parameters when the program runs through the reflection mechanism, so as to implement flexible configuration and adjustment of the program behavior. Common configuration file formats, such as XML, JSON, YAML, typically provide a structured way to define configuration information, including various parameters, switches, mapping rules, etc., for controlling the behavior and characteristics of the program.
The embodiment of the invention can be realized through the built-in reflection method of the interface configuration file: the configuration information is dynamically loaded when the program runs, namely, the configuration file is read when the program is started, and the configuration information is loaded into a corresponding object or data structure through a reflection mechanism, so that the behavior of the program can be dynamically changed according to the need without modifying a source code; dynamically adjusting parameter settings when a program runs, namely defining various parameters of a system in a configuration file, such as database connection information, thread pool size, log level and the like, and reading the parameters when the program runs by a reflection mechanism, and correspondingly adjusting and optimizing according to requirements; mapping rules are implemented at program run-time: some mapping rules, such as field mapping, routing rules and the like, can be defined in the configuration file, and the program can dynamically perform operations of data conversion, routing and the like according to the rules through a reflection mechanism so as to adapt to different service requirements.
Optionally, the step of performing a migration operation on the interface database based on the update configuration file and the update caller to obtain an updated interface database includes: analyzing the update configuration file and the change information in the update calling program through a preset database analysis tool to obtain an analysis result, wherein the analysis result is used for describing the change content related to the interface database in the modification; creating a database migration script based on the analysis result, wherein the database migration script writes all the changed contents into executable script sentences by using a preset grammar specification; and executing the database migration script on the interface database to obtain the updated interface database.
Embodiments of the present invention provide several alternative database analysis tools: orac le SQL Deve loper, which is suitable for the oracle database, provides functions of database development, management, debugging and the like, and can analyze change information by comparing database objects and data differences; SQL Server Management Stud io, adapted to Microsoft SQL Server databases, provides a database management and query tool that can analyze change information by comparing database structures and data differences.
In the embodiment of the invention, when the database migration script is created based on the analysis result, the database migration script can be realized by using a database script language. For the newly added table or field, writing SQL sentences for creating the table or adding the field; for the modified table structure, writing SQL sentences for modifying the table structure; for deleted fields or tables, SQL statements are written that delete the fields or tables.
In addition, the written database migration script can be subjected to version control so as to track the change history of the database structure; after confirming that the script has no problem, the script is deployed into a database, and the script is executed to update the database structure according to the change content.
Step S103, based on the update configuration file, the update calling program and the update interface database, calling the interface object recorded in the target interface document, and completing interface docking.
Optionally, before performing step S103, the method further includes: and calling and testing the updating calling program and the updating interface database according to a preset testing strategy to obtain a testing result, wherein the preset testing strategy comprises at least one of the following steps: unit test strategy, integrated test strategy and system test strategy; under the condition that the test result indicates that the calling process has no error reporting, calling the interface object recorded in the target interface document based on the updating configuration file, the updating calling program and the updating interface database; or under the condition that the test result indicates that the calling process has error reporting, acquiring an error reporting log, and correcting error calling information according to the error position indicated by the error reporting log.
It should be noted that, the unit test is a test for a single function, a stored procedure or a query in a database, in which test cases for each database object may be written to verify whether the function thereof works as intended, and these test cases are generally written using a database test framework and may be executed by simulation data or a data set provided in advance.
It should be noted that the integration test is to test interactions and collaboration among a plurality of database objects, ensure that different parts in the database can work correctly in cooperation, and integrate with other components (such as application programs, APIs, etc.), and simulate actual usage scenarios in the integration test, and check whether the database as a whole meets expected functional and performance requirements.
It should be noted that the system test is to comprehensively test the functions, performances and reliability of the whole system (including databases, application programs and other related components), and aim to verify whether the system meets the user requirements by simulating the actual use scenario and load, and can normally operate under various conditions.
Optionally, the step of calling and testing the update calling program and the update interface database according to a preset test strategy to obtain a test result includes: writing unit test cases based on a unit test strategy, wherein the unit test cases at least comprise: first input data and first desired output data; copying the update configuration file, the update calling program and the update interface database, and packaging the copied update configuration file, update calling program and update interface database into a test mirror image; inputting the unit test cases into a test mirror image to obtain first output data, wherein the test mirror image is used for calling an interface object recorded in a target interface document based on the first input data and returning the first output data; a test result is generated based on the first expected output data and the first output data.
Optionally, the step of calling the update calling program and the update interface database according to a preset test strategy to obtain a test result further includes: defining an integrated test scene and an integrated test case based on an integrated test strategy, wherein the integrated test scene comprises R integrated points, each integrated point is used for describing the dependency relationship between database objects in an updated interface database, and the integrated test case at least comprises: the second input data and the second expected output data, R is a positive integer; copying the update configuration file, the update calling program and the update interface database, and packaging the copied update configuration file, update calling program and update interface database into a test mirror image; inputting the integrated test scene and the integrated test case into a test mirror image to obtain second output data, wherein the test mirror image is used for calling an interface object recorded in a target interface document based on the second input data and returning the second output data; a test result is generated based on the second desired output data and the second output data.
According to the embodiment of the invention, through an automatic method of intelligent interface docking, an automatic method is used for replacing a manual communication process in the interface docking process, so that the time-consuming problem of manual modification of an interface document in the interface docking process and the problems of accuracy and integrity of field addition, type, length and infusion necessity are solved.
The embodiment of the invention also uses an automatic docking method to change the configuration file, the program and the database, solves the problems of accuracy and completeness of standardized, lasting and formatted configuration files in the interface docking process, and also solves the problems of accuracy and completeness of database detail files, sql statements, mapper examples and dd statements in the interface docking process.
The invention is described below in connection with another specific embodiment.
According to the embodiment of the invention, when the interface docking requirement is changed through the field comparison method, the configuration file, the program and the database are modified integrally, so that the mechanical repeated work of modifying the file, the program, the configuration file and the database manually through manual communication is avoided.
Fig. 2 is a schematic diagram of an optional interface intelligent docking flow mode according to an embodiment of the present invention, as shown in fig. 2, after an interface caller puts forward a new requirement, a financial information exchange system adds the new requirement to a target interface document, obtains a modified target interface document, and then performs instance standardization, instance persistence and instance formatting based on a new field in the target interface document, so as to implement a call platform service after the new requirement, where instance standardization refers to converting the new field into an instantiated field (i.e., an entity class field) in an interface caller, actual persistence refers to converting the new field into an instantiated field in an interface database, and instance formatting refers to converting the new field into an instantiated field in a call platform service.
Fig. 3 is a flowchart of an alternative intelligent interface docking method based on a central payment center according to an embodiment of the present invention, as shown in fig. 3, the method includes the steps of:
step S301, receiving a new requirement provided by a payment service caller, where the new requirement includes: interface document identification, field name, field length, field type, and field business meaning.
Step S302, positioning a configuration file, a calling program and a database corresponding to a target interface document based on the interface document identification;
step S303, format adjustment is carried out on the newly added requirement according to the standard format of the configuration file, and the newly added requirement after format adjustment is added to the configuration file to obtain an updated configuration file.
Step S304, converting the newly added requirement into an entity class field based on a built-in reflection method of the configuration file, and injecting the entity class field into a designated position of the calling program to obtain the updated calling program.
Step S305, generating a database migration script based on the update calling program, and inputting the database migration script into the database.
And step S306, running a database migration script, and modifying the database instance to obtain an updated database.
Step S307, recall the interface related to the newly added demand in the target interface document based on the update configuration file, the update calling program and the update database, and complete the intelligent interface docking.
According to the embodiment of the invention, through an automatic method of intelligent interface docking, an automatic method is used for replacing a manual communication process in the interface docking process, so that the time-consuming problem of manual modification of an interface document in the interface docking process and the problems of accuracy and integrity of field addition, type, length and infusion necessity are solved.
The embodiment of the invention also uses an automatic docking method to change the configuration file, the program and the database, solves the problems of accuracy and completeness of standardized, lasting and formatted configuration files in the interface docking process, and also solves the problems of accuracy and completeness of database detail files, sql statements, mapper examples and dd statements in the interface docking process.
The invention is described below in connection with alternative embodiments.
Example two
An interface docking apparatus provided in this embodiment includes a plurality of implementation units, each implementation unit corresponding to each implementation step in the first embodiment.
Fig. 4 is a schematic diagram of an alternative interface docking apparatus, as shown in fig. 4, according to an embodiment of the present invention, which may include: the reading unit 41, the modifying unit 42, and the calling unit 43.
The reading unit 41 is configured to read the modified target interface document to obtain N interface modification fields, where the target interface document is used to record an interface and an interface usage mode that are called by the target financial system when the target financial system provides the target service, and N is a positive integer.
And the modification unit 42 is configured to modify the interface configuration file, the interface calling program and the interface database corresponding to the target interface document based on the N interface modification fields, so as to obtain an update configuration file, an update calling program and an update interface database.
And a calling unit 43, configured to call the interface object recorded in the target interface document based on the update configuration file, the update calling program and the update interface database, and complete interface docking.
In the above interface docking device, the modified target interface document may be read by the reading unit 41 to obtain N interface modification fields, where the target interface document is used to record an interface and an interface usage mode that are called by the target financial system when providing the target service, N is a positive integer, then the modification unit 42 modifies the interface configuration file, the interface calling program and the interface database corresponding to the target interface document based on the N interface modification fields to obtain an update configuration file, an update calling program and an update interface database, and finally the calling unit 43 calls the interface object recorded in the target interface document based on the update configuration file, the update calling program and the update interface database to complete interface docking.
In the embodiment of the invention, all interface modification fields are obtained by reading the modified target interface document, the modification details of the called interfaces and the interface using modes in the process of providing the target service are obtained by the target financial system, the interface configuration files, the interface calling programs and the interface databases corresponding to the target interface document are directly modified based on all the interface modification fields, the updated configuration files, the updated calling programs and the updated interface databases are obtained, the interface calling is implemented by using the updated configuration files, the updated calling programs and the updated interface databases, and the interface modification fields corresponding to all the calling interfaces and the interface using modes required to be modified are obtained by reading the target interface document.
Optionally, the modification unit includes: the acquisition module is used for acquiring the document identification of the target interface document; the positioning module is used for positioning an interface configuration file, an interface calling program and an interface database corresponding to the target interface document based on the document identification; the first modification module is used for modifying the configuration items related to the modification in the interface configuration file based on the N interface modification fields to obtain an updated configuration file, wherein the configuration items are used for describing the mapping relation between the interface modification fields and entity type fields in the interface calling program; and the second modification module is used for modifying the interface calling program and the interface database based on the N interface modification fields and the update configuration file to obtain the update calling program and the update interface database.
Optionally, the second modification module includes: the conversion sub-module is used for converting the N interface modification fields into N entity class fields through a preset field reflection mechanism, wherein the entity class fields are used for describing object attributes of interface objects in the interface calling program; the injection submodule is used for injecting N entity class fields to the appointed position in the interface calling program to obtain an updated calling program; and the first execution sub-module is used for executing migration operation on the interface database based on the update configuration file and the update calling program to obtain the update interface database.
Optionally, the second modification module further comprises: the analysis sub-module is used for analyzing the update configuration file and the change information in the update calling program through a preset database analysis tool to obtain an analysis result, wherein the analysis result is used for describing the change content related to the interface database in the current modification; the creation sub-module is used for creating a database migration script based on the analysis result, wherein the database migration script writes all the change contents into executable script sentences by using a preset grammar specification; and the second execution sub-module is used for executing the database migration script on the interface database to obtain an updated interface database.
Optionally, the interface docking device further comprises: the test module is used for calling and testing the update calling program and the update interface database according to a preset test strategy to obtain a test result, wherein the preset test strategy comprises at least one of the following steps: unit test strategy, integrated test strategy and system test strategy; the calling module is used for calling the interface object recorded in the target interface document based on the updating configuration file, the updating calling program and the updating interface database under the condition that the test result indicates that the calling process has no error; or the correction module is used for acquiring an error report log under the condition that the test result indicates that the calling process has an error report, and correcting the error calling information according to the error position indicated by the error report log.
Optionally, the test module includes: the writing sub-module is used for writing unit test cases based on unit test strategies, wherein the unit test cases at least comprise: first input data and first desired output data; the first copying sub-module is used for copying the update configuration file, the update calling program and the update interface database and packaging the copied update configuration file, update calling program and update interface database into a test mirror image; the first input sub-module is used for inputting the unit test cases into the test mirror image to obtain first output data, wherein the test mirror image is used for calling the interface objects recorded in the target interface document based on the first input data and returning the first output data; and the first generation sub-module is used for generating a test result based on the first expected output data and the first output data.
Optionally, the test module further comprises: the defining sub-module is used for defining an integrated test scene and an integrated test case based on an integrated test strategy, wherein the integrated test scene comprises R integrated points, each integrated point is used for describing the dependency relationship between database objects in the updated interface database, and the integrated test case at least comprises: the second input data and the second expected output data, R is a positive integer; the second replication sub-module is used for replicating the update configuration file, the update calling program and the update interface database and packaging the replicated update configuration file, update calling program and update interface database into a test mirror image; the second input sub-module is used for inputting the integrated test scene and the integrated test case into the test mirror image to obtain second output data, wherein the test mirror image is used for calling the interface object recorded in the target interface document based on the second input data and returning the second output data; and the second generation sub-module is used for generating a test result based on the second expected output data and the second output data.
The interface docking apparatus may further include a processor and a memory, wherein the reading unit 41, the modifying unit 42, the calling unit 43, and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to implement corresponding functions.
The processor includes a kernel, and the kernel fetches a corresponding program unit from the memory. The kernel can set one or more than one, and interface docking is completed by adjusting kernel parameters based on the update configuration file, the update calling program and the interface object recorded in the update interface database calling target interface document.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (f-ash RAM), and the memory includes at least one memory chip.
The present application also provides a computer program product adapted to perform, when executed on a data processing device, a program initialized with the method steps of: reading the modified target interface document to obtain N interface modification fields, wherein the target interface document is used for recording interfaces and interface use modes which are called by a target financial system when providing target service, and N is a positive integer; modifying an interface configuration file, an interface calling program and an interface database corresponding to the target interface document based on the N interface modification fields to obtain an update configuration file, an update calling program and an update interface database; and calling the interface object recorded in the target interface document based on the update configuration file, the update calling program and the update interface database to complete interface docking.
According to another aspect of the embodiments of the present invention, there is also provided a computer readable storage medium, including a stored computer program, where the computer program when executed controls a device in which the computer readable storage medium is located to perform the interface docking method according to any one of the above embodiments.
According to another aspect of the embodiments of the present invention, there is also provided an electronic device including one or more processors and a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the interface interfacing method of any of the above embodiments.
Fig. 5 is a block diagram of a hardware structure of an electronic device (or mobile device) for an interface docking method according to an embodiment of the present invention. As shown in fig. 5, the electronic device may include one or more (shown in fig. 5 as 502a, 502b, … …,502 n) processors 502 (the processors 502 may include, but are not limited to, a microprocessor MCU, a programmable logic device FPGA, etc. processing means), a memory 504 for storing data. In addition, the method may further include: a display, an input/output interface (I/O interface), a Universal Serial Bus (USB) port (which may be included as one of the ports of the I/O interface), a network interface, a keyboard, a power supply, and/or a camera. It will be appreciated by those of ordinary skill in the art that the configuration shown in fig. 5 is merely illustrative and is not intended to limit the configuration of the electronic device described above. For example, the electronic device may also include more or fewer components than shown in FIG. 5, or have a different configuration than shown in FIG. 5.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
In the foregoing embodiments of the present invention, the descriptions of the embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed technology content may be implemented in other manners. The above-described embodiments of the apparatus are merely exemplary, and the division of units may be a logic function division, and there may be another division manner in actual implementation, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interfaces, units or modules, or may be in electrical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium, including instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a Read-only Memory (ROM), a random access Memory (RAM, random Access Memory), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely a preferred embodiment of the present invention and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present invention, which are intended to be comprehended within the scope of the present invention.

Claims (10)

1. An interface interfacing method, comprising:
reading the modified target interface document to obtain N interface modification fields, wherein the target interface document is used for recording interfaces and interface use modes which are called by a target financial system when providing target service, and N is a positive integer;
modifying an interface configuration file, an interface calling program and an interface database corresponding to the target interface document based on the N interface modification fields to obtain an update configuration file, an update calling program and an update interface database;
and calling the interface object recorded in the target interface document based on the update configuration file, the update calling program and the update interface database to complete interface docking.
2. The interface docking method according to claim 1, wherein the step of modifying the interface configuration file, the interface calling program, and the interface database corresponding to the target interface document based on the N interface modification fields to obtain an update configuration file, an update calling program, and an update interface database includes:
Acquiring a document identification of the target interface document;
positioning the interface configuration file, the interface calling program and the interface database corresponding to the target interface document based on the document identification;
modifying a configuration item related to the current modification in the interface configuration file based on the N interface modification fields to obtain the update configuration file, wherein the configuration item is used for describing a mapping relation between the interface modification fields and entity type fields in the interface calling program;
and modifying the interface calling program and the interface database based on the N interface modification fields and the update configuration file to obtain the update calling program and the update interface database.
3. The interface docking method according to claim 2, wherein the step of modifying the interface calling program and the interface database based on N of the interface modification fields and the update configuration file to obtain the update calling program and the update interface database includes:
converting the N interface modification fields into N entity class fields through a preset field reflection mechanism, wherein the entity class fields are used for describing object attributes of interface objects in the interface calling program;
Injecting N entity class fields into the appointed position in the interface calling program to obtain the updating calling program;
and executing migration operation on the interface database based on the update configuration file and the update calling program to obtain the update interface database.
4. The interface docking method according to claim 3, wherein the step of performing a migration operation on the interface database based on the update profile and the update caller to obtain the updated interface database includes:
analyzing the update configuration file and the change information in the update calling program through a preset database analysis tool to obtain an analysis result, wherein the analysis result is used for describing the change content related to the interface database in the current modification;
creating a database migration script based on the analysis result, wherein the database migration script writes all the change contents into executable script sentences by using a preset grammar specification;
and executing the database migration script on the interface database to obtain the updated interface database.
5. The interface interfacing method according to claim 1, further comprising, before calling the interface object described in the target interface document based on the update profile, the update calling program, and the update interface database:
And carrying out calling test on the updating calling program and the updating interface database according to a preset test strategy to obtain a test result, wherein the preset test strategy comprises at least one of the following steps: unit test strategy, integrated test strategy and system test strategy;
under the condition that the test result indicates that the calling process has no error, calling the interface object recorded in the target interface document based on the updating configuration file, the updating calling program and the updating interface database; or,
and under the condition that the test result indicates that the calling process has error reporting, acquiring an error reporting log, and correcting error calling information according to the error position indicated by the error reporting log.
6. The interface docking method according to claim 5, wherein the step of calling the update calling program and the update interface database according to a preset test policy to obtain a test result includes:
writing a unit test case based on the unit test strategy, wherein the unit test case at least comprises: first input data and first desired output data;
copying the update configuration file, the update calling program and the update interface database, and packaging the copied update configuration file, update calling program and update interface database into a test mirror image;
Inputting the unit test case into the test mirror image to obtain first output data, wherein the test mirror image is used for calling an interface object recorded in the target interface document based on the first input data and returning the first output data;
the test result is generated based on the first expected output data and the first output data.
7. The interface docking method according to claim 5, wherein the step of calling the update calling program and the update interface database according to a preset test policy to obtain a test result, further comprises:
defining an integrated test scene and an integrated test case based on the integrated test policy, wherein the integrated test scene comprises R integrated points, each integrated point is used for describing a dependency relationship between database objects in the update interface database, and the integrated test case at least comprises: the second input data and the second expected output data, R is a positive integer;
copying the update configuration file, the update calling program and the update interface database, and packaging the copied update configuration file, update calling program and update interface database into a test mirror image;
Inputting the integrated test scene and the integrated test case into the test mirror image to obtain second output data, wherein the test mirror image is used for calling an interface object recorded in the target interface document based on the second input data and returning the second output data;
the test result is generated based on the second desired output data and the second output data.
8. An interface docking apparatus, comprising:
the reading unit is used for reading the modified target interface document to obtain N interface modification fields, wherein the target interface document is used for recording interfaces and interface use modes which are called by a target financial system when providing target service, and N is a positive integer;
the modification unit is used for modifying the interface configuration file, the interface calling program and the interface database corresponding to the target interface document based on the N interface modification fields to obtain an update configuration file, an update calling program and an update interface database;
and the calling unit is used for calling the interface object recorded in the target interface document based on the updating configuration file, the updating calling program and the updating interface database to finish interface butt joint.
9. A computer readable storage medium, characterized in that the computer readable storage medium comprises a stored computer program, wherein the computer program, when run, controls a device in which the computer readable storage medium is located to perform the interface docking method of any one of claims 1 to 7.
10. An electronic device comprising one or more processors and a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the interface interfacing method of any of claims 1-7.
CN202311776309.5A 2023-12-21 2023-12-21 Interface docking method and device, electronic equipment and storage medium Pending CN117763026A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311776309.5A CN117763026A (en) 2023-12-21 2023-12-21 Interface docking method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311776309.5A CN117763026A (en) 2023-12-21 2023-12-21 Interface docking method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117763026A true CN117763026A (en) 2024-03-26

Family

ID=90324961

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311776309.5A Pending CN117763026A (en) 2023-12-21 2023-12-21 Interface docking method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117763026A (en)

Similar Documents

Publication Publication Date Title
US6182245B1 (en) Software test case client/server system and method
US7054881B2 (en) Method and system for reporting standardized and verified data
US8347402B2 (en) Software development and distribution workflow employing meta-object time stamping
US9772830B2 (en) System and method for modeling cloud rules for migration to the cloud
EP1139216A2 (en) Web application development system
US20100211539A1 (en) System and method for building a data warehouse
CN110765010B (en) Method and device for online debugging visual development based on Flink
US8661414B2 (en) Method and system for testing an order management system
CN111737140A (en) Interface automation test method, device, equipment and computer readable storage medium
CN115993966B (en) Application development system and method
CN111737152B (en) Method and device for realizing WEB automatic test by inputting data through webpage
US10459698B2 (en) Framework for generating adapters in an integrated development environment
CN117112060A (en) Component library construction method and device, electronic equipment and storage medium
CN113742215A (en) Method and system for automatically configuring and calling test tool to perform test analysis
US20210224062A1 (en) Systems and Methods for Software Documentation and Code Generation Management
EP2199905A1 (en) Lifecycle management and consistency checking of object models using application platform tools
CN113535141A (en) Database operation code generation method and device
US20190303279A1 (en) Modeling system
CN117493199A (en) Code verification method, device, computer equipment and storage medium
CN114443039A (en) Input parameter verification method and device, electronic equipment and storage medium
CN112561690A (en) Method, system, equipment and storage medium for testing credit card staging service interface
CN117763026A (en) Interface docking method and device, electronic equipment and storage medium
US20140025439A1 (en) Regression free business process management
CN114416305A (en) Robot engine implementation method and system and electronic equipment
CN113918162A (en) Front-end code automatic checking method based on centralized management mode

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination