[go: up one dir, main page]

CN116233030B - Interface interaction method and device - Google Patents

Interface interaction method and device

Info

Publication number
CN116233030B
CN116233030B CN202211698837.9A CN202211698837A CN116233030B CN 116233030 B CN116233030 B CN 116233030B CN 202211698837 A CN202211698837 A CN 202211698837A CN 116233030 B CN116233030 B CN 116233030B
Authority
CN
China
Prior art keywords
target
data
interface
target data
interface interaction
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211698837.9A
Other languages
Chinese (zh)
Other versions
CN116233030A (en
Inventor
廖凌浩
刘博�
樊华
芦玉
马宇
巴战辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Telecom Corp Ltd
Original Assignee
China Telecom Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Telecom Corp Ltd filed Critical China Telecom Corp Ltd
Priority to CN202211698837.9A priority Critical patent/CN116233030B/en
Publication of CN116233030A publication Critical patent/CN116233030A/en
Application granted granted Critical
Publication of CN116233030B publication Critical patent/CN116233030B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/30Peripheral units, e.g. input or output ports
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1014Server selection for load balancing based on the content of a request
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/08Protocols for interworking; Protocol conversion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/54Store-and-forward switching systems 
    • H04L12/56Packet switching systems
    • H04L12/5601Transfer mode dependent, e.g. ATM
    • H04L2012/5619Network Node Interface, e.g. tandem connections, transit switching
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Transfer Between Computers (AREA)
  • Computer And Data Communications (AREA)
  • Storage Device Security (AREA)

Abstract

本申请公开了一种接口交互方法及装置。其中,该方法包括:目标引擎接收源服务器传输的请求信息,请求信息中至少包括:请求数据和接口交互规则;基于接口交互规则将请求数据转化成目标接口要求的第一目标格式的目标数据,并根据目标接口的要求对目标数据进行处理,得到处理后的目标数据,并将处理后的目标数据通过目标接口发送到目标服务器中;接收目标服务器返回的响应数据,并将响应数据按照接口交互规则中的第二目标格式发送给源服务器。本申请至少解决了在接口交互过程中由于需要开发对接代码导致交互效率低的技术问题。

The present application discloses an interface interaction method and device. The method includes: a target engine receives request information transmitted by a source server, wherein the request information includes at least request data and interface interaction rules; based on the interface interaction rules, the request data is converted into target data in a first target format required by the target interface, and the target data is processed according to the requirements of the target interface to obtain processed target data, and the processed target data is sent to the target server through the target interface; response data returned by the target server is received, and the response data is sent to the source server in a second target format in the interface interaction rules. The present application at least solves the technical problem of low interaction efficiency due to the need to develop docking code during the interface interaction process.

Description

Interface interaction method and device
Technical Field
The application relates to the technical field of computers, in particular to an interface interaction method and device.
Background
In industry application, in order to improve the security of interface interaction, in the process of executing interface interaction by adopting a general technology, a signature value and an encryption and decryption mechanism of a certain rule are added besides the format of appointed request data and response data so as to ensure the security of interface call. Based on the rules, when interface interfacing is executed with a partner, a common method is to first output an interface document, and the details of the interface address, the request mode, the data format, the signature calculation rule, the encryption and decryption algorithm and the related key acquisition mode are described. The technical party is required to develop a set of docking codes according to the document. However, the customized docking mode has obvious defects when being applied to the ecological platform to access any third party manufacturer application products, and particularly, the mode that the ecological platform side technician executes customization according to the third party manufacturer application interface specification cannot quickly support any third party manufacturer application products to access the ecological platform, and if the third party application technician executes customization according to the ecological platform interface specification, the workload is increased for the third party application manufacturer, and the attraction of the ecological platform is reduced.
Disclosure of Invention
The embodiment of the application provides an interface interaction method and device, which at least solve the technical problem of low interaction efficiency caused by the need of developing a docking code in the interface interaction process.
According to one aspect of the embodiment of the application, an interface interaction method is provided, which comprises the steps that a target engine receives request information transmitted by an origin server, the request information at least comprises request data and interface interaction rules, the request data are converted into target data in a first target format required by a target interface based on the interface interaction rules, the target data are processed according to the requirements of the target interface, the processed target data are obtained, the processed target data are sent to the origin server through the target interface, response data returned by the origin server are received, and the response data are sent to the origin server according to a second target format in the interface interaction rules.
Optionally, the method comprises the steps of converting the request data into target data in a first target format required by a target interface based on the interface interaction rule, wherein the method comprises the steps of determining a mapping relation between a first field in the request data and a second field in the response data, extracting the first target format from the interface interaction rule, and converting the request data and the mapping relation into the target data according to the first target format, wherein data values of the target data are assembled according to a node path, and preset characters in the node path are used for representing hierarchical relations among the target data fields.
Optionally, after obtaining the target data, the method further comprises determining address information of the target interface from the interface interaction rules.
Optionally, processing the target data according to the requirement of the target interface to obtain processed target data, wherein the requirement at least comprises one of encrypting the target data, constructing a signature value for a data value corresponding to the target data, generating an anti-replay value for the data value corresponding to the target data, extracting a corresponding processing mode from the interface interaction rule according to the requirement of the target interface, and processing the target data to obtain the processed target data.
Optionally, extracting a corresponding processing mode from the interface interaction rule according to the requirement of the target interface, and processing the target data to obtain processed target data, wherein the processing mode comprises the steps of selecting an encryption rule from the interaction rule to encrypt the target data when the requirement of the target interface is to encrypt the target data, selecting an encryption rule from the interaction rule to encrypt the data corresponding to the target data to obtain a corresponding signature value when the requirement of the target interface is to construct the signature value for the data corresponding to the target data, and selecting an encryption rule from the interaction rule to encrypt the data corresponding to the target data to obtain the corresponding signature value when the requirement of the target interface is to generate an anti-replay value for the data corresponding to the target data, and selecting a target algorithm to generate the corresponding anti-replay value from the interaction rule.
Optionally, the sending the processed target data to the target server through the target interface includes sending the processed target data to the target interface through a preset action, and transmitting the processed target data to the target server through the target interface.
Optionally, the response data is sent to the source server according to a second target format in the interface interaction rule, and the method comprises the steps of extracting data values corresponding to the target data in the response data according to a mapping relation, completing analysis of the response data according to a node path mode, and sending the response data after analysis to the source server according to the second target format required by the source server in the interface interaction rule.
According to another aspect of the embodiment of the application, the interface interaction device further provides an interface interaction device, which comprises a receiving module, a processing module and a response module, wherein the receiving module is used for receiving request information transmitted by an origin server, the request information at least comprises request data and interface interaction rules, the processing module is used for converting the request data into target data in a first target format required by a target interface based on the interface interaction rules, processing the target data according to the requirements of the target interface to obtain processed target data, sending the processed target data to the origin server through the target interface, and the response module is used for receiving response data returned by the origin server and sending the response data to the origin server according to a second target format in the interface interaction rules.
According to still another aspect of the embodiment of the present application, there is further provided a nonvolatile storage medium, in which a program is stored, where a device in which the nonvolatile storage medium is controlled to execute the above-described interface interaction method when the program runs.
According to still another aspect of the embodiment of the present application, there is also provided a computer device including a memory and a processor, where the processor is configured to execute a program stored in the memory, and the program executes the interface interaction method.
In the embodiment of the application, a target engine is adopted to receive request information transmitted by an origin server, the request information at least comprises request data and interface interaction rules, the request data is converted into target data in a first target format required by a target interface based on the interface interaction rules, the target data is processed according to the requirements of the target interface, the processed target data is obtained and is transmitted to the target server through the target interface, response data returned by the target server is received, the response data is transmitted to the origin server according to a second target format in the interface interaction rules, the request data is converted into the target data in the first target format required by the target interface through the target engine, the target data is transmitted to the target server through the target interface after the target data is processed according to the requirements of the target interface, the response data is returned, the aim of avoiding programming a butt joint code is achieved, and the technical effect of improving the interface interaction efficiency is achieved, and the technical problem of low interaction efficiency caused by the need of developing the butt joint code in the interface interaction process is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute a limitation on the application. In the drawings:
fig. 1 is a block diagram of a hardware structure of a computer terminal (or mobile device) for an interface interaction method according to an embodiment of the present application;
FIG. 2 is a flow chart of an interface interaction method according to the present application;
fig. 3 is a schematic structural diagram of an alternative interface interaction device according to an embodiment of the present application.
Detailed Description
In order that those skilled in the art will better understand the present application, a technical solution in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present application without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer executable instructions, and that although a logical order is illustrated in the flowcharts, in some cases the steps illustrated or described may be performed in an order other than that illustrated herein.
The method embodiments provided by the embodiments of the present application may be performed in a mobile terminal, a computer terminal, or similar computing device. Fig. 1 shows a block diagram of a hardware architecture of a computer terminal (or mobile device) for implementing an interface interaction method. As shown in fig. 1, the computer terminal 10 (or mobile device 10) may include one or more (102 a, 102b are shown here), 102 n), a processor 102 (the processor 102 may include, but is not limited to, a microprocessor MCU or a processing device such as a programmable logic device FPGA), a memory 104 for storing data, and a transmission module 106 for communication functions. Among other things, a display, an input/output interface (I/O interface), a Universal Serial BUS (USB) port (which may be included as one of the ports of the BUS BUS), a network interface, a power supply, and/or a camera. It will be appreciated by those of ordinary skill in the art that the configuration shown in fig. 1 is merely illustrative and is not intended to limit the configuration of the electronic device described above. For example, the computer terminal 10 may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
It should be noted that the one or more processors 102 and/or other data processing circuits described above may be referred to generally herein as "data processing circuits. The data processing circuit may be embodied in whole or in part in software, hardware, firmware, or any other combination. Furthermore, the data processing circuitry may be a single stand-alone processing module, or incorporated, in whole or in part, into any of the other elements in the computer terminal 10 (or mobile device). As referred to in embodiments of the application, the data processing circuit acts as a processor control (e.g., selection of the path of the variable resistor termination connected to the interface).
The memory 104 may be used to store software programs and modules of application software, such as program instructions/data storage devices corresponding to the interface interaction method in the embodiment of the present application, and the processor 102 executes the software programs and modules stored in the memory 104, thereby executing various functional applications and data processing, that is, implementing the interface interaction method described above. Memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission means 106 is arranged to receive or transmit data via a network. The specific examples of the network described above may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC) that can connect to other network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module for communicating with the internet wirelessly.
The display may be, for example, a touch screen type Liquid Crystal Display (LCD) that may enable a user to interact with a user interface of the computer terminal 10 (or mobile device).
In the above operating environment, the embodiment of the present application provides an interface interaction method, as shown in fig. 2, where the method includes the following steps:
step S202, a target engine receives request information transmitted by a source server, wherein the request information at least comprises request data and interface interaction rules;
step S204, converting the request data into target data in a first target format required by a target interface based on the interface interaction rule, processing the target data according to the requirement of the target interface to obtain processed target data, and sending the processed target data to a target server through the target interface;
step S206, receiving response data returned by the target server, and sending the response data to the source server according to a second target format in the interface interaction rule.
Through the steps, the target data can be transmitted to the target server through the target interface and the response data is returned, so that the aim of avoiding writing the docking code is fulfilled, the technical effect of improving the interface interaction efficiency is realized, and the technical problem of low interaction efficiency caused by the fact that the docking code needs to be developed in the interface interaction process is solved.
In the related art, the interface interaction has two forms, namely an interface formulated by adopting a REST API form and an interface formulated by adopting a WEB SERVICE form, and in order to improve the safety of interface interaction in industrial application, in the process of executing interface interaction by adopting the two technologies, a signature value and an encryption and decryption mechanism of a certain rule are added besides the formats of appointed request data and response data so as to ensure the safety of interface call. The interface interaction generally adopts GET, POST, PUT, DELETE and other request modes, the formats of request data and response data generally adopt XML, JSON, INI and other formats, the signature mechanism generally orders the request parameters and request heads transmitted by the interface according to a certain rule to form a character string, and encryption is performed by adopting MD5, SHA256 and other algorithms agreed on the two sides to generate a signature value, wherein the encryption and decryption mechanism generally adopts symmetric encryption and decryption, asymmetric encryption and decryption, national encryption and decryption, digital envelope encryption and decryption and other algorithms to execute encryption and decryption of data contents.
In step S204, a first target format, including but not limited to JSON format, XML format, INI format or other custom canonical format, the interaction rules include but are not limited to request protocol, domain name, interface address, request data format, request mode and interface signature mode.
Steps S202 to S206 are described below by specific examples.
In an optional mode, the method for converting the request data into the target data in the first target format required by the target interface based on the interface interaction rule comprises the steps of determining a mapping relation between a first field in the request data and a second field in the response data, extracting the first target format from the interface interaction rule, and converting the request data and the mapping relation into the target data according to the first target format, wherein data values of the target data are assembled according to a node path mode, and preset characters in the node path are used for representing hierarchical relations among the target data fields.
Specifically, a request data assembler in the target engine is utilized to assemble the request data required by the target interface according to the specified specification. The method comprises the steps of encrypting request data and a request data head by using an encryption device through a specified encryption algorithm, assembling the request data by using a format assembler through a first target format (XML, JSON, INI or a self-defined format), and assembling corresponding data values by using a node path.
In the assembly process, matching is performed according to the mapping relation of the data fields of the two interactive sides of the interface, and the structure assembly is completed according to the node path expression.
It should be noted that, the node path expression adopts a preset character "," represents a hierarchical relationship between fields, for example, "x.y.z" represents a z field under a y level under an x level.
The request header assembler is utilized to add custom request header.
In some embodiments of the present application, after obtaining the target data, address information of the target interface needs to be determined from the interface interaction rule.
In an actual application scenario, a protocol setter in the target engine, which designates an interface request mode, and a domain name setter, which designates an interface domain name, may be adopted.
Processing the target data according to the requirements of the target interface, and obtaining the processed target data comprises the following specific steps:
the method comprises the steps of determining the requirements of the target interface, wherein the requirements at least comprise one of encrypting the target data, constructing a signature value for a data value corresponding to the target data, generating an anti-replay value for the data value corresponding to the target data, extracting a corresponding processing mode from the interface interaction rule according to the requirements of the target interface, and processing the target data to obtain the processed target data.
In an alternative manner, in the case that the target interface requires that the target data is encrypted, an encryption rule is selected from the interaction rules to encrypt the target data, for example, a parameter sequencer in a target engine is used to perform sequencing on the request data according to a specified field name ascending order, a field name reverse order or a custom mode, and serialize the sequenced request data into a character string.
Under the condition that the requirement of the target interface is to construct a signature value for a data value corresponding to the target data, an encryption rule is selected from the interaction rule to encrypt the data value corresponding to the target data to obtain a corresponding signature value, for example, a request data body is encrypted by a designated encryption algorithm for a request data head to generate the signature value, and an optional interface signature mode is that after the request data is arranged in ascending order according to a text dictionary sequence, the request data is spliced into a character string form of 'a=xx & b=xx', MD5 encoding is adopted to generate the signature value, and a signature parameter is added in a parameter list to serve as the signature value, and other different modes can be used, which are not repeated herein.
And under the condition that the requirement of the target interface is to generate an anti-replay value for the data value corresponding to the target data, selecting a target algorithm from the interaction rule to generate the corresponding anti-replay value, for example, adopting UUID values, time stamps, snowflake IDs and other algorithms to generate unique values for anti-replay processing.
And sending the processed target data to the target interface through a preset action, and transmitting the processed target data to the target server through the target interface.
The preset actions include GET, PUT, POST, DELETE and the like.
The response data is sent to the source server according to a second target format in the interface interaction rule, and the method specifically comprises the steps of extracting data values corresponding to the target data in the response data according to a mapping relation, completing analysis of the response data according to a node path mode, and sending the response data after analysis to the source server according to the second target format required by the source server in the interface interaction rule.
For example, a format parser in the target engine is used for parsing response data by adopting XML, JSON, INI or a self-defined format to form a grammar tree, a node path is used for extracting corresponding data values, matching is performed according to the mapping relation of data fields of the two interaction sides of an interface in the parsing process, structural parsing is completed according to a node path expression, the node path expression adopts a hierarchy relation between fields, such as 'x.y.z' represents a z field under a y level under the x level, a decryptor in the target engine is used for decrypting response data bodies by adopting a designated decryption algorithm on response data heads, and a structural reconstructor in the target engine is used for packaging the obtained plaintext response data values into a second target format (XML, JSON, INI or a self-defined data structure) and returning.
It should be noted that, the multiple processors in the target engine may each provide an extended method library, for example, an encryptor corresponding to an encryption algorithm library, a decryptor corresponding to a decryption algorithm library, a DES, AES, RSA, SM, a digital envelope encryption and decryption algorithm, a format assembler corresponding to a format assembling method, a XML, JSON, INI, YML and a custom text format generating method, and a signature constructor corresponding to a signature algorithm library, a MD5, SHA256 and a custom signature generating method.
The method in the method library corresponding to each processor is endowed with a unique identification, and the identification is defined in the interface interaction rule and used for matching corresponding processing logic.
The embodiment of the application provides an interface interaction device, as shown in fig. 3, which comprises a receiving module 30, a processing module 32 and a sending module 34, wherein the receiving module is used for receiving request information transmitted by an origin server, the request information at least comprises request data and interface interaction rules, the processing module 32 is used for converting the request data into target data in a first target format required by a target interface based on the interface interaction rules, processing the target data according to the requirements of the target interface to obtain processed target data, sending the processed target data to the origin server through the target interface, and the sending module 34 is used for receiving response data returned by the origin server and sending the response data to the origin server according to a second target format in the interface interaction rules.
The processing module 32 includes a conversion sub-module, an address sub-module and a processing sub-module, wherein the conversion sub-module is configured to determine a mapping relationship between a first field in the request data and a second field in the response data, extract the first target format from the interface interaction rule, and convert the request data and the mapping relationship into the target data according to the first target format, where data values of the target data are assembled according to a node path, and preset characters in the node path are used to represent a hierarchical relationship between the target data fields.
And the address sub-module is used for determining the address information of the target interface from the interface interaction rule.
The processing sub-module is used for determining the requirement of the target interface, wherein the requirement at least comprises one of encrypting the target data, constructing a signature value for a data value corresponding to the target data, generating an anti-replay value for the data value corresponding to the target data, extracting a corresponding processing mode from the interface interaction rule according to the requirement of the target interface, and processing the target data to obtain the processed target data.
The processing sub-module comprises a processing unit and a sending unit, wherein the processing unit is used for selecting an encryption rule from the interaction rule to encrypt the target data when the target interface is required to encrypt the target data, selecting the encryption rule from the interaction rule to encrypt the data value corresponding to the target data to obtain a corresponding signature value when the target interface is required to construct the signature value for the data value corresponding to the target data, and selecting a target algorithm from the interaction rule to generate the corresponding anti-replay value when the target interface is required to generate the anti-replay value for the data value corresponding to the target data.
And the sending unit is used for sending the processed target data to the target interface through a preset action and transmitting the processed target data to the target server through the target interface.
The response module 34 includes a response sub-module, which is configured to extract a data value corresponding to the target data in the response data according to a mapping relationship, complete analysis of the response data according to a node path, and send the response data after the analysis to the source server according to a second target format required by the source server in the interface interaction rule.
According to still another aspect of the embodiment of the present application, there is further provided a nonvolatile storage medium, in which a program is stored, where a device in which the nonvolatile storage medium is controlled to execute the above-described interface interaction method when the program runs.
According to still another aspect of the embodiment of the present application, there is also provided a computer device including a memory and a processor, where the processor is configured to execute a program stored in the memory, and the program executes the interface interaction method described above.
It should be noted that each module in the interface interaction device may be a program module (for example, a set of program instructions for implementing a specific function), or may be a hardware module, and for the latter, it may be expressed in a form, but is not limited to, that each module is expressed in a form of one processor, or the functions of each module are implemented by one processor.
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.
In the foregoing embodiments of the present application, the descriptions of the embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed technology may be implemented in other manners. The above-described embodiments of the apparatus are merely exemplary, and the division of units may be a logic function division, and there may be another division manner in actual implementation, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interfaces, units or modules, or may be in electrical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be essentially or a part contributing to the related art or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of the embodiments of the present application. The storage medium includes a U disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a removable hard disk, a magnetic disk, or an optical disk, etc. which can store the program code.
The foregoing is merely a preferred embodiment of the present application and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present application, which are intended to be comprehended within the scope of the present application.

Claims (8)

1. An interface interaction method, comprising:
The target engine receives request information transmitted by the source server, wherein the request information at least comprises request data and interface interaction rules;
Converting the request data into target data in a first target format required by a target interface based on the interface interaction rule, processing the target data according to the requirement of the target interface to obtain processed target data, and sending the processed target data to a target server through the target interface;
receiving response data returned by the target server, and sending the response data to the source server according to a second target format in the interface interaction rule;
The method comprises the steps of converting request data into target data in a first target format required by a target interface based on an interface interaction rule, determining a mapping relation between a first field in the request data and a second field in response data, extracting the first target format from the interface interaction rule, converting the request data and the mapping relation into the target data according to the first target format, wherein data values of the target data are assembled according to a node path, and preset characters in the node path are used for representing hierarchical relations among target data fields;
and after the target data is obtained, determining the address information of the target interface from the interface interaction rule.
2. The method of claim 1, wherein processing the target data according to the requirements of the target interface to obtain processed target data comprises:
the method comprises the steps of determining the requirement of a target interface, wherein the requirement of the target interface at least comprises one of encrypting target data, constructing a signature value for a data value corresponding to the target data and generating an anti-replay value for the data value corresponding to the target data;
and extracting a corresponding processing mode from the interface interaction rule according to the requirement of the target interface, and processing the target data to obtain the processed target data.
3. The method of claim 2, wherein extracting a corresponding processing manner from the interface interaction rule according to the requirement of the target interface, and processing the target data to obtain the processed target data, includes:
under the condition that the target interface is required to encrypt the target data, selecting an encryption rule from the interaction rules to encrypt the target data;
Under the condition that the requirement of the target interface is to construct a signature value for the data value corresponding to the target data, selecting an encryption rule from the interaction rule to encrypt the data value corresponding to the target data to obtain the corresponding signature value;
And under the condition that the requirement of the target interface is to generate an anti-replay value for the data value corresponding to the target data, selecting a target algorithm from the interaction rule to generate the corresponding anti-replay value.
4. The method of claim 2, wherein sending the processed target data to a target server via the target interface comprises:
And sending the processed target data to the target interface through a preset action, and transmitting the processed target data to the target server through the target interface.
5. The method of claim 1, wherein transmitting the response data to the origin server in a second destination format in the interface interaction rules comprises:
Extracting a data value corresponding to the target data in the response data according to the mapping relation, and completing analysis of the response data according to a node path mode;
And sending the response data after the analysis to the source server according to a second target format required by the source server in the interface interaction rule.
6. An interface interaction device, comprising:
The receiving module is used for receiving request information transmitted by the source server by the target engine, wherein the request information at least comprises request data and interface interaction rules;
The processing module is used for converting the request data into target data in a first target format required by a target interface based on the interface interaction rule, processing the target data according to the requirement of the target interface to obtain processed target data, and sending the processed target data to a target server through the target interface;
The response module is used for receiving response data returned by the target server and sending the response data to the source server according to a second target format in the interface interaction rule;
The method comprises the steps of converting request data into target data in a first target format required by a target interface based on an interface interaction rule, determining a mapping relation between a first field in the request data and a second field in response data, extracting the first target format from the interface interaction rule, converting the request data and the mapping relation into the target data according to the first target format, wherein data values of the target data are assembled according to a node path, and preset characters in the node path are used for representing hierarchical relations among target data fields;
and after the target data is obtained, determining the address information of the target interface from the interface interaction rule.
7. A non-volatile storage medium, wherein a program is stored in the non-volatile storage medium, and wherein the program, when executed, controls a device in which the non-volatile storage medium is located to perform the interface interaction method of any one of claims 1 to 5.
8. A computer device comprising a memory and a processor for executing a program stored in the memory, wherein the program is executed to perform the interface interaction method of any of claims 1 to 5.
CN202211698837.9A 2022-12-28 2022-12-28 Interface interaction method and device Active CN116233030B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211698837.9A CN116233030B (en) 2022-12-28 2022-12-28 Interface interaction method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211698837.9A CN116233030B (en) 2022-12-28 2022-12-28 Interface interaction method and device

Publications (2)

Publication Number Publication Date
CN116233030A CN116233030A (en) 2023-06-06
CN116233030B true CN116233030B (en) 2025-09-26

Family

ID=86574009

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211698837.9A Active CN116233030B (en) 2022-12-28 2022-12-28 Interface interaction method and device

Country Status (1)

Country Link
CN (1) CN116233030B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107800552A (en) * 2016-09-02 2018-03-13 杭州海康威视数字技术股份有限公司 A kind of data interactive method and device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9426067B2 (en) * 2012-06-12 2016-08-23 International Business Machines Corporation Integrated switch for dynamic orchestration of traffic
CN111984720A (en) * 2020-09-11 2020-11-24 得到(天津)文化传播有限公司 Data acquisition method and device, electronic equipment and interface adaptation device
CN112860463B (en) * 2021-03-22 2024-06-14 平安商业保理有限公司 Service request forwarding method, device, computer equipment and readable storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107800552A (en) * 2016-09-02 2018-03-13 杭州海康威视数字技术股份有限公司 A kind of data interactive method and device

Also Published As

Publication number Publication date
CN116233030A (en) 2023-06-06

Similar Documents

Publication Publication Date Title
CN111182025B (en) Message processing method, device, server and storage medium
CN112217831B (en) Information interaction method, device and equipment for Internet of things equipment
CN101809554B (en) Method and device for managing application data in an NFC system in response to contactless data transmission or reception
CN115516840B (en) Information processing method, device, system, medium, chip and program product
KR20230078706A (en) Certificate-based security using post-quantum cryptography
CN113032840A (en) Data processing method, device, equipment and computer readable storage medium
CN104660489A (en) Method and system for controlling message delivery in messaging system
CN106897153B (en) Method and system for calling application programming interface
CN111177182B (en) Data query method and device, storage medium and electronic equipment
CN107621987A (en) A kind of message based unmanned plane common ground station software architecture
CN107688538A (en) A kind of script execution, device and computing device
CN113741949A (en) Method, device and equipment for generating application program installation package and storage medium
CN105978693B (en) A kind of method and system of terminal association
CN112035859B (en) Password service calling method and device, storage medium and electronic device
CN116233030B (en) Interface interaction method and device
WO2018153064A1 (en) Data processing method, terminal and non-volatile readable storage medium
Paul et al. On the importance of cryptographic agility for industrial automation: Preparing industrial systems for the quantum computing era
CN115333851A (en) Automatic driving data transmission method and device and electronic equipment
CN114860713A (en) Block chain-based data matching method and device, electronic equipment and storage medium
CN113590593A (en) Method and device for generating data table information, storage medium and electronic device
CN107729345B (en) Website data processing method and device, website data processing platform and storage medium
CN112073488A (en) Method and apparatus for processing requests
CN118054932A (en) Method and system for operating object storage service based on proxy server, and electronic device
CN108595973A (en) Instruction determination method, equipment control method, device and system
CN116132214A (en) Event transmission method, device, equipment and medium based on event bus model

Legal Events

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