Protocol transmission interface parameter adaptation method, device, equipment and medium
By autonomously adapting the server-side interface parameters and utilizing a pre-trained adaptation parameter library, the problems of heavy client development workload and low stability caused by changes in the Web Service server-side interface parameters are solved, achieving efficient interface parameter adaptation and improved stability.
Patent Information
- Application Number
- CN202111572309.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-21
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2041-12-21
AI Technical Summary
When the Web Service server interface parameters change, the client needs to find a new adaptation method, which leads to a large development workload and reduced stability.
By obtaining the server interface parameters to be adapted, using the pre-trained adaptation parameter library for autonomous adaptation, determining the target server interface parameters, and establishing a mapping relationship, the workload of client code development is reduced.
It enhances the stability of client operation, reduces development workload, and improves the efficiency and accuracy of adaptation.
Smart Images

Figure CN116320053B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of protocol transmission technology, and in particular to a method, apparatus, device and medium for adapting protocol transmission interface parameters. Background Art
[0002] IP-based video surveillance systems have gradually become a mainstream solution in the security industry, particularly in the transportation sector. Both snapshot cameras and system platforms involve network data transmission, using a variety of available network transmission protocols, such as HTTP, FTP, and Web Services. Web Services, due to their cross-programming language and operating system platform capabilities and ease of deployment, have gradually become the preferred data transmission protocol.
[0003] However, since Web Service server deployment requires publishing the business methods of a company's internal systems as Web Services and registering them with UDDI (Universal Description Discovery and Integration), the client needs to parse WSDL (Web Services Description Language) to obtain the interface parameters provided by the server and then encapsulate the interface parameters adapted to the server into an HTTP request and send it to the server. This means that if the server's interface parameters change, such as when they are added or removed, their actual meaning is modified, or when connecting to a completely new server, the client will need to find a new adaptation method and re-match the interface parameters, which is detrimental to client development and stability. Summary of the Invention
[0004] The embodiments of the present invention provide a method, apparatus, device and medium for adapting protocol transmission interface parameters, which can reduce the workload of client code development and enhance the stability of client operation.
[0005] In a first aspect, an embodiment of the present invention provides a method for adapting protocol transmission interface parameters, comprising:
[0006] Get the server interface parameters to be adapted;
[0007] Adapting the server interface parameters to be adapted with candidate server interface parameters in a pre-trained adaptation parameter library based on parameter information of the server interface parameters to be adapted and the candidate server interface parameters, and determining target server interface parameters adapted to the server interface parameters to be adapted from the candidate server interface parameters; wherein the adaptation parameter library includes client interface parameters, at least one candidate server interface parameter, and a mapping relationship between the two;
[0008] The client interface parameters mapped to the target server interface parameters are determined based on the mapping relationship, and an adaptation relationship between the server interface parameters to be adapted and the client interface parameters is established.
[0009] In a second aspect, an embodiment of the present invention further provides an adaptation device for protocol transmission interface parameters, including:
[0010] The server parameter acquisition module is used to obtain the parameters of the server interface to be adapted;
[0011] a parameter adaptation module, configured to adapt the server interface parameters to be adapted with candidate server interface parameters in a pre-trained adaptation parameter library based on parameter information of the server interface parameters to be adapted and the candidate server interface parameters, and determine target server interface parameters adapted to the server interface parameters to be adapted from the candidate server interface parameters; wherein the adaptation parameter library includes client interface parameters, at least one candidate server interface parameter, and a mapping relationship between the two;
[0012] The first adaptation relationship establishing module is used to determine the client interface parameters mapped to the target server interface parameters based on the mapping relationship, and establish an adaptation relationship between the server interface parameters to be adapted and the client interface parameters.
[0013] In a third aspect, an embodiment of the present invention further provides an electronic device, including:
[0014] one or more processors;
[0015] a storage device for storing one or more programs,
[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement the method for adapting protocol transmission interface parameters as described in any embodiment of the present invention.
[0017] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for adapting protocol transmission interface parameters as described in any embodiment of the present invention.
[0018] The embodiment of the present invention obtains the server interface parameters to be adapted; according to the parameter information of the server interface parameters to be adapted and the candidate server interface parameters, the server interface parameters to be adapted are adapted with the candidate server interface parameters in a pre-trained adaptation parameter library, and the target server interface parameters adapted with the server interface parameters to be adapted are determined from the candidate server interface parameters; wherein the adaptation parameter library includes client interface parameters, at least one candidate server interface parameter, and a mapping relationship between the two; based on the mapping relationship, the client interface parameters mapped with the target server interface parameters are determined, and an adaptation relationship between the server interface parameters to be adapted and the client interface parameters is established. The embodiment of the present invention can reduce the workload of client code development and enhance the stability of client operation by autonomously adapting the interface parameters of the client and the server. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 This is a flow chart of a method for adapting protocol transmission interface parameters provided by one embodiment of the present invention;
[0020] Figure 2 This is a flow chart of a server-side interface parameter parsing method in a protocol transmission interface parameter adaptation method provided by an embodiment of the present invention;
[0021] Figure 3 is a flow chart of a method for adapting protocol transmission interface parameters provided by another embodiment of the present invention;
[0022] Figure 4 This is a flow chart of a method for sending data information in a method for adapting protocol transmission interface parameters provided by another embodiment of the present invention;
[0023] Figure 5 1 is a schematic diagram of the structure of an adaptation device for protocol transmission interface parameters provided by an embodiment of the present invention;
[0024] Figure 6 It is a structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0025] Embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present invention. It should be understood that the drawings and embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of protection of the present invention.
[0026] It should be understood that the various steps described in the method embodiments of the present invention may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.
[0027] As used herein, the term "including" and its variations are open-ended, i.e., "including but not limited to." The term "based on" means "based, at least in part, on." The term "one embodiment" means "at least one embodiment," the term "another embodiment" means "at least one additional embodiment," and the term "some embodiments" means "at least some embodiments." Other terms are defined in the following description.
[0028] It should be noted that the concepts of "first" and "second" mentioned in the present invention are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0029] It should be noted that the modifications of "one" and "multiple" mentioned in the present invention are illustrative rather than restrictive. Those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0030] The names of the messages or information exchanged between multiple devices in the embodiments of the present invention are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0031] In related technologies, the protocol transmission interface parameters are usually adapted by writing a WebService interface based on a data model, then establishing a database that matches the WebService interface and storing data according to the SQL commands submitted by calling the interface. The client only needs to select the data to implement the WebService service. This solution is suitable for setting up a WebService interface on the server side. However, in daily work, changes in the server interface will lead to code adaptation of the client interface. Since each server may be connected to a client from a different manufacturer or different product, the investment in the adaptation and development of the protocol transmission interface parameters is huge. Moreover, this method requires the client to select the obtained server data, which requires the client to have a certain understanding of the meaning of the corresponding data, thereby indirectly increasing its use threshold and reducing its ease of use.
[0032] The protocol transmission interface parameter adaptation method provided in this embodiment, based on the above method, autonomously learns and predicts different interface parameters of different servers on the client side, thereby realizing autonomous adaptation of the protocol transmission interface parameters.
[0033] Figure 1 This is a flow chart of a protocol transmission interface parameter adaptation method provided by an embodiment of the present invention. This embodiment is applicable to the case of autonomous adaptation of the protocol transmission interface. The method can be executed by a protocol transmission interface parameter adaptation device, which can be implemented in software and / or hardware and can be configured in an electronic device, such as a background server or other device with communication and computing capabilities. Figure 1 As shown, the method specifically includes:
[0034] S110: Obtain the server interface parameters to be adapted.
[0035] It is understood that the adaptation of the protocol transmission interface parameters may include the correct matching of the client interface parameters with the interface parameters of the server to be adapted. The client obtains the interface parameters of the server to be adapted and sends data information corresponding to its interface to the server, thereby implementing the corresponding function. The interface parameters of the server to be adapted may include the server's interface sequence and interface parameter information.
[0036] In this embodiment, the interface parameters of the server to be adapted can be obtained by accessing the UDDI of the server to be adapted through the client to obtain the interface parameters of the server to be adapted. Taking the above access method to obtain the interface parameters of the server to be adapted as an example, the parsing process of the interface parameters of the server to be adapted is explained. Figure 2 FIG. 1 is a flow chart of a server-side interface parameter parsing method in a protocol transmission interface adaptation method provided by an embodiment of the present invention. Figure 2 As shown, the method includes:
[0037] S111. Obtain the IP address and interface method name of the UDDI server to be adapted;
[0038] S112. Obtain the WSDL definition according to the IP address;
[0039] S113. According to the definition, traverse all bindings and perform data binding;
[0040] S114. Determine a namespace Uri corresponding to at least one bindings based on the Element Type.
[0041] S115. If the namespace Uri is http: / / schemas.xmlsoap.org / wsdl / soap / , parse the bindings using soap1.1 to determine the method name and its corresponding parameter block.
[0042] S116. If the namespace Uri is http: / / schemas.xmlsoap.org / wsdl / soap12 / , parse the bindings using soap1.2 to determine the method name and its corresponding parameter block.
[0043] S117, parsing the parameter block layer by layer to determine the parameters of input, message, and part;
[0044] S118. If the method name is the same as the interface method name, put the method name and the parameters into a map, and determine the type of the map;
[0045] S119. Based on the type of the map, parse the parameter values of the bindings in RPC style or document style.
[0046] Through the above parsing method, the interface sequence and parameter information of the server to be adapted can be obtained.
[0047] S120. Adapt the server interface parameters to be adapted with the candidate server interface parameters in a pre-trained adaptation parameter library according to parameter information of the server interface parameters to be adapted and the candidate server interface parameters, and determine target server interface parameters adapted to the server interface parameters to be adapted from the candidate server interface parameters; wherein the adaptation parameter library includes client interface parameters, at least one candidate server interface parameter, and a mapping relationship between the two.
[0048] The adaptation parameter library includes a mapping relationship that enables successful docking of at least one server-side and client-side interface parameters. Pre-training the adaptation parameter library can be performed by automatically adapting and manually correcting input server-side sample parameters associated with the client-side interface parameters to determine the server-side parameters that are most relevant to the client-side interface parameters. For example, the adaptation parameter library can be trained using the following method:
[0049] Step 1: Get the interface parameters of the server to be adapted.
[0050] Step 2: Adapt the server interface parameters to be adapted to the client parameter library to obtain adapted client interface parameters.
[0051] The client parameter library obtains column names by traversing the client data table, and these column names are stored in the client parameter library. Each parameter has a different real-world meaning. Since the table structure of the client data table does not change frequently, the client parameter library is relatively fixed.
[0052] Step 3: Adapt the server interface parameters to be adapted to the adaptation parameter library, and obtain the adapted client interface parameters according to the client parameter library mapped by the adaptation parameter library.
[0053] It is understandable that if the confidence level of the adapted client interface parameters obtained in the second step meets the preset requirements, the third step is not performed; otherwise, the server interface parameters to be adapted are further adapted to the adaptation parameter library to meet the preset requirements. The preset requirements can be that when the probability of correct adaptation of the client interface parameters and the server interface parameters to be adapted is within a preset confidence interval, the preset confidence level is met. For example, if the probability of correct adaptation is 95%, the confidence level within the confidence interval (93%, 97%) meets the preset confidence level of 0.95.
[0054] Step 4: Adapt the interface parameters of the server to be adapted to the correction parameter library to obtain the adapted interface parameters of the client.
[0055] It is understandable that since the autonomous adaptation process does not necessarily achieve the correct adaptation probability that meets the preset requirements, manual correction is required after autonomous adaptation. For example, if the parameter to be adapted is A, and it is autonomously adapted to B in the client parameter library, but the parameter that actually correctly adapts to parameter A should be C in the client parameter library, manual correction is performed, and the similar features between A and B and the similar features between A and C are stored in the correction parameter library, generating a mapping relationship between parameters A and C.
[0056] Step 5: According to the interface parameters of the adapted client obtained in the above step 4, parameter information of the interface parameters is obtained from the client data table.
[0057] The parameter information may include specific data information of client interface parameters.
[0058] Step 6: According to the interface parameter sequence corresponding to the server, encapsulate the client's parameter information into an HTTP request and send it to the server.
[0059] Step 7: If the interface parameters sent to the server are incorrect, they are manually corrected and the correction results are saved in the correction parameter library. The mapping relationship of the successful docking is updated and saved in the adaptation parameter library.
[0060] In the above-mentioned training method for the adaptation parameter library, the server interface parameters to be adapted can be adapted to the client parameter library and the adaptation parameter library respectively through the EM method; or the server interface parameters to be adapted can be adapted to the client parameter library and the adaptation parameter library respectively through the SAGE algorithm.
[0061] Taking the EM algorithm as an example, it is divided into two steps. The first step is to calculate the expectation (E), using the existing estimated values of the server interface parameters that have not been adapted to calculate the maximum likelihood estimate. The second step is maximization (M). Maximization is to calculate the parameter value using the maximum likelihood value obtained in the E step. The parameter estimate found in the M step is used in the next E step calculation. This process continues until convergence. The specific calculation process is as follows:
[0062] Get a sample set representing the server interface parameters {x (1) ,…,x (m)}, contains m independent samples.
[0063] Among them, the likelihood function L(θ) of the sample set can be determined by the following formula:
[0064]
[0065] Among them, the log-likelihood function H(θ) of the sample set can be determined by the following formula:
[0066]
[0067] Since each sample corresponds to the category z (i) is unknown, so this type of unknown variable is an implicit variable.
[0068] The parameter θ that maximizes the likelihood function is determined by the following formula:
[0069]
[0070] Formula (2) is the product of the numerator and denominator of Formula (1) multiplied by a distribution function Q related to the latent variable. i (z (i) ), Equation (3) is obtained from Equation (2) according to Jensen inequality.
[0071] That is, since the lower bound is convergent, and since the condition for Jensen's inequality to hold is that the random variable is constant, the lower bound of the likelihood function can be determined by the following formula:
[0072]
[0073] Because Q i (z (i) ) is the distribution function of z, so,
[0074]
[0075] After a simple transformation, we can get:
[0076]
[0077] The maximum parameter value θ is determined by the following formula:
[0078]
[0079] Repeat steps E and M until convergence. At this point, each parameter in the client parameter library has a corresponding probability model, and the adaptation parameter library includes parameters that have been trained and successfully connected and mapped to a parameter in the client parameter library.
[0080] In this embodiment, the adaptation parameter library can determine, through pre-training, at least one candidate server interface parameter that is adapted to the server interface parameter. Since the adaptation parameter library adapts the interface parameters of at least one server and determines the mapping relationship for successful docking of the interface parameters of at least one server and client, and each mapping relationship is relatively independent, the candidate server interface parameters in the adaptation parameter library may or may not be adapted to the interface parameters of the server to be adapted. The target server interface parameters that are adapted to the server interface parameters to be adapted are determined from the candidate server interface parameters.
[0081] In this embodiment, the server interface parameters to be adapted are adapted to the candidate server interface parameters in a pre-trained adaptation parameter library based on the parameter information of the interface parameters. Based on the maximum expectation algorithm, the server interface parameters to be adapted are adapted to the candidate server interface parameters in the pre-trained adaptation parameter library based on the parameter information of the interface parameters. Of course, this application is not limited to using the maximum expectation algorithm to adapt the server interface parameters to be adapted to the candidate server interface parameters in the pre-trained adaptation parameter library.
[0082] The maximization expectation algorithm is an algorithm for finding the maximum likelihood estimate or maximum a posteriori estimate of parameters in a conceptual model that relies on unobservable hidden variables. By utilizing the maximization expectation algorithm, data information containing unobservable hidden variables can be observed. For example, based on the maximization expectation algorithm, the likelihood function and distribution probability of the server interface parameters to be adapted are determined, and the lower bound and maximum parameter value are determined based on the likelihood function. The maximum parameter value is then adapted to the candidate server interface parameters in a pre-trained adaptation parameter library.
[0083] S130: Determine the client interface parameters mapped to the target server interface parameters based on the mapping relationship, and establish an adaptation relationship between the server interface parameters to be adapted and the client interface parameters.
[0084] The mapping relationship can be used to determine the client interface parameters that are most compatible with the target server interface parameters. The adapted client interface parameters are used to establish an adaptation relationship with the server interface parameters to be adapted and perform adaptation.
[0085] The embodiment of the present invention obtains server interface parameters to be adapted; adapts the server interface parameters to be adapted with candidate server interface parameters in a pre-trained adaptation parameter library according to parameter information of the interface parameters, and determines target server interface parameters adapted to the server interface parameters to be adapted from the candidate server interface parameters; wherein the adaptation parameter library includes a mapping relationship between client interface parameters and at least one candidate server interface parameter; based on the mapping relationship, determines the client interface parameters mapped to the target server interface parameters, and establishes an adaptation relationship between the server interface parameters to be adapted and the client interface parameters. The embodiment of the present invention can reduce the workload of client code development and enhance the stability of client operation by autonomously adapting the interface parameters of the client and the server.
[0086] Figure 3 This is a flowchart of a protocol transmission interface parameter adaptation method provided by another embodiment of the present invention. This embodiment is further optimized based on the above embodiments as follows: after obtaining the server interface parameters to be adapted, the method further includes: adapting the server interface parameters to be adapted to the client interface parameters according to the parameter information of the server interface parameters to be adapted; if the adaptation is unsuccessful, adapting the server interface parameters to be adapted to the candidate server interface parameters in the pre-trained adaptation parameter library according to the parameter information of the server interface parameters to be adapted and the candidate server interface parameters; if the adaptation is successful, establishing an adaptation relationship between the server interface parameters to be adapted and the client interface parameters. Figure 3 As shown, the method of this embodiment specifically includes the following steps:
[0087] S310: Obtain the server interface parameters to be adapted.
[0088] S320: Adapt the server-side interface parameters to be adapted and the client-side interface parameters according to the parameter information of the server-side interface parameters to be adapted.
[0089] It is understandable that pre-adapting the server interface parameters to be adapted with the client interface parameters instead of directly adapting them with a pre-trained adaptation parameter library can reduce the amount of calculation and optimize the adaptation method of the protocol transmission interface parameters.
[0090] In this embodiment, optionally, the server-side interface parameters to be adapted are adapted to the client-side interface parameters based on the parameter information of the server-side interface parameters to be adapted, including: establishing a probability model of the client-side interface parameters based on a predetermined sample set of server-side interface parameters associated with the client-side interface parameters; and adapting the server-side interface parameters to be adapted to the probability model based on the parameter information of the server-side interface parameters to be adapted.
[0091] The sample set of server-side interface parameters associated with the client-side interface parameters can be automatically or manually acquired from a server-side parameter database. For example, if one of the client-side interface parameters is the interface calling method, the server-side interface parameter information associated with this parameter can be GET, POST, PUT, or DELETE. A probability model of the client-side interface parameters is established for the sample set of server-side interface parameters associated with the client-side interface parameters, the likelihood function of the sample set and its maximum parameter value are determined, and the interface parameters corresponding to the maximum parameter value are adapted to the server-side interface parameters to be adapted.
[0092] S330: If the adaptation is unsuccessful, the server interface parameters to be adapted are adapted with the candidate server interface parameters in the pre-trained adaptation parameter library according to the parameter information of the server interface parameters to be adapted and the candidate server interface parameters, and the process jumps to S250.
[0093] It is understandable that the server interface parameters associated with the client interface parameters may not include interface parameters adapted to the client. Therefore, when adaptation is unsuccessful, adaptation to candidate server interface parameters in a pre-trained adaptation parameter library is required.
[0094] S340: If the adaptation is successful, an adaptation relationship between the server interface parameters to be adapted and the client interface parameters is established.
[0095] S350: Determine target server interface parameters that are adapted to the server interface parameters to be adapted from the candidate server interface parameters.
[0096] S360: Determine the client interface parameters mapped to the target server interface parameters based on the mapping relationship, and establish an adaptation relationship between the server interface parameters to be adapted and the client interface parameters.
[0097] The embodiment of the present invention can reduce the amount of calculation and optimize the adaptation method of the protocol transmission interface parameters by adapting the server interface parameters to be adapted to the client interface parameters according to the parameter information of the server interface parameters to be adapted before adapting the server interface parameters to the candidate server interface parameters in the pre-trained adaptation parameter library.
[0098] In each of the above embodiments, optionally, after determining the client interface parameters mapped to the target server interface parameters based on the mapping relationship, the method further includes: matching from a pre-trained correction parameter library based on similar features between the server interface parameters to be adapted and the client interface parameters, and determining whether the similar features belong to suspicious false positive features; wherein the correction parameter library includes at least one group of false positive features, true positive features and suspicious false positive features with a mapping relationship, the false positive features are similar features between the server interface parameters and the first client interface parameters that are adapted incorrectly, the true positive features are similar features between the server interface parameters and the second client interface parameters that are adapted correctly, and the suspicious false positive features are features that the false positive features have and the true positive features do not have; if the suspicious false positive features are met, the mapped true positive features are determined based on the false positive features; if the suspicious false positive features are met, the true positive features are determined to be true positive features, and the client interface parameters that are correctly adapted to the server interface parameters to be adapted are determined based on the true positive features.
[0099] It's understandable that within the same set of mappings, false positive features include some true positive features and others suspected false positive features. In other words, the suspected false positive features are the difference between the false positive features and the intersection of the false positive features and the true positive features. Some true positive features included in the false positive features are relatively variable, while the suspected false positive features are relatively fixed. Therefore, by determining whether a request meets the suspicious false positive feature criteria, we can determine the correct client interface parameters for adaptation.
[0100] Specifically, the interface parameter to be adapted on the server is A, which is determined to be B in the client parameter library through autonomous adaptation. It is brought into error detection. The similar features of A and B meet the suspicious false positive features. The true positive features of the mapping are determined based on their false positive features. Based on the true positive features, it is determined that the client interface parameter that is correctly adapted to the server interface parameter to be adapted should be parameter C.
[0101] By generating a mapping relationship among false positive features, true positive features, and suspected false positive features and saving them in a correction parameter library, false positive features can be better identified in the next adaptation, thereby improving the accuracy of adaptation.
[0102] In each of the above embodiments, optionally, after establishing the adaptation relationship between the server-side interface parameters to be adapted and the client-side interface parameters, the method further includes: determining the client-side interface parameters to which the server-side interface parameters to be adapted are adapted; obtaining data information corresponding to the server-side interface parameters to be adapted from the client data table according to the adapted client-side interface parameters; and encapsulating the data information and sending it to the server in the order of the interface parameters of the server-side interface parameters to be adapted on the server-side to be adapted.
[0103] Specifically, assuming that the interface parameters to be adapted on the server are 1, 2, and 3, and the interface parameters to be adapted on the client are D, E, and F, respectively, obtain the data information d, e, and f corresponding to D, E, and F according to the client data table, and encapsulate the data information and send it to the server in the order of the interface parameters to be adapted on the server.
[0104] It is understandable that for interface parameters with the same practical significance, that is, the correct mapping relationship between the client and server interface parameters, the corresponding data information in the client data table may be different from what the server expects. Therefore, the data information format of the client data table corresponding to each server interface parameter can be converted and then encapsulated and sent to the server. Figure 4 FIG. 1 is a flow chart of a method for sending data information in a method for adapting protocol transmission interface parameters provided by another embodiment of the present invention. Figure 4 As shown, the method includes: obtaining the corresponding specific value data in the client parameter data table according to the interface parameters of the adapted client parameter library; converting data into param according to the conversion rules of the client and server; initializing call and setting the upload address and timeout period; inputting the client interface parameters and specific value param according to cal1 sequence; calling invoke to start sending.
[0105] In the above embodiments, optionally, after establishing the adaptation relationship between the server interface parameters to be adapted and the client interface parameters, the method further includes: updating the adaptation parameter library according to the adaptation relationship.
[0106] Specifically, after establishing the adaptation relationship between the server interface parameters to be adapted and the client interface parameters, the adaptation relationship is added to the adaptation parameter library, and the mapping relationship between the client interface parameters and the candidate server interface parameters in the adaptation parameter library is updated.
[0107] Figure 5 FIG. 1 is a schematic diagram of the structure of the protocol transmission interface parameter adaptation device provided by an embodiment of the present invention. This embodiment is applicable to the case where the protocol transmission interface is autonomously adapted. Figure 5 As shown, the device includes:
[0108] The server parameter acquisition module 510 is used to obtain the server interface parameters to be adapted;
[0109] A parameter adaptation module 520 is configured to adapt the server interface parameters to be adapted to candidate server interface parameters in a pre-trained adaptation parameter library based on parameter information of the server interface parameters to be adapted and the candidate server interface parameters, and determine target server interface parameters adapted to the server interface parameters to be adapted from the candidate server interface parameters; wherein the adaptation parameter library includes client interface parameters, at least one candidate server interface parameter, and a mapping relationship between the two;
[0110] The first adaptation relationship establishing module 530 is configured to determine the client interface parameters mapped to the target server interface parameters based on the mapping relationship, and establish an adaptation relationship between the server interface parameters to be adapted and the client interface parameters.
[0111] The embodiment of the present invention obtains server interface parameters to be adapted; adapts the server interface parameters to be adapted with candidate server interface parameters in a pre-trained adaptation parameter library according to parameter information of the interface parameters, and determines target server interface parameters adapted to the server interface parameters to be adapted from the candidate server interface parameters; wherein the adaptation parameter library includes a mapping relationship between client interface parameters and at least one candidate server interface parameter; based on the mapping relationship, determines the client interface parameters mapped to the target server interface parameters, and establishes an adaptation relationship between the server interface parameters to be adapted and the client interface parameters. The embodiment of the present invention can reduce the workload of client code development and enhance the stability of client operation by autonomously adapting the interface parameters of the client and the server.
[0112] Furthermore, the protocol transmission interface parameter adaptation device also includes:
[0113] A first adaptation module is configured to, after acquiring the server interface parameters to be adapted, adapt the server interface parameters to be adapted to the client interface parameters according to parameter information of the server interface parameters to be adapted;
[0114] A second adaptation module is configured to adapt the server interface parameters to be adapted with candidate server interface parameters in a pre-trained adaptation parameter library according to parameter information of the server interface parameters to be adapted and the candidate server interface parameters if the adaptation is unsuccessful;
[0115] The second adaptation relationship establishing module is used to establish an adaptation relationship between the to-be-adapted server interface parameters and the client interface parameters if the adaptation is successful.
[0116] Furthermore, the first adaptation module includes:
[0117] A probability model building unit, configured to build a probability model of the client interface parameters based on a predetermined sample set of server interface parameters associated with the client interface parameters;
[0118] The first parameter adaptation unit is configured to adapt the server interface parameter to be adapted to the probability model according to parameter information of the server interface parameter to be adapted.
[0119] Furthermore, the protocol transmission interface parameter adaptation method further includes:
[0120] A feature correction module is used to, after determining the client interface parameters mapped to the target server interface parameters based on the mapping relationship, match the similar features between the server interface parameters to be adapted and the client interface parameters from a pre-trained correction parameter library to determine whether the similar features belong to suspicious false positive features; wherein the correction parameter library includes at least one group of false positive features, true positive features and suspicious false positive features with a mapping relationship, the false positive features are similar features between the server interface parameters and the first client interface parameters that are incorrectly adapted, the true positive features are similar features between the server interface parameters and the second client interface parameters that are correctly adapted, and the suspicious false positive features are features that the false positive features have but the true positive features do not have;
[0121] The third adaptation module is used to determine the mapped true positive features based on the false positive features if it meets the suspicious false positive features; if it does not meet the suspicious false positive features, it is determined to be a true positive feature, and the client interface parameters that are correctly adapted to the server interface parameters to be adapted are determined based on the true positive features.
[0122] Furthermore, the protocol transmission interface parameter adaptation method further includes:
[0123] A client parameter determination module, configured to determine the client interface parameters to be adapted by the server interface parameters to be adapted after establishing an adaptation relationship between the server interface parameters to be adapted and the client interface parameters;
[0124] A data information acquisition module, configured to acquire data information corresponding to the server interface parameters to be adapted from a client data table according to the adapted client interface parameters;
[0125] The information sending module is used to encapsulate the data information and send it to the server according to the interface parameter sequence of the server to be adapted interface parameters on the server to be adapted.
[0126] Furthermore, the protocol transmission interface parameter adaptation method further includes:
[0127] The parameter library updating module is used to update the adaptation parameter library according to the adaptation relationship after establishing the adaptation relationship between the server interface parameters to be adapted and the client interface parameters.
[0128] The protocol transmission interface parameter adaptation device provided in the embodiment of the present invention can execute the protocol transmission interface parameter adaptation method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of executing the protocol transmission interface parameter adaptation method.
[0129] Figure 6 This is a structural diagram of an electronic device provided in Example 3 of the present invention. Figure 6 A block diagram of an exemplary electronic device 12 suitable for implementing embodiments of the present invention is shown. Figure 6 The electronic device 12 shown is only an example and should not limit the functionality and scope of use of the embodiments of the present invention.
[0130] like Figure 6 As shown, electronic device 12 is implemented as a general-purpose computing device. Components of electronic device 12 may include, but are not limited to, one or more processors or processing units 16, system memory 28, and a bus 18 connecting various system components (including system memory 28 and processing unit 16).
[0131] Bus 18 represents one or more of several types of bus structures, including a storage device bus or storage device controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. Examples of these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0132] The electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 12, including volatile and non-volatile media, removable and non-removable media.
[0133] The system storage device 28 may include computer system readable media in the form of volatile storage devices, such as random access memory devices (RAM) 30 and / or cache memory devices 32. The electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 6Not shown, often called a "hard drive"). Although Figure 6 Although not shown, a magnetic disk drive for reading and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. Storage device 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of various embodiments of the present invention.
[0134] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in storage device 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may include an implementation of a network environment. Program modules 42 generally implement the functions and / or methods of the embodiments described herein.
[0135] The electronic device 12 may also communicate with one or more external devices 14 (e.g., a keyboard, a pointing device, a display 24, etc.), one or more devices that enable a user to interact with the device 12, and / or any device that enables the device 12 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication may be performed through an input / output (I / O) interface 22. Furthermore, the electronic device 12 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 20. Figure 3 As shown, the network adapter 20 communicates with other modules of the electronic device 12 via the bus 18. Figure 6 Not shown, other hardware and / or software modules may be used in conjunction with the electronic device 12, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0136] The processing unit 16 executes various functional applications and data processing by running programs stored in the system storage device 28, such as implementing the protocol transmission interface parameter adaptation method provided in an embodiment of the present invention, including:
[0137] Get the server interface parameters to be adapted;
[0138] Adapting the server interface parameters to be adapted with candidate server interface parameters in a pre-trained adaptation parameter library according to parameter information of the interface parameters, and determining target server interface parameters adapted to the server interface parameters to be adapted from the candidate server interface parameters; wherein the adaptation parameter library includes a mapping relationship between the client interface parameters and at least one candidate server interface parameter;
[0139] The client interface parameters mapped to the target server interface parameters are determined based on the mapping relationship, and an adaptation relationship between the server interface parameters to be adapted and the client interface parameters is established.
[0140] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the method for adapting protocol transmission interface parameters provided in an embodiment of the present invention is implemented, including:
[0141] Get the server interface parameters to be adapted;
[0142] Adapting the server interface parameters to be adapted with candidate server interface parameters in a pre-trained adaptation parameter library according to parameter information of the interface parameters, and determining target server interface parameters adapted to the server interface parameters to be adapted from the candidate server interface parameters; wherein the adaptation parameter library includes a mapping relationship between the client interface parameters and at least one candidate server interface parameter;
[0143] The client interface parameters mapped to the target server interface parameters are determined based on the mapping relationship, and an adaptation relationship between the server interface parameters to be adapted and the client interface parameters is established.
[0144] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. Computer-readable media can be computer-readable signal media or computer-readable storage media. Computer-readable storage media can be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or components, or any combination thereof. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by an instruction execution system, device or device or used in combination with it.
[0145] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0146] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0147] The computer program code for performing the operations of the present invention can be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0148] Note that the above are only preferred embodiments of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments, and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments and may include many other equivalent embodiments without departing from the concept of the present invention. The scope of the present invention is determined by the scope of the appended claims.
Claims
1. A method for adapting protocol transmission interface parameters, characterized in that: include: Get the server interface parameters to be adapted; Adapting the server interface parameters to be adapted with candidate server interface parameters in a pre-trained adaptation parameter library based on parameter information of the server interface parameters to be adapted and the candidate server interface parameters, and determining target server interface parameters adapted to the server interface parameters to be adapted from the candidate server interface parameters; wherein, based on a maximization expectation algorithm, adapting the server interface parameters to be adapted with candidate server interface parameters in a pre-trained adaptation parameter library based on parameter information of the interface parameters, the adaptation parameter library including client interface parameters, at least one candidate server interface parameter, and a mapping relationship between the two; Determining the client interface parameters mapped to the target server interface parameters based on the mapping relationship, and establishing an adaptation relationship between the server interface parameters to be adapted and the client interface parameters; After obtaining the server interface parameters to be adapted, the method further includes: Adapting the server interface parameters to be adapted to the client interface parameters according to the parameter information of the server interface parameters to be adapted; If the adaptation is unsuccessful, adapting the server interface parameters to be adapted with the candidate server interface parameters in the pre-trained adaptation parameter library according to the parameter information of the server interface parameters to be adapted and the candidate server interface parameters; If the adaptation is successful, an adaptation relationship between the server interface parameters to be adapted and the client interface parameters is established.
2. The method according to claim 1, characterized in that Adapting the server interface parameters to be adapted and the client interface parameters according to the parameter information of the server interface parameters to be adapted includes: Establishing a probability model of the client interface parameters based on a predetermined sample set of server interface parameters associated with the client interface parameters; The server interface parameters to be adapted are adapted to the probability model according to parameter information of the server interface parameters to be adapted.
3. The method according to claim 1, characterized in that After determining the client interface parameters mapped to the target server interface parameters based on the mapping relationship, the method further includes: Based on the similar features between the server interface parameters to be adapted and the client interface parameters, matching is performed from a pre-trained correction parameter library to determine whether the similar features belong to suspicious false positive features; wherein the correction parameter library includes at least one set of false positive features, true positive features, and suspicious false positive features having a mapping relationship, the false positive features are similar features between the server interface parameters and the first client interface parameters that were incorrectly adapted, the true positive features are similar features between the server interface parameters and the second client interface parameters that were correctly adapted, and the suspicious false positive features are features that the false positive features have but the true positive features do not have; If it meets the suspicious false positive feature, the mapped true positive feature is determined based on the false positive feature; if it does not meet the suspicious false positive feature, it is determined to be a true positive feature, and the client interface parameters that are correctly adapted to the server interface parameters to be adapted are determined based on the true positive feature.
4. The method according to claim 1, wherein After establishing the adaptation relationship between the server interface parameters to be adapted and the client interface parameters, the method further includes: Determining the client interface parameters to which the server interface parameters to be adapted are adapted; According to the adapted client interface parameters, acquiring data information corresponding to the to-be-adapted server interface parameters from the client data table; The data information is encapsulated and sent to the server according to the interface parameter order of the server to be adapted interface parameter on the server to be adapted.
5. The method according to claim 1, wherein After establishing the adaptation relationship between the server interface parameters to be adapted and the client interface parameters, the method further includes: The adaptation parameter library is updated according to the adaptation relationship.
6. A protocol transmission interface parameter adaptation device, characterized in that: include: The server parameter acquisition module is used to obtain the parameters of the server interface to be adapted; a parameter adaptation module, configured to adapt the server interface parameters to be adapted with candidate server interface parameters in a pre-trained adaptation parameter library based on parameter information of the server interface parameters to be adapted and the candidate server interface parameters, and determine target server interface parameters adapted to the server interface parameters to be adapted from the candidate server interface parameters; wherein, based on a maximization expectation algorithm, the server interface parameters to be adapted are adapted with candidate server interface parameters in a pre-trained adaptation parameter library based on parameter information of the interface parameters, the adaptation parameter library including client interface parameters, at least one candidate server interface parameter, and a mapping relationship between the two; a first adaptation relationship establishing module, configured to determine the client interface parameters mapped to the target server interface parameters based on the mapping relationship, and establish an adaptation relationship between the server interface parameters to be adapted and the client interface parameters; The device further comprises: A first adaptation module is configured to, after acquiring the server interface parameters to be adapted, adapt the server interface parameters to be adapted to the client interface parameters according to parameter information of the server interface parameters to be adapted; A second adaptation module is configured to adapt the server interface parameters to be adapted with candidate server interface parameters in a pre-trained adaptation parameter library according to parameter information of the server interface parameters to be adapted and the candidate server interface parameters if the adaptation is unsuccessful; The second adaptation relationship establishing module is used to establish an adaptation relationship between the server interface parameters to be adapted and the client interface parameters to be adapted if the adaptation is successful.
7. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the protocol transmission interface parameter adaptation method as described in any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method for adapting protocol transmission interface parameters as described in any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Parameter mapping method and device, storage medium, interface calling platform and service system
CN112579312A
Brokering semantics between web services
US20030163450A1