Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The flow diagrams depicted in the figures are merely illustrative and not necessarily all of the elements and operations/steps are included or performed in the order described. For example, some operations/steps may be further divided, combined, or partially combined, so that the order of actual execution may be changed according to actual situations.
The embodiment of the application provides a method, a device, equipment and a readable storage medium for generating an interface call link. The interface calling link generation method can be applied to terminal equipment, and the terminal equipment can be electronic equipment such as mobile phones, tablet computers, notebook computers, desktop computers, personal digital assistants, wearable equipment and the like.
Some embodiments of the present application are described in detail below with reference to the accompanying drawings. The following embodiments and features of the embodiments may be combined with each other without conflict.
Referring to fig. 1, fig. 1 is a flowchart illustrating steps of an interface call link generation method according to an embodiment of the present application.
As shown in fig. 1, the interface call link generation method includes steps S101 to S105.
Step S101, a first interface information list is acquired.
The first interface information list is an interface information list formed by combining interface parameters of each interface, and the arrangement mode of the parameters in the first interface information list can be set according to actual situations, which is not particularly limited in the application.
In one embodiment, as shown in fig. 2, step S101 includes sub-steps S1011 to S1013.
Substep S1011, acquires at least one data packet.
When the terminal equipment is in operation, acquiring a data packet called in the operation process of the terminal equipment through a preset packet grabbing tool to obtain at least one data packet. The preset bale plucking tool may be selected according to practical situations, for example, the preset bale plucking tool may be a Fiddler bale plucking tool. The data packet in the running process of the terminal equipment can be accurately obtained through the preset packet grabbing tool.
When the computer downloads data, the packet capturing tool extracts the data packets downloaded by the computer through the Fiddler, so as to obtain at least one data packet downloaded by the computer, wherein the number of the obtained data packets can be set according to the actual situation, only one data packet can be obtained, and a plurality of data packets can be obtained.
And step S1012, analyzing at least one data packet to obtain message information of at least one interface.
Converting the data packet into a text format form to obtain a data packet text, and analyzing the data packet text to obtain message information of the interface, wherein the message information comprises a request mode of the interface, a URL (uniform resource locator, uniform resource locator system), first header information, sender information, second header information and return body information.
It should be noted that, the number of message information of the generated interfaces is determined according to the number of interfaces and the number of data packets in the data packets. For example, a data packet only includes one interface, and only message information of one interface can be analyzed; the data packet comprises two interfaces, and message information of the two interfaces is analyzed; and analyzing the message information of the four interfaces if the two data packets comprise two interfaces.
Substep S1013, generating a first interface information list according to the message information of at least one of the interfaces.
Analyzing the message information of at least one interface to obtain a request mode, a URL, first header information, transmitting body information, second header information and returning body information of at least one interface; a first interface information list is generated based on a request pattern, a URL, first header information, sender information, second header information, and return body information of at least one interface. The request mode, the URL, the first head information, the transmitting body information, the second head information and the returning body information of the interface can be accurately obtained through analyzing the message information, and a first interface information list can be generated according to the request mode, the URL, the first head information, the transmitting body information, the second head information and the returning body information of the interface.
In an embodiment, the parsing of the message information of at least one interface to obtain the request mode, URL, first header information, sender information, second header information and return body information of at least one interface may be: obtaining a request mode identification, a URL identification, a first head information identification, a sender information identification, a second head information identification and a return information identification of an interface in message information, obtaining a preset request mode identification, a URL identification, a first head information identification, a sender information identification, a second head information identification and a return information identification, and obtaining a mapping relation table between the request mode identification, the URL, the first head information, the sender information, the second head information and the return information according to the mapping relation table and the request mode identification, the URL identification, the first head information identification, the sender information identification, the second head information identification and the return information identification of the interface in the message information, thereby obtaining the request mode, the URL, the first head information, the sender information, the second head information and the return information of the interface. Wherein, the mapping relation table is pre-established. The request mode, the URL, the first header information, the sender information, the second header information and the return body information of the interface included in the message information can be accurately determined through the request mode identification, the URL identification, the first header information identification, the sender information identification, the second header information identification and the return body information identification of the interface in the mapping relation table and the message information.
In an embodiment, the manner of generating the first interface information list based on the request manner of the at least one interface, the URL, the first header information, the sender information, the second header information, and the returned body information may be: the request mode, the URL, the first header information, the transmitting body information, the second header information and the returning body information of the interface are converted into key value pair modes to obtain key value pair information of the interface, the key value pair information of the interface is analyzed into dictionary modes and stored in the interface information list to obtain a first interface information list. The convenience of parameter storage is improved by carrying out format conversion on the parameters of the interface.
Step S102, inputting the first interface information list into a preset parameter type recognition model to obtain the parameter type of each parameter in the first interface information list, wherein the parameter type recognition model is a pre-trained neural network model.
The preset parameter type recognition model can comprise a long-term and short-term memory artificial neural network, a convolutional neural network model, a cyclic convolutional neural network and other neural network models. The parameter categories comprise a first parameter category, a second parameter category and a third parameter category, wherein the first parameter category is an instruction parameter, the second parameter category is a parameter which is necessary to be filled by a user, such as a user account number and a password, and the third parameter category is an associated parameter.
In one embodiment, the preset parameter class identification model includes an input layer, a hidden layer, and an output layer. The input layer includes a first predetermined number of neural networks, the hidden layer includes a second predetermined number of neural networks, and the output layer includes a third predetermined number of neural networks. The first preset number, the second preset number and the third preset number can be set according to actual conditions, the application is not limited in particular, for example, the first preset number can be 2, the second preset number can be 3 and the third preset number can be 2, when the neural network is a long-short-period memory artificial neural network, the input layer comprises a double-layer long-short-period memory artificial neural network, the hidden layer comprises three-layer long-short-period memory artificial neural network, and the output layer comprises a double-layer long-short-period memory artificial neural network.
In one embodiment, a first interface information list is input to an input layer to obtain a first vector; inputting the first vector into the hidden layer to obtain a second vector; and inputting the second vector to the output layer to obtain the parameter category of each parameter in the first interface information list. The first interface information list is input into the preset parameter type identification model, so that the parameter type of each parameter in the first interface information list can be accurately determined.
In an embodiment, the method for updating the parameters in the preset parameter class identification model may be: inputting the first interface information list into an input layer to obtain a first vector, inputting the first vector into a hidden layer to obtain a second vector, inputting the second vector into an output layer to obtain a parameter class of each parameter in the first interface information list, determining a target loss value according to each parameter in the first interface information list and the parameter class of each parameter in the first interface information list, determining whether the preset parameter class identification model is converged according to the target loss value, updating the parameters of the preset parameter class identification model if the preset parameter class identification model is not converged, and continuously training the updated preset parameter class identification model until the preset parameter class identification model is converged.
In an embodiment, according to each parameter in the first interface information list and the parameter class of each parameter in the first interface information list, the method for determining the target loss value may be: inputting each parameter in the first interface information list into a softmax function to obtain a first parameter, taking the logarithm of the first parameter to obtain a second parameter, carrying out addition operation on the parameter type of each parameter in the first interface information list and the second parameter to obtain a third parameter of each parameter, carrying out average calculation on the third parameter and taking the opposite number to obtain a target loss value.
In an embodiment, the determining whether the preset parameter class identification model converges according to the target loss value may be: determining that the target loss value is smaller than a preset threshold value, and if the target loss value is smaller than the preset threshold value, determining that the preset parameter class identification model converges; and if the target loss value is greater than or equal to a preset threshold value, determining that the preset parameter class identification model is not converged. The preset threshold may be set according to the actual situation, which is not limited in the present application, and for example, the preset threshold may be set to 0.25. By determining whether the target loss value is smaller than a preset threshold value, the convergence condition of the preset parameter type recognition model can be determined, and the accuracy of model recognition is improved.
Step S103, updating each parameter in the first interface information list based on the parameter category of each parameter to obtain a second interface information list.
After the parameter category of each parameter in the first interface information list is determined, a preset parameter updating rule is obtained, and each parameter in the first interface information list is updated based on the preset parameter updating rule to obtain an updated second interface information list. The preset parameter updating rule can be set according to actual conditions. The parameters in the first interface information list are updated through the preset parameter updating rule, so that the accuracy of the subsequent interface link generation can be improved.
The preset parameter updating rule is exemplified by: the parameters of the first parameter class keep the original parameter values, the parameters of the second parameter class are updated to input_remark, and the parameters of the third parameter class are updated to svrid. For example, each parameter in the first interface information list is { "page":1, "index": xxxx "," svrid ":111111}, where page is a parameter of the first parameter class, index is a parameter of the second parameter class, svrid is a parameter of the third parameter class, and according to the preset parameter updating rule, the parameters in the first interface information list are updated, so that each parameter in the updated second interface information list is {" page ":1," index ": input_index," svrid ": svrid }.
Step S104, obtaining target interface information, and screening interface information associated with the target interface information from the second interface information list to obtain an associated interface information set.
The associated interface information set at least comprises first associated interface information and second associated interface information, the first associated interface information is associated with the target interface information, the second associated interface information is associated with the first associated interface information, the first associated interface information comprises associated parameters in the target interface information, and the second associated interface information comprises associated parameters in the first associated interface information.
In an embodiment, the manner of obtaining the target interface information may be: and finding the last piece of interface information from the second interface information list, and taking the last piece of interface information as target interface information. Or acquiring an interface call link request, extracting interface information from the interface call link request, and taking the extracted interface information as target interface information. Of course, there are other ways of obtaining the target interface information, and the embodiment of the present application is not limited thereto, for example, the second last interface information may be found from the second interface information list, and the second last interface information may be used as the target interface information.
In an embodiment, the method for obtaining the associated interface information set by screening the interface information associated with the target interface information from the second interface information list may be: extracting associated parameters in the sender information of the target interface information, and taking the associated parameters as target parameters; and screening interface information associated with the target interface information from the second interface information list based on the target parameters to obtain an associated interface information set. The associated interface information can be accurately found through the associated parameters in the sender information of the target interface information.
In an embodiment, based on the target parameter, the method for screening the interface information associated with the target interface information from the second interface information list to obtain the associated interface information set may be: screening interface information with target parameters in the returned body information from the second interface information list, and adding the selected interface information into the associated interface information set to update the associated interface information set; extracting the associated parameters in the sender information of the selected interface information, and taking the associated parameters as updated target parameters; and based on the updated target parameters, screening the interface information with the updated target parameters in the returned body information from the second interface information list, adding the selected interface information into the associated interface information set to update the associated interface information set, traversing all the interface information in the second interface information list until the same associated parameters are not available, and finishing updating the associated interface information set. And the interface information associated with the target interface information can be found through the recursion of the associated parameters of the target interface information layer by layer, so as to obtain an associated interface information set.
The second interface information list includes interface information 1, interface information 2, interface information 3, interface information 4, interface information 5, interface information 6, interface information 7, interface information 8, interface information 9 and interface information 10, where the interface information 2 is target interface information, the association parameter in the sender information of the interface information 2 is association parameter 2, the returned body information of the interface information 7 is queried to include association parameter 2, the interface information 7 is association interface information, the interface information 7 is added to the associated interface information set, the association parameter in the sender information of the interface information 7 is association parameter 7, the interface information 5 is association interface information, the interface information 5 is added to the associated interface information set, the association parameter in the sender information of the interface information 5 is association parameter 5, the association interface information set is updated if the association parameter 5 is included in the returned body information of the interface information 7, and the association interface information set includes the interface information 7 and the interface information 5.
Step 105, generating a target interface call link according to the target interface information and each interface information in the associated interface information set.
After the associated interface information set is obtained, determining the splicing sequence of the target interface information and each interface information in the associated interface information set; and splicing each piece of interface information in the target interface information and the associated interface information set according to the splicing sequence to obtain a target interface calling link. By splicing the target interface information and each interface information in the associated interface information set, a target interface call link can be accurately obtained.
In an embodiment, the manner of determining the splicing order of each interface information in the target interface information and the associated interface information set may be: acquiring associated parameters of sender information of a target interface; acquiring the association parameters of the sender information and the association parameters of the return body information of each interface in the association interface information set; and determining the splicing sequence of the target interface information and each interface information in the associated interface information set according to the associated parameters of the sender information of the target interface, the associated parameters of the sender information of each interface in the associated interface information set and the associated parameters of the returned body information.
The associated interface information set includes interface information 7 and interface information 5, the target interface information is interface information 2, the sender information of the interface information 2 includes associated parameter 2, the sender information of the interface information 7 includes associated parameter 7, the return body information includes associated parameter 2, and the return information of the interface information 5 includes 7, so that the splicing order of the interface information is sequentially interface information 5, interface information 7 and interface information 2.
In an embodiment, after the target interface call link is obtained, generating a target interface operation detection parameter according to the target interface call link, obtaining a target interface information operation log, determining whether an error occurs in the target interface operation process according to the target interface information operation log and the target interface operation detection parameter, and generating an interface call error early warning if the error occurs in the operation process so as to remind a user of the error occurrence of the interface information call. And the link is called by the target interface to detect the operation of the interface, so that the accuracy and the safety of data transmission are improved.
In an embodiment, according to the target interface information operation log and the target interface operation detection parameter, the determining whether an error occurs in the target interface operation process may be: determining whether the operation parameters in the target interface information operation log are the same as the target interface operation detection parameters, if the operation parameters in the target interface information operation log are the same as the target interface operation detection parameters, determining that no error occurs in the operation process of the target interface, and if the operation parameters in the target interface information operation log are different from the target interface operation detection parameters, determining that an error occurs in the operation process of the target interface.
According to the interface call link generation method provided by the embodiment, the parameter type of each parameter in the first interface information list can be accurately obtained by acquiring the first interface information list and inputting the first interface information list into the preset parameter type identification model, each parameter in the first interface information list is updated based on the parameter type of each parameter, a second interface information list with clear parameter type can be obtained, target interface information is acquired, interface information associated with the target interface information is screened out from the second interface information list, an associated interface information set can be accurately obtained, and the target interface call link can be accurately generated through the target interface information and each interface information in the associated interface information set. By the scheme, the efficiency and the accuracy of interface call link generation can be improved.
Referring to fig. 3, fig. 3 is a schematic block diagram of an interface call link generating device according to an embodiment of the present application.
As shown in fig. 3, the interface call link generation apparatus 200 includes: an acquisition module 210, a generation module 220, an update module 230, and a screening module 240, wherein:
the acquiring module 210 is configured to acquire a first interface information list;
The generating module 220 is configured to input the first interface information list to a preset parameter class identification model, so as to obtain a parameter class of each parameter in the first interface information list;
the updating module 230 is configured to update each parameter in the first interface information list based on a parameter class of each parameter to obtain a second interface information list;
the acquiring module 210 is further configured to acquire target interface information;
the screening module 240 is configured to screen interface information associated with the target interface information from the second interface information list to obtain an associated interface information set;
the generating module 220 is further configured to generate a target interface call link according to the target interface information and each interface information in the associated interface information set.
In an embodiment, as shown in fig. 4, the obtaining module 210 further includes an obtaining sub-module 211, a parsing module 212, and a generating sub-module 213, where:
the acquiring submodule 211 is configured to acquire at least one data packet;
the parsing module 212 is configured to parse at least one of the data packets to obtain message information of at least one interface;
The generating sub-module 213 is configured to generate a first interface information list according to the message information of at least one of the interfaces.
In an embodiment, the generating module 220 is further configured to:
analyzing the message information of at least one interface to obtain a request mode, a URL, first header information, sender information, second header information and return body information of at least one interface;
a first interface information list is generated based on a request mode, a URL, first header information, transmitting body information, second header information and returning body information of at least one of the interfaces.
In an embodiment, the set of associated interface information includes at least first associated interface information associated with the target interface information and second associated interface information associated with the first associated interface information, the first associated interface information including associated parameters in the target interface information, the second associated interface information including associated parameters in the first associated interface information.
In an embodiment, the generating module 220 is further configured to:
determining the splicing sequence of each interface information in the target interface information and the associated interface information set;
And splicing each piece of interface information in the target interface information and the associated interface information set according to the splicing sequence to obtain the target interface calling link.
In an embodiment, the generating module 220 is further configured to:
acquiring associated parameters of sender information of the target interface;
acquiring the association parameters of the sender information and the association parameters of the return body information of each interface in the association interface information set;
and determining the splicing sequence of the target interface information and each interface information in the associated interface information set according to the associated parameters of the sender information of the target interface, the associated parameters of the sender information of each interface in the associated interface information set and the associated parameters of the returned body information.
In an embodiment, the preset parameter class identification model includes an input layer, a hidden layer, and an output layer, and the generating module 220 is further configured to:
inputting the first interface information list into the input layer to obtain a first vector;
inputting the first vector into the hidden layer to obtain a second vector;
and inputting the second vector to the output layer to obtain the parameter category of each parameter in the first interface information list.
It should be noted that, for convenience and brevity of description, a specific working process of the interface call link generation device may refer to a corresponding process in the foregoing interface call link generation method embodiment, which is not described herein.
Referring to fig. 5, fig. 5 is a schematic block diagram of a computer device according to an embodiment of the present application.
As shown in fig. 5, the computer device includes a processor, a memory, and a communication interface connected by a system bus, wherein the memory may include a non-volatile storage medium and an internal memory.
The non-volatile storage medium may store an operating system and a computer program. The computer program comprises program instructions that, when executed, cause a processor to perform any of a number of interface call link generation methods.
The processor is used to provide computing and control capabilities to support the operation of the entire computer device.
The internal memory provides an environment for the execution of a computer program in a non-volatile storage medium that, when executed by a processor, causes the processor to perform any of the interface call link generation methods.
It will be appreciated by those skilled in the art that the structure shown in FIG. 5 is merely a block diagram of some of the structures associated with the present inventive arrangements and is not limiting of the computer device to which the present inventive arrangements may be applied, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
It should be appreciated that the bus may be, for example, an I2C (Inter-integrated Circuit) bus, the Memory may be a Flash chip, a Read-Only Memory (ROM) disk, an optical disk, a U-disk or a removable hard disk, etc., the processor may be a central processing unit (Central Processing Unit, CPU), the processor may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field-programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Wherein the general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Wherein in one embodiment the processor is configured to run a computer program stored in the memory to implement the steps of:
acquiring a first interface information list;
inputting the first interface information list into a preset parameter class identification model to obtain a parameter class of each parameter in the first interface information list, wherein the parameter class identification model is a pre-trained neural network model;
updating each parameter in the first interface information list based on the parameter category of each parameter to obtain a second interface information list;
acquiring target interface information, and screening interface information associated with the target interface information from the second interface information list to obtain an associated interface information set;
and generating a target interface call link according to the target interface information and each interface information in the associated interface information set.
In one embodiment, when implementing the acquiring the first interface information list, the processor is configured to implement:
acquiring at least one data packet;
analyzing at least one data packet to obtain message information of at least one interface;
and generating a first interface information list according to the message information of at least one interface.
In one embodiment, when implementing the generating a first interface information list according to the message information of at least one interface, the processor is configured to implement:
analyzing the message information of at least one interface to obtain a request mode, a URL, first header information, sender information, second header information and return body information of at least one interface;
a first interface information list is generated based on a request mode, a URL, first header information, transmitting body information, second header information and returning body information of at least one of the interfaces.
In one embodiment, the processor is further configured to implement:
the associated interface information set at least comprises first associated interface information and second associated interface information, wherein the first associated interface information is associated with the target interface information, the second associated interface information is associated with the first associated interface information, the first associated interface information comprises associated parameters in the target interface information, and the second associated interface information comprises associated parameters in the first associated interface information.
In one embodiment, the processor, when implementing the generating a target interface call link according to the target interface information and each interface information in the associated interface information set, is configured to implement:
Determining the splicing sequence of each interface information in the target interface information and the associated interface information set;
and splicing each piece of interface information in the target interface information and the associated interface information set according to the splicing sequence to obtain the target interface calling link.
In one embodiment, the processor, when implementing the determining the concatenation order of the target interface information and each interface information in the set of associated interface information, is configured to implement:
acquiring associated parameters of sender information of the target interface;
acquiring the association parameters of the sender information and the association parameters of the return body information of each interface in the association interface information set;
and determining the splicing sequence of the target interface information and each interface information in the associated interface information set according to the associated parameters of the sender information of the target interface, the associated parameters of the sender information of each interface in the associated interface information set and the associated parameters of the returned body information.
In one embodiment, when the processor implements the preset parameter class identification model including an input layer, a hidden layer and an output layer, the processor inputs the first interface information list to the preset parameter class identification model to obtain a parameter class of each parameter in the first interface information list, the processor is configured to implement:
Inputting the first interface information list into the input layer to obtain a first vector;
inputting the first vector into the hidden layer to obtain a second vector;
and inputting the second vector to the output layer to obtain the parameter category of each parameter in the first interface information list.
It should be noted that, for convenience and brevity of description, the specific working process of the computer device described above may refer to the corresponding process in the foregoing interface call link generation method embodiment, which is not described herein again.
Embodiments of the present application also provide a computer readable storage medium having a computer program stored thereon, the computer program including program instructions that, when executed, implement a method for invoking various embodiments of a link generation method with reference to an interface of the present application.
The computer readable storage medium may be an internal storage unit of the computer device according to the foregoing embodiment, for example, a hard disk or a memory of the computer device. The computer readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like, which are provided on the computer device.
Further, the computer-readable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created from the use of blockchain nodes, and the like.
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm and the like. The Blockchain (Blockchain), which is essentially a decentralised database, is a string of data blocks that are generated by cryptographic means in association, each data block containing a batch of information of network transactions for verifying the validity of the information (anti-counterfeiting) and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, an application services layer, and the like.
It is to be understood that the terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
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. It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present application are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments. While the application has been described with reference to certain preferred embodiments, it will be understood by those skilled in the art that various changes and substitutions of equivalents may be made and equivalents will be apparent to those skilled in the art without departing from the scope of the application. Therefore, the protection scope of the application is subject to the protection scope of the claims.