Nothing Special   »   [go: up one dir, main page]

CN117435189A - Test case analysis method, device, equipment and medium of financial system interface - Google Patents

Test case analysis method, device, equipment and medium of financial system interface Download PDF

Info

Publication number
CN117435189A
CN117435189A CN202311485743.8A CN202311485743A CN117435189A CN 117435189 A CN117435189 A CN 117435189A CN 202311485743 A CN202311485743 A CN 202311485743A CN 117435189 A CN117435189 A CN 117435189A
Authority
CN
China
Prior art keywords
interface
field
information
parameter
field description
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
CN202311485743.8A
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.)
Ping An Life Insurance Company of China Ltd
Original Assignee
Ping An Life Insurance Company of China Ltd
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 Ping An Life Insurance Company of China Ltd filed Critical Ping An Life Insurance Company of China Ltd
Priority to CN202311485743.8A priority Critical patent/CN117435189A/en
Publication of CN117435189A publication Critical patent/CN117435189A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/36Software reuse
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/183Tabulation, i.e. one-dimensional positioning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/73Program documentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/75Structural analysis for program understanding

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Library & Information Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention relates to the field of finance, in particular to a method, a device, equipment and a medium for analyzing test cases of a financial system interface, wherein the method extracts test cases corresponding to interface information from an interface test platform to obtain a corresponding interface file of an interface to be tested; for any interface file, extracting information from the interface file to obtain at least one parameter information, traversing all parameter information to obtain all field description information of the corresponding interface file; according to all interface files and all field description information of the corresponding interface files, an interface information tree is constructed, and the interface information tree comprising field example values and field descriptions is constructed by analyzing test cases, so that when an interface document template is received, the field description information in the interface information tree can be directly written into the interface document template, an interface document with accurate interface information is automatically generated, manual secondary maintenance is not needed, and the accuracy of subsequent case testing is improved.

Description

Test case analysis method, device, equipment and medium of financial system interface
Technical Field
The present invention relates to the field of finance, and in particular, to a method, apparatus, device, and medium for analyzing test cases of a financial system interface.
Background
With the development of computer technology, more and more technologies (big data, distributed, blockchain, artificial intelligence, etc.) are applied in the financial field, and the traditional financial industry is gradually changing to financial science and technology, but due to the requirements of security and real-time performance of the financial industry, higher requirements are also put on the technologies, such as banking systems, interface tests are generally required, wherein the interface tests mainly test the exchange of data.
During interface testing, it is often necessary to write test scripts from an interface document. The interface document is used for describing the attribute of the HTTP interface, and the interface document includes, but is not limited to, basic information such as interface path, request mode, request parameters, response parameters, and the like. Typically, in an interface development process, a developer writes an interface document corresponding to an interface, so that other developers can clearly understand the corresponding interface through the interface document.
At present, two methods for generating interface documents are included, the first method is to scan interface information according to frame convention through scanning codes, for example, a java frame (Spring MVC) can annotate an interface at an @ Controller, but the method cannot generate effective field example values, so that the accuracy of case test is lower; the second is to analyze the test case, firstly obtain the request parameters and/or response parameters of the structure (such as json format), then analyze the field, and finally generate the corresponding interface document.
Therefore, how to make the interface document compatible with generating the field example value and the field description to improve the accuracy and efficiency of the case test is a problem to be solved.
Disclosure of Invention
In view of this, the embodiments of the present invention provide a method, apparatus, device, and medium for analyzing test cases of a financial system interface, so as to solve the problem that an interface document cannot generate field example values and field descriptions at the same time.
In a first aspect, an embodiment of the present invention provides a test case analysis method for a financial system interface, where the test case analysis method includes:
acquiring interface information of N interfaces to be tested in a financial system, extracting test cases corresponding to the interface information from an interface test platform according to all the interface information, analyzing all the test cases to obtain corresponding interface files of the interfaces to be tested, wherein N is an integer greater than zero;
for any interface file, extracting information from the interface file to obtain at least one parameter information, and for any parameter information, analyzing the parameter information to obtain a corresponding parameter field, and obtaining a field type, a field example value and a field description corresponding to the parameter field;
The parameter field, the field type, the field example value and the field description form field description information of corresponding parameter information, and all parameter information is traversed to obtain all field description information corresponding to the interface file;
and constructing an interface information tree according to all the interface files and all the field description information of the corresponding interface files, wherein the interface information tree is used for writing all the field description information corresponding to the interface files into an interface document template when the interface document template corresponding to one interface file is acquired, so as to generate an interface document.
In a second aspect, an embodiment of the present invention provides a test case analysis device for a financial system interface, the test case analysis device including:
the file acquisition module is used for acquiring interface information of N interfaces to be tested in the financial system, extracting test cases corresponding to the interface information from the interface test platform according to all the interface information, analyzing all the test cases to obtain interface files of the corresponding interfaces to be tested, wherein N is an integer greater than zero;
the field analysis module is used for extracting information from any interface file to obtain at least one parameter information, analyzing the parameter information to obtain a corresponding parameter field aiming at any parameter information, and obtaining a field type, a field example value and a field description corresponding to the parameter field;
The information acquisition module is used for traversing all parameter information to obtain all field description information corresponding to the interface file, wherein the parameter field, the field type, the field example value and the field description form field description information of corresponding parameter information;
the information construction module is used for constructing an interface information tree according to all interface files and all field description information of the corresponding interface files, wherein the interface information tree is used for writing all field description information corresponding to an interface file into an interface document template when the interface document template corresponding to the interface file is acquired, and generating an interface document.
In a third aspect, an embodiment of the present invention provides a computer device, where the computer device includes a processor, a memory, and a computer program stored in the memory and executable on the processor, where the processor implements the test case analysis method according to the first aspect when the processor executes the computer program.
In a fourth aspect, an embodiment of the present invention provides a computer readable storage medium storing a computer program, which when executed by a processor implements the test case analysis method according to the first aspect.
Compared with the prior art, the embodiment of the invention has the beneficial effects that:
according to the invention, interface information of N interfaces to be tested in a financial system is obtained, test cases corresponding to the interface information are extracted from an interface test platform according to all the interface information, all the test cases are analyzed, and corresponding interface files of the interfaces to be tested are obtained, wherein N is an integer greater than zero; for any interface file, extracting information from the interface file to obtain at least one parameter information, and for any parameter information, analyzing the parameter information to obtain a corresponding parameter field, and obtaining a field type, a field example value and a field description corresponding to the parameter field; the parameter field, the field type, the field example value and the field description form field description information of corresponding parameter information, and all parameter information is traversed to obtain all field description information corresponding to the interface file; and constructing an interface information tree according to all the interface files and all the field description information of the corresponding interface files, wherein the interface information tree is used for writing all the field description information corresponding to the interface files into an interface document template when the interface document template corresponding to one interface file is acquired, so as to generate an interface document. The method comprises the steps of analyzing a test case, constructing an interface information tree comprising field example values and field descriptions, directly writing field description information in the interface information tree into the interface document template when the interface document template is received, automatically generating an interface document with accurate interface information, and not needing manual secondary maintenance, improving the accuracy of subsequent case testing, and directly modifying any node in the interface information tree when the subsequent maintenance is convenient, simplifying modification flow, reducing modification difficulty and not affecting the efficiency of interface testing.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of an application environment of a method for analyzing test cases of a financial system interface according to an embodiment of the present invention;
FIG. 2 is a flow chart of a method for analyzing test cases of a financial system interface according to an embodiment of the invention;
FIG. 3 is a flow chart of a method for analyzing test cases of a financial system interface according to a second embodiment of the present invention;
FIG. 4 is a flow chart of a method for analyzing test cases of a financial system interface according to a third embodiment of the present invention;
FIG. 5 is a flow chart of a method for analyzing test cases of a financial system interface according to a fourth embodiment of the present invention;
FIG. 6 is a flowchart of a method for analyzing test cases of a financial system interface according to a fifth embodiment of the present invention;
FIG. 7 is a schematic diagram of a test case analysis device for a financial system interface according to a sixth embodiment of the present invention;
fig. 8 is a schematic structural diagram of a computer device according to a seventh embodiment of the present invention.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth such as the particular system architecture, techniques, etc., in order to provide a thorough understanding of the embodiments of the present invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
It should be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
As used in the present description and the appended claims, the term "if" may be interpreted as "when..once" or "in response to a determination" or "in response to detection" depending on the context. Similarly, the phrase "if a determination" or "if a [ described condition or event ] is detected" may be interpreted in the context of meaning "upon determination" or "in response to determination" or "upon detection of a [ described condition or event ]" or "in response to detection of a [ described condition or event ]".
Furthermore, the terms "first," "second," "third," and the like in the description of the present specification and in the appended claims, are used for distinguishing between descriptions and not necessarily for indicating or implying a relative importance.
Reference in the specification to "one embodiment" or "some embodiments" or the like means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the invention. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," and the like in the specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments" unless expressly specified otherwise. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless expressly specified otherwise.
It should be understood that the sequence numbers of the steps in the following embodiments do not mean the order of execution, and the execution order of the processes should be determined by the functions and the internal logic, and should not be construed as limiting the implementation process of the embodiments of the present invention.
In order to illustrate the technical scheme of the invention, the following description is made by specific examples.
The test case analysis method of the financial system interface provided by the embodiment of the invention can be applied to an application environment as shown in fig. 1, wherein a client communicates with a server. The client includes, but is not limited to, a palm top computer, a desktop computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cloud terminal device, a personal digital assistant (personal digital assistant, PDA), and other computer devices. The server may be an independent server, or may be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms.
Referring to fig. 2, a flow chart of a test case analysis method for a financial system interface according to an embodiment of the present invention is provided, where the test case analysis method may be applied to a client in fig. 1, where a computer device corresponding to the client is connected to a server to obtain corresponding background data, for example, interface information of an interface to be tested, etc., and is used to extract a test case corresponding to the interface information from an interface test platform, so as to analyze the test case and construct an interface information tree. In addition, the server can also provide the client with data collected via it for the client to invoke the trained language model on it.
In the application, a developer manages a database of a server, namely an operation object for operating and warehousing is a developer, the client is operated by the developer, and the database is connected with a corresponding financial system to extract test cases of interfaces to be tested in the financial system from an interface test platform, so that an interface information tree is constructed and used for automatically generating an interface document.
As shown in fig. 2, the test case analysis method may include the steps of:
step S201, obtaining interface information of N interfaces to be tested in the financial system, extracting test cases corresponding to the interface information from the interface test platform according to all the interface information, and analyzing all the test cases to obtain corresponding interface files of the interfaces to be tested.
Wherein N is an integer greater than zero. The financial system refers to various business systems related to the financial field, such as banking system, insurance business system, etc. The interface to be tested can be any application programming interface (Application Programming Interface, API) which is developed and completed, the API can realize the mutual communication between different functional layers of the same system, and can also select a hypertext transfer protocol (HyperText Transfer Protocol, HTTP) interface, but is not limited to the above interface, and can be applied to other data transfer protocol interfaces.
The interface information refers to information for identifying an interface to be tested. The test case is a document containing the association relation of each interface information of the test interface, and the document shows a form such as a table in EXCEL or WORD. The interface file is used for describing interface information, can realize translation between two protocols from a front-end interface to a back-end interface, specifically, the interface file is oriented to a developer, and can be a webpage or a word document for the developer to read, and the developer can inquire the interface information by calling and checking the interface file.
Often, a developer may develop various interfaces for implementing different functions according to actual needs. It can be understood that when developing an interface (i.e. writing an interface program), a developer can make corresponding annotation on the interface program to provide a basis for generating a corresponding interface document according to the annotated interface program later. Therefore, the embodiment of the invention can extract the test cases corresponding to the interface information from the interface test platform according to all the interface information by acquiring the interface information of N interfaces to be tested in the financial system, and after the test cases are obtained, all the test cases are analyzed to obtain the interface files of the corresponding interfaces to be tested.
Step S202, for any interface file, extracting information from the interface file to obtain at least one parameter information, and for any parameter information, analyzing the parameter information to obtain a corresponding parameter field, and obtaining a field type, a field example value and a field description corresponding to the parameter field.
The parameter information refers to information such as a request address, a request mode, a request parameter, a response parameter, and the like. The parameter field refers to a term commonly used in computers for describing corresponding parameter information and has a unique field identifier for computer identification.
The field type defines the kind and size of data stored in the field by the user, and can be broadly classified into a numeric type, a character string type, and a date and time type. The field instance value is used to help understand the purpose of each field type. The field description is used to explain the nature and purpose of the field, and corresponds to a field dictionary. Therefore, in the embodiment of the invention, when the interface file corresponding to each interface to be tested is obtained, for any interface file, information extraction can be performed on the interface file through a keyword extraction algorithm to obtain parameter information such as a request address, a request mode, a request parameter, a response parameter and the like, and then for any parameter information, a parameter field for describing the parameter information is obtained, so that a field type, a field example value and a field description corresponding to the parameter field are obtained.
Step S203, the parameter fields, the field types, the field example values and the field descriptions are used for forming field description information of the corresponding parameter information, and all the parameter information is traversed to obtain all the field description information of the corresponding interface file.
Wherein each field needs to be noted in the document for field name, field type, field instance value, field description, etc. for describing the information of the field. Therefore, in the embodiment of the present invention, the parameter field, the field type, the field example value and the field description of each parameter information are configured into the field description information, and then according to the step of step S202, the field description information of all the parameter information in any interface file is obtained, so as to obtain all the field description information of the corresponding interface file.
Step S204, constructing an interface information tree according to all interface files and all field description information of the corresponding interface files.
The interface information tree is used for writing all field description information corresponding to the interface file into the interface document template to generate the interface document when the interface document template corresponding to the interface file is acquired. The interface document template may be set according to actual requirements, and is not limited herein. For example, the interface document template may be an EXCEL document, in which an add box of parameter information such as an interface name, an interface environment, an interface request mode, an interface request parameter, an interface output parameter is set, and a corresponding interface document is generated by adding all field description information of an interface to the add box set in the EXCEL document.
In the embodiment of the invention, interface files of all interfaces to be tested and all field description information of the corresponding interface files are constructed into an interface information tree of all interfaces to be tested, which is represented by a tree structure such as a binary tree, according to the sequence of information analysis.
According to the embodiment of the invention, interface information of N interfaces to be tested in a financial system is obtained, test cases corresponding to the interface information are extracted from an interface test platform according to all the interface information, all the test cases are analyzed, and corresponding interface files of the interfaces to be tested are obtained, wherein N is an integer greater than zero; extracting information from the interface file according to any interface file to obtain at least one parameter information, and analyzing the parameter information according to any parameter information to obtain a corresponding parameter field to obtain a field type, a field example value and a field description corresponding to the parameter field; the parameter fields, the field types, the field example values and the field descriptions form field description information of corresponding parameter information, and all the parameter information is traversed to obtain all the field description information of the corresponding interface file; and constructing an interface information tree according to all the interface files and all the field description information of the corresponding interface files, wherein the interface information tree is used for writing all the field description information corresponding to the interface files into the interface document template to generate an interface document when the interface document template corresponding to one interface file is acquired. The method comprises the steps of analyzing a test case, constructing an interface information tree comprising field example values and field descriptions, directly writing field description information in the interface information tree into the interface document template when the interface document template is received, automatically generating an interface document with accurate interface information, and not needing manual secondary maintenance, improving the accuracy of subsequent case testing, and directly modifying any node in the interface information tree when the subsequent maintenance is convenient, simplifying modification flow, reducing modification difficulty and not affecting the efficiency of interface testing.
In an embodiment, referring to fig. 3, which is a flow chart illustrating a method for analyzing a test case of a financial system interface according to a second embodiment of the present invention, as shown in fig. 3, which is a further description of step S202, a field type, a field example value, and a field description corresponding to the parameter field are obtained, and specifically includes the following steps:
step S301, obtaining a preset field table, and obtaining a field type and a field example value corresponding to the parameter field by querying the preset field table.
In the embodiment of the invention, the preset field table comprises parameter field names, field types, field example values and the like of each parameter field. The preset field value ranges corresponding to the parameter fields are pre-stored in the preset field table, wherein the field value ranges are pre-defined value ranges corresponding to the field types and field example values, such as a safety value, an upper boundary value, a lower boundary value, a null value and a parameter value of a non-self field type. Based on a preset field table, determining a field type and a field example value corresponding to the parameter field according to a preset field value range corresponding to each parameter field, namely, inquiring the preset field table according to a mapping relation between the parameter field and the field type and a mapping relation between the parameter field and the field example value to obtain the field type and the field example value corresponding to the parameter field.
Step S302, a trained language model is obtained, the parameter fields are input into the trained language model to conduct field translation, and corresponding field description is obtained.
In the embodiment of the invention, the transducer language model is used as a trained language model, and the trained language model is a model with natural language processing capability, so that natural language processing can be accurately performed when new data are aimed. Therefore, the trained language model is utilized to carry out field translation on the parameter fields, and the field description of the parameter fields is correspondingly obtained.
In one embodiment, for step S302, a trained language model is obtained, which specifically includes the following steps:
a sample field and a corresponding sample field specification are obtained.
And inputting the sample field into a language model to perform field translation to obtain a corresponding reference field description, calculating the loss between the sample field description and the reference field description, and reversely correcting the parameters of the language model according to a gradient descent method until the loss converges to obtain a trained language model.
In the embodiment of the invention, a large number of corresponding relations between the field descriptions and the fields can be obtained through the project scanning codes, and the fields and the corresponding mapping dictionary of the standard field descriptions can be obtained through the steps of de-duplication, normalization, manual correction and the like of the field descriptions and used for inquiring the corresponding field descriptions according to the fields. Meanwhile, a Chinese and English common word translation dictionary can be supplemented to expand field descriptions, or a custom mapping dictionary can be supplemented for special and rare fields, so that a training set of a language model can be formed, wherein the training set refers to fields with labels, namely, one sample of field corresponds to one sample of field descriptions. And the sample field is input into the language model for field translation to obtain corresponding reference field description, training loss between the sample field description and the reference field description is calculated by using a cross entropy loss function, and parameters of the language model are reversely corrected according to a gradient descent method until the training loss converges to obtain a trained language model.
In an embodiment, referring to fig. 4, which is a flowchart illustrating a method for analyzing a test case of a financial system interface according to the third embodiment of the present invention, as shown in fig. 4, for further explanation of step S203, after obtaining a field type, a field example value, and a field description corresponding to the parameter field, the method specifically includes the following steps:
step S401, word segmentation processing is carried out on the field description, and a corresponding word segmentation processing result is obtained.
The word segmentation process refers to dividing continuous text into individual word elements. The word segmentation is the minimum unit of expression of the semantic meaning. The word segmentation processing result may be a result of performing word segmentation processing on the field description. Therefore, the embodiment of the invention adopts the word segmentation tool to segment the field description, and a corresponding word segmentation processing result is obtained. It should be noted that, the present embodiment is not limited to the word segmentation tool, and any tool can be used to implement the word segmentation processing function for the field description.
Step S402, screening and obtaining keywords in the word segmentation processing result by using a preset standard word stock.
The preset standard word stock may be preset and include professional words in all financial fields. The keywords refer to non-standard word segments such as unnecessary word segments and spoken word segments in word segment processing results. Therefore, in the embodiment of the invention, each word in the word segmentation processing result is respectively matched with a preset standard word stock, and the unsuccessfully matched word in the word segmentation processing result is used as a keyword.
Step S403, converting the keywords into corresponding standard words, and replacing the corresponding keywords in the field description with the standard words to obtain the standard field description.
The embodiment of the invention converts the keywords into the corresponding standard words based on the preset standard word stock, so that the keywords in the field description are replaced by the standard words, and the standard field description is reconstructed to finish the standardization of the field description.
Step S404, describing the parameter field, the field type, the field example value, and the standard field to form field description information of the corresponding parameter information.
In the embodiment of the present invention, the parameter field, the field type, the field example value, and the corresponding standard field obtained in step S2033 are described to form the field description information of the corresponding parameter information.
In one embodiment, for step S403, the step of converting the keyword into a corresponding standard word specifically includes the following steps:
for any keyword, acquiring a distributed word vector of the keyword;
respectively acquiring distributed word vectors of each standard word in the preset standard word library;
and respectively calculating the semantic similarity between the distributed word vector of the keyword and the distributed word vector of each standard word in the preset standard word stock, and acquiring the standard word with the highest semantic similarity from the preset standard word stock as the standard word of the keyword.
The distributed word vector is to represent words into a fixed-length continuous dense vector, and contains more semantic information, and each dimension has a specific meaning. In the embodiment of the invention, the Word2Vec model is utilized to obtain the distributed Word vector of each keyword, and meanwhile, the Word2Vec model is utilized to respectively obtain the distributed Word vector of each standard Word in a preset standard Word bank. And for any keyword, respectively calculating the semantic similarity between the distributed word vector of the keyword and the distributed word vector of each standard word in a preset standard word library, and taking the standard word with the highest semantic similarity as the standard word of the keyword.
In an embodiment, referring to fig. 5, which is a flowchart illustrating a method for analyzing a test case of a financial system interface according to a fourth embodiment of the present invention, as shown in fig. 5, for further explanation of step S204, an interface information tree is constructed according to all interface files and all field description information of corresponding interface files, and specifically includes the following steps:
step S501, for any interface file, the interface file is used as a first node, and all field description information of the interface file is used as a second node.
Step S502, constructing and obtaining an interface information tree according to the first nodes and the second nodes of all the interface files.
The interface information tree is used for establishing association between each interface file and the field description information. In the embodiment of the invention, the interface file corresponding to each interface to be tested is used as a first node of the interface information tree, all field description information under each interface file is used as a second node, and the first node and the second node are connected according to the corresponding relation between the interface file and the field description information, so that the interface information tree is constructed and obtained, and the field description new information of each interface to be tested is conveniently searched.
In an embodiment, referring to fig. 6, a flow chart of a test case analysis method of a financial system interface provided in a fifth embodiment of the present invention is shown, and as shown in fig. 6, the test case analysis includes the following specific steps:
step S601, obtaining interface information of N interfaces to be tested in the financial system, extracting test cases corresponding to the interface information from the interface test platform according to all the interface information, and analyzing all the test cases to obtain corresponding interface files of the interfaces to be tested.
Step S602, for any interface file, extracting information from the interface file to obtain at least one parameter information, and for any parameter information, analyzing the parameter information to obtain a corresponding parameter field, and obtaining a field type, a field example value and a field description corresponding to the parameter field.
Step S603, the parameter fields, the field types, the field example values and the field descriptions are used for forming field description information of the corresponding parameter information, and all the parameter information is traversed to obtain all the field description information of the corresponding interface file.
Step S604, constructing an interface information tree according to all interface files and all field description information of the corresponding interface files.
Step S605, when the interface file needs to be modified, correspondingly acquiring modified field description information, and modifying the interface information tree based on the modified field description information to obtain a modified interface information tree.
Step S606, the interface document is updated by using the modified interface information tree.
For the description of step S601 to step S604, reference may be made to the description of step S201 to step S204 in the above embodiment, which is not repeated here in detail.
For steps S605-606, in the embodiment of the present invention, in the process of project development, the interface files corresponding to the interface test are adjusted accordingly as required, so that the developer needs to maintain and update the interface files continuously, in real time and accurately. When any interface file needs to be modified, according to each interface file in the interface information tree, all field description information nodes corresponding to the interface file are accurately positioned in the interface information tree, and all field description information of the interface file is modified to obtain a modified interface information tree.
In the embodiment of the invention, after the interface information tree is modified in step S605, the interface file is updated by using the modified interface information tree, so that the update rate of the interface document is improved.
Fig. 7 shows a schematic structural diagram of a test case analysis device for a financial system interface according to a sixth embodiment of the present invention, where the test case analysis device is applied to a client in fig. 1, and a computer device corresponding to the client is connected to a server to obtain corresponding background data, for example, interface information of an interface to be tested, and the like, so as to extract a test case corresponding to the interface information from an interface test platform, thereby analyzing the test case and constructing an interface information tree. In addition, the server can also provide the client with data collected via it for the client to invoke the trained language model on it. For convenience of explanation, only portions relevant to the embodiments of the present invention are shown.
Referring to fig. 7, the test case analysis apparatus includes:
the file obtaining module 71 is configured to obtain interface information of N interfaces to be tested in the financial system, extract test cases corresponding to the interface information from the interface test platform according to all the interface information, and parse all the test cases to obtain an interface file of the corresponding interface to be tested, where N is an integer greater than zero;
the field parsing module 72 is configured to extract information from any interface file to obtain at least one parameter information, parse the parameter information to obtain a corresponding parameter field for any parameter information, and obtain a field type, a field example value, and a field description corresponding to the parameter field;
an information obtaining module 73, configured to traverse all parameter information to obtain all field description information corresponding to the interface file, where the parameter field, the field type, the field example value, and the field description constitute field description information of corresponding parameter information;
the information construction module 74 is configured to construct an interface information tree according to all interface files and all field description information corresponding to the interface files, where the interface information tree is configured to write all field description information corresponding to an interface file into an interface document template when obtaining the interface document template corresponding to the interface file, so as to generate an interface document.
Optionally, the field parsing module 72 includes:
the field query unit is used for acquiring a preset field table and obtaining a field type and a field example value corresponding to the parameter field by querying the preset field table;
and the field translation unit is used for acquiring a trained language model, inputting the parameter field into the trained language model for field translation, and obtaining a corresponding field description.
Optionally, the field translation unit includes:
a sample acquisition subunit, configured to acquire a sample field and a corresponding sample field description;
and the model training subunit is used for inputting the sample field into a language model to perform field translation to obtain a corresponding reference field description, calculating the loss between the sample field description and the reference field description, and reversely correcting the parameters of the language model according to a gradient descent method until the loss converges to obtain a trained language model.
Optionally, the information acquisition module 73 includes:
the segmentation processing unit is used for performing word segmentation processing on the field description after the field type, the field example value and the field description corresponding to the parameter field are acquired, so as to obtain a corresponding word segmentation processing result;
The word segmentation screening unit is used for screening keywords in the word segmentation processing result by utilizing a preset standard word stock;
the word segmentation conversion unit is used for converting the keywords into corresponding standard words, and replacing the corresponding keywords in the field description by the standard words to obtain standard field description;
an information composing unit for composing the parameter field, the field type, the field example value, and the standard field into field description information of the corresponding parameter information.
Optionally, the word segmentation conversion unit includes:
a first vector subunit, configured to obtain, for any keyword, a distributed word vector of the keyword;
the second vector sub-unit is used for respectively acquiring the distributed word vector of each standard word in the preset standard word library;
and the similarity evaluation subunit is used for respectively calculating the semantic similarity between the distributed word vector of the keyword and the distributed word vector of each standard word in the preset standard word bank, and acquiring the standard word with the highest semantic similarity from the preset standard word bank as the standard word of the keyword.
Optionally, the information construction module 74 includes:
The node determining unit is used for aiming at any interface file, taking the interface file as a first node and taking all field description information of the interface file as a second node;
and the information tree construction unit is used for constructing an interface information tree according to the first nodes and the second nodes of all the interface files and establishing the association between each interface file and the field description information.
Optionally, the test case analysis method further includes:
the information modification module is used for correspondingly acquiring modified field description information when the interface file needs to be modified, and modifying the interface information tree based on the modified field description information to obtain a modified interface information tree;
and the document updating module is used for updating the interface document by using the modified interface information tree.
It should be noted that, because the content of information interaction, execution process and the like between the modules, units and sub-units is based on the same concept as the method embodiment of the present invention, specific functions and technical effects thereof may be referred to in the method embodiment section, and will not be described herein.
Fig. 8 is a schematic structural diagram of a computer device according to a seventh embodiment of the present invention. As shown in fig. 8, the computer device of this embodiment includes: at least one processor (only one shown in fig. 8), a memory, and a computer program stored in the memory and executable on the at least one processor, the processor, when executing the computer program, implementing the steps in any of the various test case analysis method embodiments described above.
The computer device may include, but is not limited to, a processor, a memory. It will be appreciated by those skilled in the art that fig. 8 is merely an example of a computer device and is not intended to be limiting, and that a computer device may include more or fewer components than shown, or may combine certain components, or different components, such as may also include a network interface, a display screen, an input device, and the like.
The processor may be a CPU, but may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory includes a readable storage medium, an internal memory, etc., where the internal memory may be the memory of the computer device, the internal memory providing an environment for the execution of an operating system and computer-readable instructions in the readable storage medium. The readable storage medium may be a hard disk of a computer device, and in other embodiments may be an external storage device of the computer device, for example, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), etc. that are provided on the computer device. Further, the memory may also include both internal storage units and external storage devices of the computer device. The memory is used to store an operating system, application programs, boot loader (BootLoader), data, and other programs such as program codes of computer programs, and the like. The memory may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment 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, where the integrated units may be implemented in a form of hardware or a form of a software functional unit. In addition, the specific names of the functional units and modules are only for distinguishing from each other, and are not used for limiting the protection scope of the present invention. The specific working process of the units and modules in the above device may refer to the corresponding process in the foregoing method embodiment, which is not described herein again. 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 present invention may implement all or part of the flow of the method of the above-described embodiment, and may be implemented by a computer program to instruct related hardware, and the computer program may be stored in a computer readable storage medium, where the computer program, when executed by a processor, may implement the steps of the method embodiment described above. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, executable files or in some intermediate form, etc. The computer readable medium may include at least: any entity or device capable of carrying computer program code, a recording medium, a computer Memory, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), an electrical carrier signal, a telecommunications signal, and a software distribution medium. Such as a U-disk, removable hard disk, magnetic or optical disk, etc. In some jurisdictions, computer readable media may not be electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
The present invention may also be implemented as a computer program product for implementing all or part of the steps of the method embodiments described above, when the computer program product is run on a computer device, causing the computer device to execute the steps of the method embodiments described above.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided by the present invention, it should be understood that the disclosed apparatus/computer device and method may be implemented in other manners. For example, the apparatus/computer device embodiments described above are merely illustrative, e.g., the division of modules or units is merely a logical functional division, and there may be additional divisions when actually implemented, e.g., 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 may be an indirect coupling or communication connection via interfaces, devices or units, which may be in electrical, mechanical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
The above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention, and are intended to be included in the scope of the present invention.

Claims (10)

1. A test case analysis method of a financial system interface is characterized by comprising the following steps:
acquiring interface information of N interfaces to be tested in a financial system, extracting test cases corresponding to the interface information from an interface test platform according to all the interface information, analyzing all the test cases to obtain corresponding interface files of the interfaces to be tested, wherein N is an integer greater than zero;
For any interface file, extracting information from the interface file to obtain at least one parameter information, and for any parameter information, analyzing the parameter information to obtain a corresponding parameter field, and obtaining a field type, a field example value and a field description corresponding to the parameter field;
the parameter field, the field type, the field example value and the field description form field description information of corresponding parameter information, and all parameter information is traversed to obtain all field description information corresponding to the interface file;
and constructing an interface information tree according to all the interface files and all the field description information of the corresponding interface files, wherein the interface information tree is used for writing all the field description information corresponding to the interface files into an interface document template when the interface document template corresponding to one interface file is acquired, so as to generate an interface document.
2. The test case analysis method according to claim 1, wherein the obtaining the field type, the field example value, and the field description corresponding to the parameter field includes:
acquiring a preset field table, and obtaining a field type and a field example value corresponding to the parameter field by inquiring the preset field table;
And acquiring a trained language model, inputting the parameter fields into the trained language model for field translation, and obtaining corresponding field description.
3. The test case analysis method of claim 2, wherein the obtaining a trained language model comprises:
acquiring a sample field and a corresponding sample field description;
and inputting the sample field into a language model to perform field translation to obtain a corresponding reference field description, calculating the loss between the sample field description and the reference field description, and reversely correcting the parameters of the language model according to a gradient descent method until the loss converges to obtain a trained language model.
4. The test case analysis method according to claim 1, wherein after obtaining the field type, the field example value, and the field description corresponding to the parameter field, the method comprises:
performing word segmentation processing on the field description to obtain a corresponding word segmentation processing result;
screening and obtaining keywords in the word segmentation processing result by using a preset standard word stock;
converting the keywords into corresponding standard words, and replacing the corresponding keywords in the field description by using the standard words to obtain standard field description;
The field description information for composing the parameter field, the field type, the field example value and the field description into the corresponding parameter information includes:
and describing the parameter field, the field type, the field example value and the standard field into field description information forming corresponding parameter information.
5. The test case analysis method according to claim 4, wherein the converting the keyword into the corresponding standard word includes:
for any keyword, acquiring a distributed word vector of the keyword;
respectively acquiring distributed word vectors of each standard word in the preset standard word library;
and respectively calculating the semantic similarity between the distributed word vector of the keyword and the distributed word vector of each standard word in the preset standard word stock, and acquiring the standard word with the highest semantic similarity from the preset standard word stock as the standard word of the keyword.
6. The test case analysis method according to claim 1, wherein the constructing an interface information tree according to all interface files and all field description information of corresponding interface files includes:
For any interface file, taking the interface file as a first node, and taking all field description information of the interface file as a second node;
and constructing an interface information tree according to the first nodes and the second nodes of all the interface files, wherein the interface information tree is used for establishing the association between each interface file and the field description information.
7. The test case analysis method of claim 1, wherein the test case analysis method further comprises:
when the interface file needs to be modified, correspondingly acquiring modified field description information, and modifying the interface information tree based on the modified field description information to obtain a modified interface information tree;
and updating the interface document by using the modified interface information tree.
8. A test case analysis device for a financial system interface, the test case analysis device comprising:
the file acquisition module is used for acquiring interface information of N interfaces to be tested in the financial system, extracting test cases corresponding to the interface information from the interface test platform according to all the interface information, analyzing all the test cases to obtain interface files of the corresponding interfaces to be tested, wherein N is an integer greater than zero;
The field analysis module is used for extracting information from any interface file to obtain at least one parameter information, analyzing the parameter information to obtain a corresponding parameter field aiming at any parameter information, and obtaining a field type, a field example value and a field description corresponding to the parameter field;
the information acquisition module is used for traversing all parameter information to obtain all field description information corresponding to the interface file, wherein the parameter field, the field type, the field example value and the field description form field description information of corresponding parameter information;
the information construction module is used for constructing an interface information tree according to all interface files and all field description information of the corresponding interface files, wherein the interface information tree is used for writing all field description information corresponding to an interface file into an interface document template when the interface document template corresponding to the interface file is acquired, and generating an interface document.
9. A computer device comprising a processor, a memory and a computer program stored in the memory and executable on the processor, the processor implementing the test case analysis method according to any one of claims 1 to 7 when the computer program is executed by the processor.
10. A computer readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the test case analysis method according to any one of claims 1 to 7.
CN202311485743.8A 2023-11-08 2023-11-08 Test case analysis method, device, equipment and medium of financial system interface Pending CN117435189A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311485743.8A CN117435189A (en) 2023-11-08 2023-11-08 Test case analysis method, device, equipment and medium of financial system interface

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311485743.8A CN117435189A (en) 2023-11-08 2023-11-08 Test case analysis method, device, equipment and medium of financial system interface

Publications (1)

Publication Number Publication Date
CN117435189A true CN117435189A (en) 2024-01-23

Family

ID=89553281

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311485743.8A Pending CN117435189A (en) 2023-11-08 2023-11-08 Test case analysis method, device, equipment and medium of financial system interface

Country Status (1)

Country Link
CN (1) CN117435189A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118331888A (en) * 2024-06-13 2024-07-12 中国电信股份有限公司 Interface testing method and related equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118331888A (en) * 2024-06-13 2024-07-12 中国电信股份有限公司 Interface testing method and related equipment

Similar Documents

Publication Publication Date Title
US10402163B2 (en) Intelligent data extraction
US11972201B2 (en) Facilitating auto-completion of electronic forms with hierarchical entity data models
KR101755365B1 (en) Managing record format information
US11816138B2 (en) Systems and methods for parsing log files using classification and a plurality of neural networks
US11403286B2 (en) Bridge from natural language processing engine to database engine
CN109582772B (en) Contract information extraction method, contract information extraction device, computer equipment and storage medium
AU2019204444B2 (en) System and method for enrichment of ocr-extracted data
CN110941951B (en) Text similarity calculation method, text similarity calculation device, text similarity calculation medium and electronic equipment
CN110580308A (en) information auditing method and device, electronic equipment and storage medium
CN110597844B (en) Unified access method for heterogeneous database data and related equipment
CN111651552B (en) Structured information determining method and device and electronic equipment
CN113961768B (en) Sensitive word detection method and device, computer equipment and storage medium
US20230132720A1 (en) Multiple input machine learning framework for anomaly detection
CN117435189A (en) Test case analysis method, device, equipment and medium of financial system interface
US11409959B2 (en) Representation learning for tax rule bootstrapping
EP3945431A1 (en) Bridge from natural language processing engine to database engine
EP3640861A1 (en) Systems and methods for parsing log files using classification and a plurality of neural networks
CN115470861A (en) Data processing method and device and electronic equipment
CN115373982A (en) Test report analysis method, device, equipment and medium based on artificial intelligence
CN115294593A (en) Image information extraction method and device, computer equipment and storage medium
CN115146070A (en) Key value generation method, knowledge graph generation method, device, equipment and medium
CN111597164A (en) Database structure testing method, database structure testing device and terminal equipment
CN110083817B (en) Naming disambiguation method, device and computer readable storage medium
US11720531B2 (en) Automatic creation of database objects
CN117539856A (en) Method and device for detecting number bin table, data management system, device and storage medium

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