Remote data calling method and device, equipment and storage medium

By automatically determining the request type on the server and unifying the data remote call method for the interface processing, the problems of extended development cycle and increased errors under traditional methods are solved, and the effects of simplifying client integration, reducing development workload and improving integration efficiency are achieved.

CN119597500APending Publication Date: 2025-03-11BEIJING CHINA POWER INFORMATION TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411583243.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-07
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

When handling complex business systems and server interactions, the traditional method of executing scripts directly on remote servers leads to prolonging the development cycle and increasing the possibility of errors. Especially when integrating in cross-platform or multi-language environments, the demand for secondary development increases and becomes a development burden.

Method used

Provides a remote data call method, and the server automatically determines the request type based on the received request information. Whether it is API calls or script instructions, it is processed through the same server interface. The client only needs to send request information in a standard format to complete remote data calls, simplifying the integration of the client.

Benefits of technology

By automatically determining the request type and unified interface processing, the integration of the client is simplified, the development workload is reduced, and secondary development is avoided for different scenarios. Improve integration efficiency, reduce the failure rate caused by network problems, and reduce development complexity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119597500A_ABST
    Figure CN119597500A_ABST
Patent Text Reader

Abstract

The invention provides a remote data calling method and device, equipment and a storage medium. The method comprises the following steps: receiving first request information sent by a client; the first request information is used for requesting to call remote data; the first request information comprises at least one of the following items: a remote interface address, a remote interface parameter, a script instruction and a server link address; determining a request type according to the first request information; forwarding the first request information to a remote interface address in response to the request type being API call, and receiving response data; in response to the fact that the request type is a script instruction, forwarding the first request information to a server link address, executing the script instruction, and determining an execution result; and sending the response data or the execution result to the client. The request is directly forwarded and processed according to the request type, unnecessary processing steps are reduced, the integration efficiency is improved, the integration workload is reduced, and the development complexity is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of data transmission, and in particular to a method, device, equipment and storage medium for remote data invocation. Background Art

[0002] With the rapid development of information technology, business system architecture and server deployment architecture have become more and more complex. The number of interfaces, types of protocols, security certification requirements, etc. involved are constantly increasing. This not only increases the risk of data transmission delays, but also makes remote call integration a challenge in software development, bringing huge challenges to the digital transformation of enterprises.

[0003] As the interactions between business systems and servers become increasingly frequent and complex, the traditional method of directly executing scripts on remote servers has gradually revealed its limitations. Every time new or modified integration logic is added or modified, additional code writing and testing are required, which increases the development cycle and potential error points. Especially when it comes to integration in cross-platform or multi-language environments, this need for secondary development has become a burden. Summary of the invention

[0004] In view of this, the purpose of the present application is to propose a data remote calling method, device, equipment and storage medium.

[0005] As one aspect of the present application, a data remote calling method is provided, which is applied to a server and includes:

[0006] Receive first request information sent by a client; the first request information is used to request to call remote data; the first request information includes at least one of the following: a remote interface address, a remote interface parameter, a script instruction, and a server link address;

[0007] Determine a request type according to the first request information;

[0008] In response to the request type being an API call, forwarding the first request information to the remote interface address, and receiving response data;

[0009] In response to the request type being the script instruction, forwarding the first request information to the server link address, executing the script instruction, and determining an execution result;

[0010] The response data or the execution result is sent to the client.

[0011] Optionally, the first request information includes a request header and a request body;

[0012] The forwarding of the first request information to the remote interface address and receiving response data comprises:

[0013] Unpacking the request body to obtain the remote interface address and the remote interface parameters;

[0014] Copying the request header, and encapsulating the request header, the remote interface address, and the remote interface parameters into second request information;

[0015] According to the second request information, a remote interface is requested, and response data sent by the remote interface is received.

[0016] Optionally, forwarding the first request information to the server link address, executing the script instruction, and determining the execution result includes:

[0017] Unpacking the first request information to obtain the script instruction and the server link address;

[0018] Based on the secure shell protocol, access the server link address;

[0019] According to the Runtime tool class, a shell script is called to execute the script instructions;

[0020] The execution result is received.

[0021] Optionally, the request header includes a token identifier, including:

[0022] Determining the token identifier of the first request information;

[0023] Determining, according to the token identifier, authority information of the first request information;

[0024] In response to the permission information being legal, it is determined that the client has access rights.

[0025] As a second aspect of the present application, a data remote calling method is provided, which is applied to a client and includes:

[0026] Obtaining original request information; the original request information includes a request header and a request body;

[0027] Add a token identifier to the request header and encapsulate it in json format to obtain the first request information; the token identifier is used to identify the permission information of the client;

[0028] Sending the first request information to the server;

[0029] Receive response data or execution results sent by the server.

[0030] Optionally, the first request information includes at least one of the following: user information, remote interface address, remote interface parameters, script instructions, and server link address.

[0031] As a third aspect of the present application, a data remote calling device is provided, which is applied to a server, and includes: a receiving module, a determining module, a processing module, and a sending module;

[0032] The receiving module is used to receive a first request message sent by a client; the first request message is used to request to call remote data; the first request message includes at least one of the following: a remote interface address, a remote interface parameter, a script instruction, and a server link address;

[0033] The determining module is used to determine the request type according to the first request information;

[0034] The processing module is used for, in response to the request type being an API call, forwarding the first request information to the remote interface address and receiving response data;

[0035] The processing module is further configured to, in response to the request type being the script instruction, forward the first request information to the server link address, execute the script instruction, and determine an execution result;

[0036] The sending module is used to send the response data or the execution result to the client.

[0037] Optionally, the first request information includes a request header and a request body; the processing module is specifically used to forward the first request information to the remote interface address and receive response data, including:

[0038] Unpacking the request body to obtain the remote interface address and the remote interface parameters;

[0039] Copying the request header, and encapsulating the request header, the remote interface address, and the remote interface parameters into second request information;

[0040] According to the second request information, a remote interface is requested, and response data sent by the remote interface is received.

[0041] Optionally, the processing module is further specifically used to unpack the first request information to obtain the script instruction and the server link address;

[0042] Based on the secure shell protocol, access the server link address;

[0043] According to the Runtime tool class, a shell script is called to execute the script instructions;

[0044] The execution result is received.

[0045] Optionally, the request header includes a token identifier, and the determination module is further used to determine the token identifier of the first request information;

[0046] The determination module is further used to determine the authority information of the first request information according to the token identifier;

[0047] The determination module is further configured to, in response to the permission information being legal, determine that the client has access rights.

[0048] As a fourth aspect of the present application, a data remote calling device is provided, which is applied to a client and includes: an acquisition module, a processing module, a sending module and a receiving module;

[0049] The acquisition module is used to acquire original request information; the original request information includes a request header and a request body;

[0050] The processing module is used to add a token identifier to the request header and encapsulate it into a json format to obtain the first request information; the token identifier is used to identify the permission information of the client;

[0051] The sending module is used to send the first request information to the server;

[0052] The receiving module is used to receive the response data or execution result sent by the server.

[0053] Optionally, the first request information includes at least one of the following: user information, remote interface address, remote interface parameters, script instructions, and server link address.

[0054] As the fifth aspect of the present application, an electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned remote data call method when executing the program.

[0055] As the sixth aspect of the present application, a non-transitory computer-readable storage medium is provided, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the above-mentioned data remote call method provided in the present application.

[0056] From the above, it can be seen that the data remote call method, device, equipment and storage medium provided by the present application can automatically determine the request type based on the first request information received by the server. Whether it is an API call or a script instruction execution, it is processed through the same server interface, which simplifies the client's integration work. The client only needs to send the first request information in a standard format to complete the remote data call, which reduces the client's development workload and avoids secondary development for different scenarios. For API calls, the request can be forwarded directly to the remote interface address, and the response data can be returned to the client; for script instructions, it can be connected to the server and the script can be executed, which not only ensures the execution efficiency, but also reduces the failure rate caused by network problems, thereby improving the integration efficiency, reducing the integration workload, and reducing the complexity of development. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] In order to more clearly illustrate the technical solutions in the present application or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0058] Figure 1 A schematic diagram of an application scenario of a data remote calling method provided in an embodiment of the present application;

[0059] Figure 2 A flowchart of a method for remotely calling data provided by an embodiment of the present application;

[0060] Figure 3 A flowchart of another method for remotely calling data provided by an embodiment of the present application;

[0061] Figure 4 A flowchart of another method for remotely calling data provided in an embodiment of the present application;

[0062] Figure 5 A flowchart of another method for remotely calling data provided in an embodiment of the present application;

[0063] Figure 6 A schematic diagram of the composition of a data remote calling device provided in an embodiment of the present application;

[0064] Figure 7 A schematic diagram of another device for remotely calling data provided by an embodiment of the present application;

[0065] Figure 8 A schematic diagram of the composition of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0066] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.

[0067] It should be noted that, in the embodiments of the present application, words such as "exemplarily" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplarily" or "for example" is intended to present related concepts in a concrete way. Unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present application should have the usual meaning understood by people with ordinary skills in the field to which the present application belongs. SUMMARY OF THE INVENTION

[0069] In the related art, remote application programming interface (API) calls usually use hypertext transfer protocol (HTTP) or WebSocket protocol for communication. HTTP protocol adopts a request-response model. The client sends a request to the server, and the server processes the request and returns a response. WebSocket protocol realizes real-time two-way communication between the client and the server, and realizes communication through three stages: handshake, data transmission and closing. In the front-end and back-end separation architecture, the front-end calls the services provided by the back-end through the remote API to realize data interaction and business logic processing. In the microservice architecture, each microservice communicates through remote API calls to realize service decoupling and flexible deployment. When integrating with a third-party system, data exchange and collaborative processing of business logic can be realized through remote API calls. Execute script instructions on the remote server, the client connects to the remote server through protocols such as SSH, and executes the specified script or command on the remote server. After the remote server executes the script or command, it returns the result to the client. The above methods of remotely calling data all require secondary development, and with the increase of integration complexity, it is difficult to complete efficient and error-free integration work in a short time.

[0070] The inventor of the present application has found that the use of API may involve the transmission of sensitive data. If the API's security measures are insufficient or it is attacked maliciously, it may lead to data leakage and other security issues. Data exchange through API may be affected by factors such as network delay and bandwidth limitation, resulting in performance problems. When the API server load is too high, it will also affect the response speed and stability. In the process of executing script instructions on the remote server, if the user's input is not fully verified and filtered, malicious users will perform some dangerous operations by injecting malicious commands, resulting in unauthorized access, data leakage and other security risks. In addition, as the integration requirements between business systems become more and more complex, traditional remote call methods (such as direct API calls or script execution on remote servers) often require a lot of customized development work and are prone to errors during the integration process. Whether it is remote API calls or script instruction execution, developers need to have a certain technical foundation, including knowledge of network programming, API usage, script writing, etc. In actual business scenarios, it may be necessary to integrate with a variety of different systems and platforms, which need to use different technologies, protocols and data formats, increasing the complexity and difficulty of integration, and need to deal with more compatibility and adaptability issues.

[0071] In order to solve the above problems, the present application provides a method for remote data calling. The server can automatically determine the request type based on the first request information received. Whether it is an API call or a script instruction execution, it is processed through the same server interface, which simplifies the client's integration work. The client only needs to send the first request information in a standard format to complete the remote data call, which reduces the client's development workload and avoids secondary development for different scenarios. For API calls, the request can be forwarded directly to the remote interface address, and the response data can be returned to the client; for script instructions, it can be connected to the server and the script can be executed, which not only ensures the execution efficiency, but also reduces the failure rate caused by network problems, thereby improving the integration efficiency, reducing the integration workload, and reducing the development complexity.

[0072] After introducing the basic principles of the present application, various non-limiting implementation methods of the present application are described in detail below.

[0073] Application Scenario Overview

[0074] Figure 1 A schematic diagram of an application scenario of a data remote calling method provided in an embodiment of the present application. Figure 1 As shown, the application scenario includes a server 101 and a client 102. The server 101 and the client 102 are connected via a wired or wireless communication network.

[0075] The server 101 mentioned here can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. Optionally, the server can also be implemented on a cloud platform. For example, the cloud platform can include private clouds, public clouds, hybrid clouds, community clouds, distributed clouds, inter-clouds, and multi-clouds, etc., or any combination thereof. The embodiments of the present application are not limited to this.

[0076] In some embodiments, the client 102 includes but is not limited to a desktop computer, a mobile phone, a mobile computer, a tablet computer, a media player, a smart wearable device, a personal digital assistant (PDA) or other electronic devices capable of implementing the above functions.

[0077] In some embodiments, the server 101 is the core processing unit of the data remote call method, including a security authentication module, an API call processing module, and a script instruction execution module. It is responsible for receiving the request from the client 102, parsing the request information, performing corresponding processing according to the request type, and returning the processing result to the client 102. In addition, the server 101 will also verify the identity and authority of the client 102, and only when the authority information is legal will the request be allowed to continue processing.

[0078] In some embodiments, the client 102 is responsible for constructing request information, sending a request to the server 101, and receiving a processing result returned by the server 101. The client 102 includes a toolkit provided to developers, which defines interface specifications, parameter entity classes, request header information specifications, etc., to facilitate developers to develop and use. When running, it automatically links to the local executor server 101 by default, and the IP and port in the configuration information can be modified to point to the deployed executor server 101.

[0079] It should be understood that Figure 1 is an exemplary structural diagram, Figure 1 The application scenario shown includes an unlimited number of devices, for example, an unlimited number of servers 101 and an unlimited number of clients 102. Figure 1 In addition to the equipment shown, Figure 1 The application scenario shown may also include other devices, which is not limited to this.

[0080] Combine the following Figure 1The data remote calling method according to the exemplary embodiment of the present application is described by using the application scenario. It should be noted that the above application scenario is only shown to facilitate understanding of the spirit and principle of the present application, and the implementation of the present application is not limited in this respect. On the contrary, the implementation of the present application can be applied to any applicable scenario.

[0081] Figure 2 A flowchart of a data remote calling method provided in an embodiment of the present application. Figure 2 As shown, the data remote calling method provided by the present application can be implemented by the above-mentioned server 101 and client 102, and specifically includes the following steps:

[0082] S201: The client obtains original request information.

[0083] The original request information includes a request header and a request body.

[0084] In some embodiments, the original request information refers to all necessary information carried by the client when initiating a request, including a request header and a request body, wherein the request header contains metadata of the request, such as authentication information, client information, request method, etc., and the request body contains data sent to the server, such as parameters of an API call or script instructions to be executed. When a user initiates a request, the client obtains the original request information.

[0085] Exemplary steps for using the executor client (Client): first, provide the client jar package, for example: RmtClient-1.0.jar, and then develop a remote call program, for example: Step 1: Get user information: UserInfouser = RmtClient.postUserInfo(userId, url). userId: user ID. url: remote interface address (for example: http: / / ip:port / xxx / userinfo), not the executor server service address. Step 2: Execute the script and get the device name: String deviceName = RmtClient.execPostDeviceName(command, addr); command: shell script instruction; addr: server link address (default local address localhost:22); Step 3: Modify the configuration file and deploy the service for testing, for example: #The configuration file contains the following information: RmtServiceAddr: http: / / localhost:80 / api# Executor server address, default local.

[0086] S202: The client adds a token identifier to the request header and encapsulates it in JSON format to obtain the first request information.

[0087] The token identifier is used to identify the client's permission information.

[0088] In some embodiments, a token is used for identity authentication and authorization. It contains the user's identity information or other control information. The client adds the token to the request header so that the server can identify the source of the request and determine the requester's authority. Furthermore, the request information is encapsulated in JSON format, which is easy for operators to read and write, and is also easy for machines to parse and generate.

[0089] S203: The client sends the first request information to the server, and correspondingly, the server receives the first request information sent by the client.

[0090] The first request information is used to request to call remote data; the first request information includes at least one of the following: user information, remote interface address, remote interface parameters, script instructions and server link address.

[0091] In some embodiments, the client sends the encapsulated request information as the body of a post request to the server via the HTTP protocol, and the server can use a backend framework such as the Express framework of Node.js or Spring Boot to receive and process the HTTP request.

[0092] S204: The server determines the request type according to the first request information.

[0093] In some embodiments, the server parses the request information and determines the type of request (for example, an API call or a script execution). The server matches the request path by using the framework's own routing function, or decides how to handle the request based on specific fields or request parameters in the request body.

[0094] In some embodiments, in order to distinguish whether the execution action is an "API call" or a "script instruction", the executor client defines a standardized interface, for example: postXxx() and execPostXxx(), the former means making an API call via post, and the latter means sending a script instruction via post, Xxx is a user-defined name with the first letter capitalized, and the parameters in the message body are uniformly encapsulated and transmitted in json format.

[0095] In some embodiments, Figure 3 As shown, the data remote calling method provided in the embodiment of the present application also includes the following S301-S303:

[0096] S301: The server determines a token identifier of a first request message.

[0097] In some embodiments, the security authentication module of the server first receives the first request information from the client, and then the server extracts the token identifier in the request header of the first request information. The token identifier is an encrypted string used to uniquely identify the identity and session of the client.

[0098] S302: The server determines the permission information of the first request information according to the token identifier.

[0099] In some embodiments, the server will use certain algorithms and keys to verify the validity of the token identification, including checking the signature and expiration time of the token, and extract the client's permission information from it. The permission information may include user information, a list of resources allowed to be accessed, etc.

[0100] S303: In response to the authority information being legitimate, the server determines that the client has access rights.

[0101] In some embodiments, when the token verification is passed, the server will query the database or permission system to obtain the permission information of the client based on the information in the token, such as user information, operation type, etc. If the operation in the request information is within the scope of the client's permission, the server determines that the request is legal, and allows the client to continue to perform subsequent operations. Further, the server will send a response to the client, indicating that the request has been accepted and can contain some data or instructions required for subsequent operations.

[0102] It should be understood that if the permission information is illegal, that is, the client does not have permission to perform the operation, the server will reject the request and return an error message to the client stating the reason for the rejection.

[0103] S205 . In response to the request type being an API call, the server forwards the first request information to the remote interface address and receives response data.

[0104] In some embodiments, when the request type is an API call, the API call processing module on the server side receives the first request information, copies the request header information and passes it backward, unpacks the request body information, extracts the remote interface address and remote interface parameters, and encapsulates them into a new request carrying the copied request header information to continue requesting the remote proxy interface to obtain response data.

[0105] In some embodiments, the first request information includes a request header and a request body, such as Figure 4 As shown, S205 can be specifically implemented as follows S2051-S2053:

[0106] S2051. The server unpacks the request body to obtain the remote interface address and remote interface parameters.

[0107] In some embodiments, the server parses the received request body and extracts the remote interface address and remote interface parameters therefrom. The remote interface address refers to the specific uniform resource locator (URL) or endpoint of the remote API or service, and the remote interface parameters refer to the parameters required when calling the remote interface, which can be a JSON object, form data, etc.

[0108] S2052: The server copies the request header, and encapsulates the request header, the remote interface address, and the remote interface parameters into second request information.

[0109] In some embodiments, the server not only uses the remote interface address and parameters parsed from the request body, but also copies the request header information of the original request. The request header contains important metadata information, such as authentication information, such as authorization header, content type, etc. This information is necessary for correctly processing and forwarding requests to the remote interface. The server encapsulates this information into a new request information, namely the second request information.

[0110] S2053. The server requests the remote interface according to the second request information, and receives response data sent by the remote interface.

[0111] In some embodiments, the server uses the second request information to send an HTTP request to the specified remote interface address and carries the necessary header information and parameters in the request. Then, the server waits for and receives response data from the remote interface. This response data includes the results of the remote interface processing the request, such as query results, operation status, etc.

[0112] S206. In response to the request type being a script instruction, the server forwards the first request information to the server link address, executes the script instruction, and determines the execution result.

[0113] In some embodiments, when the request type is a script instruction, the server will forward the request information to a specified server link address, such as an internal server or a microservice, and execute the script instruction on the server, and then return the execution result.

[0114] In some embodiments, Figure 5 As shown, S206 can be specifically implemented as follows S2061-S2064:

[0115] S2061. The server unpacks the first request information to obtain a script instruction and a server link address.

[0116] In some embodiments, the server parses the received first request information and extracts the script instructions and the server link address, wherein the script instructions refer to the specific commands or script file paths executed on the remote server, which may be command line interface (shell) scripts, Python scripts, etc. The server link address refers to the address of the remote server, which is usually a URL or Internet protocol (IP) address, and the server needs to connect to the remote server through this address.

[0117] S2062. The server accesses the server link address based on the secure shell protocol.

[0118] In some embodiments, secure shell (SSH) is used to securely access a remote computer. SSH provides an encrypted communication channel to ensure the security of data during transmission. The server accesses the link address of the target server through the SSH protocol to execute script instructions on the server.

[0119] S2063. The server calls the shell script according to the Runtime tool class and executes the script instructions.

[0120] In some embodiments, in Java, the runtime class provides methods for interacting with the Java runtime environment, which can be used to execute external programs or commands. The server uses the Runtime tool class to call the shell script, passes the previously extracted script instructions as parameters to the shell, and executes the script on the target server.

[0121] S2064. The server receives the execution result.

[0122] In some embodiments, the server receives and processes the script execution result from the target server, which includes the text information output by the script, error code or execution status, etc. The server can parse and process the execution result, and then send it to the client, or perform other subsequent processing.

[0123] S207: The server sends the response data or the execution result to the client, and correspondingly, the client receives the response data or the execution result sent by the server.

[0124] In some embodiments, the response data is the data returned to the client after the server processes the request, and the execution result is the result after the server executes the script instruction. The server encapsulates the response data of the API call or the execution result of the script instruction in JSON format and sends it to the client via HTTP response. After receiving the response, the client parses and processes the data.

[0125] The data remote call method provided by the present application can automatically determine the request type based on the first request information received by the server. Whether it is an API call or a script instruction execution, it is processed through the same server interface, which simplifies the client's integration work. The client only needs to send the first request information in a standard format to complete the remote data call, which reduces the client's development workload and avoids secondary development for different scenarios. For API calls, the request can be directly forwarded to the remote interface address, and the response data can be returned to the client; for script instructions, it can be connected to the server and the script can be executed, which not only ensures the execution efficiency, but also reduces the failure rate caused by network problems, thereby improving the integration efficiency, reducing the integration workload, and reducing the development complexity.

[0126] Furthermore, through token identification and permission verification, it is ensured that only legitimate clients can access server resources. Then, by unpacking request information and dynamically processing it according to the request type, the system can flexibly adapt to different business needs. Through automated scripts and API calls, the need for manual operations is reduced, reducing human errors and related maintenance costs. At the same time, the interaction between the client and the server is carried out through a well-defined interface, which helps to achieve independent development and testing of the client and server, and realize flexible, secure and scalable remote data calls.

[0127] It should be noted that the method of the embodiment of the present application can be performed by a single device, such as a computer or server. The method of this embodiment can also be applied to a distributed scenario and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only perform one or more steps in the method of the embodiment of the present application, and the multiple devices will interact with each other to complete the described method.

[0128] It should be noted that the above describes some embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the above embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0129] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides a data remote calling device.

[0130] refer to Figure 6 , the data remote calling device, applied to the server, includes: a receiving module 601, a determining module 602, a processing module 603 and a sending module 604;

[0131] The receiving module 601 is used to receive a first request message sent by a client; the first request message is used to request to call remote data; the first request message includes at least one of the following: a remote interface address, a remote interface parameter, a script instruction, and a server link address;

[0132] The determination module 602 is used to determine the request type according to the first request information;

[0133] The processing module 603 is used for, in response to the request type being an API call, forwarding the first request information to the remote interface address and receiving response data;

[0134] The processing module 603 is further configured to, in response to the request type being the script instruction, forward the first request information to the server link address, execute the script instruction, and determine an execution result;

[0135] The sending module 604 is used to send the response data or the execution result to the client.

[0136] In some embodiments, the first request information includes a request header and a request body; the processing module 603 is specifically used to forward the first request information to the remote interface address and receive response data, including:

[0137] Unpacking the request body to obtain the remote interface address and the remote interface parameters;

[0138] Copying the request header, and encapsulating the request header, the remote interface address, and the remote interface parameters into second request information;

[0139] According to the second request information, a remote interface is requested, and response data sent by the remote interface is received.

[0140] In some embodiments, the processing module 603 is further specifically used to unpack the first request information to obtain the script instruction and the server link address;

[0141] Based on the secure shell protocol, access the server link address;

[0142] According to the Runtime tool class, a shell script is called to execute the script instructions;

[0143] The execution result is received.

[0144] In some embodiments, the request header includes a token identifier, and the determination module 602 is further used to determine the token identifier of the first request information;

[0145] The determination module 602 is further configured to determine, according to the token identifier, the authority information of the first request information;

[0146] The determination module 602 is further configured to, in response to the permission information being legal, determine that the client has access rights.

[0147] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides another data remote calling device.

[0148] refer to Figure 7 , the data remote calling device, applied to the client, includes: an acquisition module 701, a processing module 702, a sending module 703 and a receiving module 704;

[0149] The acquisition module 701 is used to acquire original request information; the original request information includes a request header and a request body;

[0150] The processing module 702 is used to add a token identifier to the request header and encapsulate it into a json format to obtain the first request information; the token identifier is used to identify the permission information of the client;

[0151] The sending module 703 is used to send the first request information to the server;

[0152] The receiving module 704 is used to receive response data or execution results sent by the server.

[0153] In some embodiments, the first request information includes at least one of the following: user information, remote interface address, remote interface parameters, script instructions, and server link address.

[0154] For the convenience of description, the above device is described in terms of functions divided into various modules. Of course, when implementing the present application, the functions of each module can be implemented in the same or multiple software and / or hardware.

[0155] The device of the above embodiment is used to implement the corresponding data remote calling method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.

[0156] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the remote data calling method described in any of the above embodiments is implemented.

[0157] Figure 8A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment is shown, and the device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1060. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are connected to each other through the bus 1060 in the device.

[0158] The processor 1010 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.

[0159] The memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.

[0160] The input / output interface 1030 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.

[0161] The communication interface 1040 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).

[0162] The bus 1050 includes a path that transmits information between the various components of the device (eg, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).

[0163] It should be noted that, although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040 and the bus 1050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.

[0164] The electronic device of the above embodiment is used to implement the corresponding data remote calling method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.

[0165] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the data remote call method described in any of the above embodiments.

[0166] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.

[0167] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute the data remote calling method described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0168] Based on the same inventive concept, corresponding to the data remote calling method described in any of the above embodiments, the present disclosure also provides a computer program product, which includes a computer program. In some embodiments, the computer program is executable by one or more processors so that the processors execute the data remote calling method. Corresponding to the execution subject corresponding to each step in each embodiment of the data remote calling method, the processor that executes the corresponding step may belong to the corresponding execution subject.

[0169] The computer program product of the above embodiment is used to enable the processor to execute the data remote calling method described in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.

[0170] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present application (including the claims) is limited to these examples. In line with the concept of the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present application as described above, which are not provided in detail for the sake of simplicity.

[0171] In addition, to simplify the description and discussion, and in order not to make the embodiments of the present application difficult to understand, the known power supply / ground connection with the integrated circuit (IC) chip and other components may or may not be shown in the provided drawings. In addition, the device can be shown in the form of a block diagram to avoid making the embodiments of the present application difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform to be implemented in the embodiments of the present application (that is, these details should be fully within the scope of understanding of those skilled in the art). In the case of elaborating specific details (e.g., circuits) to describe exemplary embodiments of the present application, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details or when these specific details are changed. Therefore, these descriptions should be considered to be illustrative rather than restrictive.

[0172] Although the present application has been described in conjunction with specific embodiments of the present application, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.

[0173] The embodiments of the present application are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application should be included in the scope of protection of the present application.

Claims

1. A data remote calling method, characterized in that: Applied to the server, the method includes: Receive first request information sent by a client; the first request information is used to request to call remote data; the first request information includes at least one of the following: a remote interface address, a remote interface parameter, a script instruction, and a server link address; Determine a request type according to the first request information; In response to the request type being an API call, forwarding the first request information to the remote interface address, and receiving response data; In response to the request type being the script instruction, forwarding the first request information to the server link address, executing the script instruction, and determining an execution result; The response data or the execution result is sent to the client.

2. The method according to claim 1, characterized in that The first request information includes a request header and a request body; The forwarding of the first request information to the remote interface address and receiving response data comprises: Unpacking the request body to obtain the remote interface address and the remote interface parameters; Copying the request header, and encapsulating the request header, the remote interface address, and the remote interface parameters into second request information; According to the second request information, a remote interface is requested, and response data sent by the remote interface is received.

3. The method according to claim 1, characterized in that The forwarding of the first request information to the server link address, executing the script instruction, and determining the execution result includes: Unpacking the first request information to obtain the script instruction and the server link address; Based on the secure shell protocol, access the server link address; According to the Runtime tool class, a shell script is called to execute the script instructions; The execution result is received.

4. The method according to claim 2, characterized in that: The request header includes a token identifier, and the method further includes: Determining the token identifier of the first request information; Determining, according to the token identifier, authority information of the first request information; In response to the permission information being legal, it is determined that the client has access rights.

5. A data remote calling method, characterized in that: Applied to a client, the method comprises: Obtaining original request information; the original request information includes a request header and a request body; Add a token identifier to the request header and encapsulate it in json format to obtain the first request information; the token identifier is used to identify the permission information of the client; Sending the first request information to the server; Receive response data or execution results sent by the server.

6. The method according to claim 5, characterized in that The first request information includes at least one of the following: user information, remote interface address, remote interface parameters, script instructions, and server link address.

7. A data remote calling device, characterized in that: Applied to a server, the device comprises: a receiving module, a determining module, a processing module and a sending module; The receiving module is used to receive a first request message sent by a client; the first request message is used to request to call remote data; the first request message includes at least one of the following: a remote interface address, a remote interface parameter, a script instruction, and a server link address; The determining module is used to determine the request type according to the first request information; The processing module is used for, in response to the request type being an API call, forwarding the first request information to the remote interface address and receiving response data; The processing module is further configured to, in response to the request type being the script instruction, forward the first request information to the server link address, execute the script instruction, and determine an execution result; The sending module is used to send the response data or the execution result to the client.

8. A data remote calling device, characterized in that: Applied to a client, the device comprises: an acquisition module, a processing module, a sending module and a receiving module; The acquisition module is used to acquire original request information; the original request information includes a request header and a request body; The processing module is used to add a token identifier to the request header and encapsulate it into a json format to obtain the first request information; the token identifier is used to identify the permission information of the client; The sending module is used to send the first request information to the server; The receiving module is used to receive the response data or execution result sent by the server.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 6 when executing the program. 10 . A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to execute the method according to claim 1 .