CN112422566B - Remote call processing method and device, storage medium and electronic device - Google Patents

Remote call processing method and device, storage medium and electronic device Download PDF

Info

Publication number
CN112422566B
CN112422566B CN202011296466.2A CN202011296466A CN112422566B CN 112422566 B CN112422566 B CN 112422566B CN 202011296466 A CN202011296466 A CN 202011296466A CN 112422566 B CN112422566 B CN 112422566B
Authority
CN
China
Prior art keywords
configuration file
xml configuration
remote
remote call
http interface
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
CN202011296466.2A
Other languages
Chinese (zh)
Other versions
CN112422566A (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.)
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Original Assignee
Qingdao Haier Technology Co Ltd
Haier Smart Home Co 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 Qingdao Haier Technology Co Ltd, Haier Smart Home Co Ltd filed Critical Qingdao Haier Technology Co Ltd
Priority to CN202011296466.2A priority Critical patent/CN112422566B/en
Publication of CN112422566A publication Critical patent/CN112422566A/en
Application granted granted Critical
Publication of CN112422566B publication Critical patent/CN112422566B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/133Protocols for remote procedure calls [RPC]
    • 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/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles

Abstract

The invention provides a remote call processing method, a remote call processing device, a storage medium and an electronic device, wherein the method comprises the following steps: initiating a remote call request through extensible markup language (XML) configuration files corresponding to HTTP interfaces, wherein one HTTP interface corresponds to one XML configuration file; receiving a remote call response and acquiring return data in the remote call response, so that the problem that when a plurality of services call the same HTTP interface in the related technology, a plurality of call logic codes need to be copied, and the codes have redundancy is solved; when the HTTP interface changes, a plurality of services are required to modify the calling code at the same time, the calling request is initiated through the XML configuration file corresponding to the HTTP interface, the code is concise, elegant and convenient, the plurality of services call the same HTTP interface without code redundancy, the interface change does not involve code modification, and only the XML configuration file needs to be modified.

Description

Remote call processing method and device, storage medium and electronic device
Technical Field
The present invention relates to the field of communications, and in particular, to a method, an apparatus, a storage medium, and an electronic apparatus for remote call processing.
Background
At present, the services solved by web applications are more and more complex, and the service operation is difficult to support by a single service. The web application is expanded from the original service to dozens to hundreds of different services, the services respectively perform cooperative work, and respectively expose necessary Hypertext transfer Protocol (HTTP) interfaces to complete service data exchange.
HTTP interfaces among all services are frequently called, the same HTTP interface can be called by the services A, B, C, the code logic for calling the HTTP interfaces is basically the same, a copy of the code for calling the logic is needed to be copied in a project corresponding to the service A, B, C, and the code is redundant; when the parameters and the response of the HTTP interface change, the calling code needs to be modified, and the same code modification is carried out on a plurality of projects; when the service is changed online, the code is modified, and a plurality of steps such as compiling, patching, restarting and the like are required.
When the same HTTP interface is called for multiple services in the related technology, multiple copies of codes of calling logic are needed, and the codes have redundancy; when the HTTP interface changes, the problem that a plurality of services are required to modify the calling code at the same time is solved.
Disclosure of Invention
The embodiment of the invention provides a remote call processing method, a remote call processing device, a storage medium and an electronic device, which at least solve the problem that when a plurality of services call the same HTTP interface in the related technology, a plurality of copies of codes of call logic are required, and the codes have redundancy; when the HTTP interface changes, a plurality of services are required to modify the calling code simultaneously.
According to an embodiment of the present invention, there is provided a remote call processing method including:
initiating a remote call request through Extensible Markup Language (XML) configuration files corresponding to HTTP interfaces, wherein one HTTP interface corresponds to one XML configuration file;
and receiving a remote call response and acquiring return data in the remote call response.
Optionally, the initiating a remote invocation request through an XML configuration file corresponding to the HTTP interface includes:
acquiring a template object corresponding to the XML configuration file from a system memory according to the identification information of the XML configuration file;
generating actual header volume data according to the label content of the header configured by the template object;
generating actual body data according to the label content of the body configured by the template object;
and initiating a remote call request through the XML configuration file corresponding to the HTTP interface, wherein the XML configuration file comprises the header body data and the body data.
Optionally, before initiating a remote invocation request through the XML configuration file corresponding to the HTTP interface, the method further includes:
acquiring the body data calling the HTTP interface through a front plug-in of the template object;
and signing the body data according to a preset rule, and setting a signed value in the header or the body.
Optionally, the obtaining the return data in the remote invocation response includes:
and acquiring the return data according to the label content of the response body configured by the template object based on the remote call response.
Optionally, based on the obtained remote invocation response, obtaining the return data according to the tag content of the response body configured by the template object includes:
acquiring encrypted return data according to the label content of a response body configured by the template object through a post plug-in of the template object;
and decrypting the encrypted return data to obtain the return data.
Optionally, before initiating the remote invocation request through an XML configuration file corresponding to the HTTP interface, the method further includes:
and setting the corresponding XML configuration file aiming at the HTTP interface, wherein the XML configuration file comprises a request address Uniform Resource Locator (URL), a request header, a request body and a response body.
Optionally, before initiating the remote invocation request through an XML configuration file corresponding to the HTTP interface, the method further includes:
scanning an XML configuration file under a preset path at a preset time period to generate a template object;
and caching the template object into a system memory.
According to another embodiment of the present invention, there is also provided a remote call processing apparatus including:
the system comprises an initiating module, a remote calling module and a calling module, wherein the initiating module is used for initiating a remote calling request through extensible markup language (XML) configuration files corresponding to hypertext transfer protocol (HTTP) interfaces, and one HTTP interface corresponds to one XML configuration file;
and the acquisition module is used for receiving the remote call response and acquiring the return data in the remote call response.
Optionally, the initiating module includes:
the obtaining submodule is used for obtaining a template object corresponding to the XML configuration file from a system memory according to the identification information of the XML configuration file;
the first generation submodule is used for generating actual header volume data according to the label content of the header configured by the template object;
the second generation submodule is used for generating actual body data according to the label content of the body configured by the template object;
and the initiating submodule is used for initiating a remote calling request through the XML configuration file corresponding to the HTTP interface, wherein the XML configuration file comprises the header body data and the body data.
Optionally, the apparatus further comprises:
the first obtaining sub-module is used for obtaining the body data calling the HTTP interface through a front plug-in of the template object;
and the setting submodule is used for signing the body data according to a preset rule and setting a signed value in the header or the body.
Optionally, the obtaining module is further configured to
And acquiring the return data according to the label content of the response body configured by the template object based on the remote call response.
Optionally, the obtaining module includes:
the second obtaining sub-module is used for obtaining the encrypted return data according to the label content of the response body configured by the template object through the post plug-in of the template object;
and the decoding submodule is used for decrypting the encrypted return data to obtain the return data.
Optionally, the apparatus further comprises:
and the setting module is used for setting the corresponding XML configuration file aiming at the HTTP interface, wherein the XML configuration file comprises a request address URL, a request header, a request body and a response body.
Optionally, the apparatus further comprises:
the scanning module is used for scanning the XML configuration file under the preset path in a preset time period to generate a template object;
and the cache module is used for caching the template object into a system memory.
According to a further embodiment of the present invention, a computer-readable storage medium is also provided, in which a computer program is stored, wherein the computer program is configured to perform the steps of any of the above method embodiments when executed.
According to yet another embodiment of the present invention, there is also provided an electronic device, comprising a memory in which a computer program is stored and a processor configured to run the computer program to perform the steps of any of the method embodiments described above.
According to the invention, a remote call request is initiated through extensible markup language (XML) configuration files corresponding to hypertext transfer protocol (HTTP) interfaces, wherein one HTTP interface corresponds to one XML configuration file; receiving a remote call response and acquiring return data in the remote call response, so that the problem that when a plurality of services call the same HTTP interface in the related technology, a plurality of call logic codes need to be copied, and the codes have redundancy is solved; when the HTTP interface changes, a plurality of services are needed to modify the calling code at the same time, the calling request is initiated through the XML configuration file corresponding to the HTTP interface, the code is simple, elegant and convenient, the plurality of services call the same HTTP interface without code redundancy, the interface change does not involve code modification, and only the XML configuration file needs to be modified.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention and do not constitute a limitation of the invention. In the drawings:
fig. 1 is a block diagram of a hardware configuration of a mobile terminal of a remote call processing method according to an embodiment of the present invention;
FIG. 2 is a flow diagram of a remote call processing method according to an embodiment of the present invention;
FIG. 3 is a flow diagram one of an HTTP call based on template techniques according to an embodiment of the present invention;
FIG. 4 is a flow diagram two of an HTTP call based on template techniques according to an embodiment of the present invention;
fig. 5 is a block diagram of a remote call processing apparatus according to an embodiment of the present invention;
FIG. 6 is a block diagram one of a remote call processing device in accordance with a preferred embodiment of the present invention;
FIG. 7 is a block diagram two of a remote call processing device in accordance with a preferred embodiment of the present invention;
FIG. 8 is a block diagram three of a remote call processing device in accordance with a preferred embodiment of the present invention;
FIG. 9 is a block diagram four of a remote call processing device in accordance with a preferred embodiment of the present invention;
fig. 10 is a block diagram five of a remote call processing device according to a preferred embodiment of the present invention.
Detailed Description
The invention will be described in detail hereinafter with reference to the accompanying drawings in conjunction with embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
Example 1
The method provided by the first embodiment of the present application may be executed in a mobile terminal, a computer terminal, or a similar computing device. Taking a mobile terminal as an example, fig. 1 is a block diagram of a hardware structure of a mobile terminal of the remote call processing method according to an embodiment of the present invention, and as shown in fig. 1, the mobile terminal may include one or more processors 102 (only one is shown in fig. 1) (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA), and a memory 104 for storing data, and optionally, the mobile terminal may further include a transmission device 106 for a communication function and an input/output device 108. It will be understood by those skilled in the art that the structure shown in fig. 1 is only an illustration, and does not limit the structure of the mobile terminal. For example, the mobile terminal may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 may be used for storing computer programs, for example, software programs and modules of application software, such as a computer program corresponding to the remote call processing method in the embodiment of the present invention, and the processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, thereby implementing the above-mentioned methods. The 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 mobile terminal over 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 device 106 is used to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a Network adapter (NIC) that can be connected to other Network devices through a base station to communicate with the internet. In one example, the transmission device 106 can be a Radio FrequeNcy (RF) module, which is used to communicate with the internet in a wireless manner.
Based on the foregoing mobile terminal or network architecture, in this embodiment, a remote call processing method is provided, and fig. 2 is a flowchart of the remote call processing method according to the embodiment of the present invention, as shown in fig. 2, the flowchart includes the following steps:
step S202, initiating a remote call request through extensible markup language (XML) configuration files corresponding to hypertext transfer protocol (HTTP) interfaces, wherein one HTTP interface corresponds to one XML configuration file;
in an embodiment of the present invention, the step S202 may specifically include: acquiring a template object corresponding to the XML configuration file from a system memory according to the identification information of the XML configuration file; generating actual header volume data according to the label content of the header configured by the template object; generating actual body data according to the label content of the body configured by the template object; and initiating a remote call request through the XML configuration file corresponding to the HTTP interface, wherein the XML configuration file comprises the header body data and the body data.
And step S204, receiving a remote call response, and acquiring return data in the remote call response.
Through the steps S202 to S204, initiating a remote call request through extensible markup language (XML) configuration files corresponding to hypertext transfer protocol (HTTP) interfaces, wherein one HTTP interface corresponds to one XML configuration file; receiving a remote call response and acquiring return data in the remote call response, so that the problem that when a plurality of services call the same HTTP interface in the related technology, a plurality of calling logic codes need to be copied, and the codes have redundancy is solved; when the HTTP interface changes, a plurality of services are needed to modify the calling code at the same time, the calling request is initiated through the XML configuration file corresponding to the HTTP interface, the code is simple, elegant and convenient, the plurality of services call the same HTTP interface without code redundancy, the interface change does not involve code modification, and only the XML configuration file needs to be modified.
In an optional embodiment, before initiating a remote invocation request through the XML configuration file corresponding to the HTTP interface, the body volume data invoking the HTTP interface is acquired through a front plug-in of the template object; and signing the body data according to a preset rule, and setting a signed value in the header or the body.
In an embodiment of the present invention, the step S204 may specifically include: based on the remote call response, obtaining return data according to the label content of the responder configured by the template object, and further obtaining encrypted return data according to the label content of the responder configured by the template object through a post-plug-in of the template object; and decrypting the encrypted return data to obtain the return data.
In another optional embodiment, before initiating a remote call request through an XML configuration file corresponding to an HTTP interface, setting the corresponding XML configuration file for the HTTP interface, where the XML configuration file includes a request address URL, a request header, a request body and a response body.
In another optional embodiment, before initiating the remote call request through the XML configuration file corresponding to the HTTP interface, the XML configuration file under the preset path is scanned at a predetermined time period to generate a template object, and the template object is cached in the system memory.
The embodiment of the invention utilizes the template technology to change the steps of splicing URL, dynamically setting a header, body, receiving a response body and analyzing the response body from original manual coding into program automatic processing. Each interface correspondingly writes an Extensible Markup Language (XML) configuration file, and the setting of the header body and the analysis of the response body are written in XML by using a template control Language. And in the face of HTTP interface change, adjusting and modifying the corresponding xml file.
Each service relies on the xml configuration file to implement HTTP interface calls. The code called by the HTTP interface is concise; multiple services call the same HTTP interface and rely on the same xml configuration file; when the HTTP interface changes, modifying the corresponding xml configuration file without modifying codes; and replacing and covering the modified xml configuration file to the original xml configuration file of the server, so that the steps of compiling and restarting are not required, dynamic loading is realized, and the effect is achieved in time.
Writing an XML configuration file aiming at a specific HTTP request offline, and completing the analysis and writing of a request address URL, a request header, a request body and a response body by utilizing a template language; and the program calling party locally initiates HTTP interface calling, assembles data by relying on the XML configuration file inside, triggers real remote calling, and obtains response data after analysis and processing for direct use. Fig. 3 is a first flowchart of an HTTP call based on the template technology according to an embodiment of the present invention, as shown in fig. 3, including:
step S301, respectively compiling XML configuration files aiming at an HTTP interface 1, an HTTP interface 2 and an HTTP interface 3;
step S302, loading an XML configuration file at regular time;
step S303, initiating HTTP interface call;
step S304, searching an XML configuration file;
step S305, dynamically generating URL, header and body required by calling according to the XML configuration file;
step S306, HTTP call is really triggered;
step S307, initiates a call through HTTP interface 1, HTTP interface 2, or HTTP interface 3.
Fig. 4 is a flowchart of a HTTP call based on a template technique according to an embodiment of the present invention, where as shown in fig. 4, the system periodically scans all XML configuration files in an assigned directory to generate a template object, and caches the template object in a system memory;
step 1, a template loader scans and initializes an XML configuration file (namely a template file) at regular time, and analyzes the XML file as a template object and caches the template object;
step 2, acquiring a template object from a system cache according to the positioning character string of the template;
step 3, dynamically generating actual header volume data according to the header tag content configured by the RestTemplate (namely, the template object);
step 4, dynamically generating actual body data according to the body label content configured by RestTemplate;
step 5, executing RestTemplate front plug-in logic, encrypting the header body data in the body data, and putting the encrypted field into the header or the body, namely resetting the header or the body; for example, the definition party of the HTTP interface requires signature verification of the body parameter of the interface, to verify whether the request is legal, and to prevent data tampering. When the service A calls the HTTP interface, the specific parameters are transmitted into the body, the whole body parameters are signed according to the agreement of both sides, and the signed values are put into a header and transmitted to the HTTP interface definer; the HTTP interface definer receives the request, acquires the parameters in the body, then recalculates the signature according to the agreement of both parties, compares the calculated signature with the signature transmitted by the header, and if the calculated signature is equal to the signature transmitted by the header, the parameter is not tampered and belongs to a legal request. The HTTP interface definer then executes the corresponding logic to return the specific data to the a service. By configuring the front plug-in, the body data of the HTTP interface called by the service A is automatically acquired, the signature is made according to the rule, and the value of the signature is put into the header, so that the logic that the code needs to be manually written to make the signature and the header is set is changed into a configuration mode, the code is commonized, and other HTTP interfaces have the same requirements later, and the front plug-in can be configured.
Step 6, the template executor invokes the remote invocation of the HTTP interface;
step 7, the template executor acquires the response of the request and configures response tag content according to RestTemplate; dynamically generating finally returned data by using a template mode;
step 8, the template executor executes the RestTemplate post-plug-in logic and resets the finally returned data; if the HTTP interface returns clear service data, the caller can directly obtain and use the data. If the HTTP interface returns the ciphertext data, the ciphertext can be decrypted through the configured post plug-in unit to obtain the plaintext, and the plaintext data is returned to the calling party. The decryption process of the HTTP response data is changed into a configuration mode by configuring the post-positioned plug-in, the encryption method is public, the logic of manually writing decryption in a program is omitted, and other HTTP interfaces have the same appeal later, and the post-positioned plug-in can be configured.
Step 9, the template executor initiates remote calling through a third HTTP interface;
step 10, the template executor receives a response body through a third HTTP interface;
step 11, the template executor analyzes the response result to the specified object;
step 12, the template executor requests post-plug-in processing;
and step 13, returning the analyzed result set to the background program calling party by the template executor.
The embodiment of the invention utilizes the template technology to configure and automate the calling step of the HTTP interface as much as possible, avoids manually compiling redundant codes, and has concise calling codes; each HTTP interface corresponds to one xml configuration file, and each service can realize HTTP interface calling by depending on the xml configuration file, so that redundant codes are avoided; the xml configuration file is dynamically loaded in the system at regular time, and can take effect without code compiling and restarting service after the xml configuration file is modified and updated. The template technique is replaceable. Aiming at an HTTP interface, writing a corresponding xml template configuration file in advance, wherein the xml configuration file relates to writing a template language, which java template technology is adopted, and the template language in the xml configuration file is opposite to the template language. And various template technologies such as freemarker, velocity, beetl and the like can be selected according to the technical stacks of developers to realize the method.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
Example 2
In this embodiment, a remote invocation processing apparatus is further provided, where the apparatus is used to implement the foregoing embodiments and preferred embodiments, and details of the foregoing description are omitted. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 5 is a block diagram of a remote call processing apparatus according to an embodiment of the present invention, as shown in fig. 5, including:
an initiating module 52, configured to initiate a remote invocation request through extensible markup language XML configuration files corresponding to hypertext transfer protocol HTTP interfaces, where one HTTP interface corresponds to one XML configuration file;
the obtaining module 54 is configured to receive the remote call response and obtain the return data in the remote call response.
Fig. 6 is a block diagram of a remote call processing device according to the preferred embodiment of the present invention, and as shown in fig. 6, the initiating module 52 includes:
the obtaining submodule 62 is configured to obtain, from the system memory, a template object corresponding to the XML configuration file according to the identification information of the XML configuration file;
the first generation submodule 64 is used for generating actual header volume data according to the label content of the header configured by the template object;
a second generating sub-module 66, configured to generate actual body data according to the label content of the body configured by the template object;
the initiating submodule 68 is configured to initiate a remote call request through the XML configuration file corresponding to the HTTP interface, where the XML configuration file includes the header body data and the body data.
Fig. 7 is a block diagram ii of a remote call processing apparatus according to a preferred embodiment of the present invention, as shown in fig. 7, the apparatus further includes:
the first obtaining sub-module 72 is configured to obtain the body data calling the HTTP interface through a front plug-in of the template object;
and the setting sub-module 74 is configured to sign the body data according to a preset rule, and set a signed value in the header or the body.
Optionally, the obtaining module 54 is further configured to
And acquiring the return data according to the label content of the response body configured by the template object based on the remote call response.
Fig. 8 is a block diagram three of a remote call processing apparatus according to a preferred embodiment of the present invention, and as shown in fig. 8, the obtaining module 54 includes:
the second obtaining submodule 82 is configured to obtain, by using the post-plug-in of the template object, the encrypted return data according to the tag content of the response body configured by the template object;
and the decoding submodule 84 is configured to decrypt the encrypted return data to obtain the return data.
Fig. 9 is a block diagram four of a remote call processing apparatus according to a preferred embodiment of the present invention, as shown in fig. 9, the apparatus further comprising:
a setting module 92, configured to set the corresponding XML configuration file for the HTTP interface, where the XML configuration file includes a request address URL, a request header, a request body, and a response body.
Fig. 10 is a block diagram five of a remote call processing apparatus according to a preferred embodiment of the present invention, as shown in fig. 10, the apparatus further comprising:
the scanning module 102 is configured to scan an XML configuration file under a preset path at a preset time period to generate a template object;
and the cache module 104 is configured to cache the template object in a system memory.
It should be noted that, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are respectively located in different processors in any combination.
Example 3
Embodiments of the present invention also provide a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to perform the steps of any of the above method embodiments when executed.
Alternatively, in the present embodiment, the storage medium may be configured to store a computer program for executing the steps of:
s1, initiating a remote call request through extensible markup language (XML) configuration files corresponding to hypertext transfer protocol (HTTP) interfaces, wherein one HTTP interface corresponds to one XML configuration file;
and S2, receiving a remote call response and acquiring return data in the remote call response.
Optionally, in this embodiment, the storage medium may include, but is not limited to: a usb disk, a Read-ONly Memory (ROM), a RaNdom Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk, which can store computer programs.
Example 4
Embodiments of the present invention also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, initiating a remote call request through extensible markup language (XML) configuration files corresponding to hypertext transfer protocol (HTTP) interfaces, wherein one HTTP interface corresponds to one XML configuration file;
and S2, receiving a remote call response and acquiring return data in the remote call response.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation manners, and this embodiment is not described herein again.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the principle of the present invention should be included in the protection scope of the present invention.

Claims (9)

1. A remote call processing method, comprising:
initiating a remote call request through an extensible markup language (XML) configuration file corresponding to a hypertext transfer protocol (HTTP) interface, comprising: acquiring a template object corresponding to the XML configuration file from a system memory according to the identification information of the XML configuration file; generating actual header volume data according to the label content of the header configured by the template object; generating actual body data according to the label content of the body configured by the template object; initiating a remote call request through the XML configuration files corresponding to HTTP interfaces, wherein the XML configuration files comprise the header body data and the body data, and one HTTP interface corresponds to one XML configuration file;
and receiving a remote call response and acquiring return data in the remote call response.
2. The method according to claim 1, wherein before the initiating the remote invocation request through the XML configuration file corresponding to the HTTP interface, the method further comprises:
acquiring the body data calling the HTTP interface through a front plug-in of the template object;
and signing the body data according to a preset rule, and setting a signed value in the header or the body.
3. The method of claim 2, wherein the obtaining the return data in the remote call response comprises:
and acquiring the return data according to the label content of the response body configured by the template object based on the remote call response.
4. The method according to claim 3, wherein the obtaining of the return data according to the tag content of the response body configured by the template object based on the obtained remote invocation response comprises:
acquiring encrypted return data according to the label content of a response body configured by the template object through a post plug-in of the template object;
and decrypting the encrypted return data to obtain the return data.
5. The method according to any of claims 1 to 4, wherein before the initiating of the remote invocation request through the XML configuration file corresponding to the HTTP interface, the method further comprises:
and setting the corresponding XML configuration file aiming at the HTTP interface, wherein the XML configuration file comprises a request address Uniform Resource Locator (URL), a request header, a request body and a response body.
6. The method according to claim 5, wherein before the initiating the remote invocation request through the XML configuration file corresponding to the HTTP interface, the method further comprises:
scanning the XML configuration file under a preset path in a preset time period to generate a template object;
and caching the template object into a system memory.
7. A remote call processing apparatus, comprising:
the system comprises an initiating module, a remote calling module and a remote calling module, wherein the initiating module is used for initiating a remote calling request through extensible markup language (XML) configuration files corresponding to hypertext transfer protocol (HTTP) interfaces, and one HTTP interface corresponds to one XML configuration file;
the acquisition module is used for receiving a remote call response and acquiring return data in the remote call response;
wherein the initiating module comprises:
the obtaining submodule is used for obtaining a template object corresponding to the XML configuration file from a system memory according to the identification information of the XML configuration file;
the first generation submodule is used for generating actual header volume data according to the label content of the header configured by the template object;
the second generation submodule is used for generating actual body data according to the label content of the body configured by the template object;
and the initiating submodule is used for initiating a remote calling request through the XML configuration file corresponding to the HTTP interface, wherein the XML configuration file comprises the header body data and the body data.
8. A computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to carry out the method of any one of claims 1 to 6 when executed.
9. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, and wherein the processor is arranged to execute the computer program to perform the method of any of claims 1 to 6.
CN202011296466.2A 2020-11-18 2020-11-18 Remote call processing method and device, storage medium and electronic device Active CN112422566B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011296466.2A CN112422566B (en) 2020-11-18 2020-11-18 Remote call processing method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011296466.2A CN112422566B (en) 2020-11-18 2020-11-18 Remote call processing method and device, storage medium and electronic device

Publications (2)

Publication Number Publication Date
CN112422566A CN112422566A (en) 2021-02-26
CN112422566B true CN112422566B (en) 2022-10-14

Family

ID=74773034

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011296466.2A Active CN112422566B (en) 2020-11-18 2020-11-18 Remote call processing method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN112422566B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107241315A (en) * 2017-05-23 2017-10-10 广州唯品会网络技术有限公司 Cut-in method, device and the computer-readable recording medium of bank's gateway interface

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW200608727A (en) * 2004-08-27 2006-03-01 Hon Hai Prec Ind Co Ltd Configuration and method for data interchange between the different systems
CN100403690C (en) * 2005-04-30 2008-07-16 华为技术有限公司 Method and its system for managing user stationed equipment configuration
CN103095479A (en) * 2011-11-04 2013-05-08 华为技术有限公司 Method and device of business configuration
CN106997298B (en) * 2016-01-22 2021-08-06 菜鸟智能物流控股有限公司 Application resource acquisition method and device
CN109905432A (en) * 2017-12-08 2019-06-18 武汉楚鼎信息技术有限公司 A kind of the data automatic loading method and system and device of network data list
CN111638983A (en) * 2020-05-28 2020-09-08 深圳壹账通智能科技有限公司 Interface calling method, interface calling device and terminal equipment
CN111913739B (en) * 2020-07-30 2023-09-12 北京数立得科技有限公司 Service interface primitive defining method and system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107241315A (en) * 2017-05-23 2017-10-10 广州唯品会网络技术有限公司 Cut-in method, device and the computer-readable recording medium of bank's gateway interface

Also Published As

Publication number Publication date
CN112422566A (en) 2021-02-26

Similar Documents

Publication Publication Date Title
CN106209726B (en) Mobile application single sign-on method and device
CN110601952A (en) Multi-channel message notification sending method and device
CN103873692B (en) Method, device and system for resource sharing
CN113453175B (en) 5G message processing method and device, computer equipment and storage medium
CN110413418B (en) Cache synchronization device and method, cache synchronization system and electronic equipment
CN110377440B (en) Information processing method and device
US20170324686A1 (en) System and method for secure and efficient communication within an organization
CN112804354B (en) Method and device for data transmission across chains, computer equipment and storage medium
CN114172662A (en) Block chain external data acquisition method and device
CN112954050B (en) Distributed management method and device, management equipment and computer storage medium
CN110661853A (en) Data proxy method, device, computer equipment and readable storage medium
CN112615753A (en) Link abnormity tracking method, first node, second node and link
CN110413329A (en) IOT equipment remote debugging method, apparatus and system
CN110851170A (en) Software multi-channel publishing method and related equipment
CN111885516A (en) Multi-channel access short message configuration method and device, computer equipment and storage medium
CN111144878A (en) Instruction generation method and instruction generation device
CN114465867A (en) Server maintenance method and device, storage medium and processor
CN113626002A (en) Service execution method and device
CN111327680B (en) Authentication data synchronization method, device, system, computer equipment and storage medium
CN112422566B (en) Remote call processing method and device, storage medium and electronic device
CN109451497B (en) Wireless network connection method and device, electronic equipment and storage medium
CN112073488A (en) Method and device for processing request
CN111581576A (en) Development processing method and device based on micro-service and storage medium
CN104714760B (en) A kind of method and device for reading and writing storage device
CN110825815A (en) Cloud note system information processing method, equipment and medium based on block chain

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