CN111193716B - Service data calling method and device, computer equipment and storage medium - Google Patents

Service data calling method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN111193716B
CN111193716B CN201911268759.7A CN201911268759A CN111193716B CN 111193716 B CN111193716 B CN 111193716B CN 201911268759 A CN201911268759 A CN 201911268759A CN 111193716 B CN111193716 B CN 111193716B
Authority
CN
China
Prior art keywords
data
responder
request
terminal
calling
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
CN201911268759.7A
Other languages
Chinese (zh)
Other versions
CN111193716A (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.)
Shenzhen Xingxing Xinhang Technology Co ltd
Original Assignee
Weikun Shanghai Technology Service 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 Weikun Shanghai Technology Service Co Ltd filed Critical Weikun Shanghai Technology Service Co Ltd
Priority to CN201911268759.7A priority Critical patent/CN111193716B/en
Publication of CN111193716A publication Critical patent/CN111193716A/en
Application granted granted Critical
Publication of CN111193716B publication Critical patent/CN111193716B/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
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/08Protocols for interworking; Protocol conversion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • 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
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/06Notations for structuring of protocol data, e.g. abstract syntax notation one [ASN.1]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer And Data Communications (AREA)

Abstract

The application relates to a service data calling method, a service data calling device, computer equipment and a storage medium in the field of transmission protocols. The method comprises the following steps: starting a local application program, and loading a local integrated package, wherein the local integrated package comprises a plurality of preset protocols; receiving a data calling request, wherein the data calling request carries a request parameter and a responder port identifier; intercepting the data call request, and selecting a target protocol corresponding to the data call request from a plurality of preset protocols; packaging the request parameter and the responder port identification according to the target protocol by the local integrated package to obtain packaged data; sending the data acquisition request to a responder terminal according to the target protocol so that the responder terminal acquires corresponding service data according to the data acquisition request; and acquiring the service data returned by the responder terminal. The method can improve the calling efficiency of the service data.

Description

Service data calling method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for calling service data, a computer device, and a storage medium.
Background
With the development of internet technology, the application of data calling technology is more and more extensive. The data calling technology is to obtain corresponding service data through a data transmission protocol to realize service data calling. In a conventional data call mode, a requester terminal transmits a data call request to a responder terminal by using a specific data transmission protocol to call service data corresponding to the data call request. When the specific data transmission protocol does not meet the calling requirement, the requesting terminal needs to replace the specific data transmission protocol by adopting a switching protocol. In the protocol replacement process, large-scale modification needs to be performed on a requester terminal according to a switching protocol on the basis of a specific data transmission protocol, and the modification workload is large, so that the service data calling efficiency is low.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a service data calling method, an apparatus, a computer device, and a storage medium, which can improve service data calling efficiency by reducing modification workload of a requester terminal.
A method of service data invocation, the method comprising:
starting a local application program, and loading a local integrated package, wherein the local integrated package comprises a plurality of preset protocols;
receiving a data calling request, wherein the data calling request carries a request parameter and a responder port identifier;
intercepting the data call request, and selecting a target protocol corresponding to the data call request from a plurality of preset protocols;
packaging the request parameter and the responder port identification according to the target protocol by the local integrated package to obtain packaged data;
generating a data acquisition request according to the encapsulated data;
sending the data acquisition request to a responder terminal according to the target protocol so that the responder terminal acquires corresponding service data according to the data acquisition request;
and receiving the service data returned by the responder terminal.
In one embodiment, the encapsulating, by the local integration packet, the request parameter and the port identifier of the responder according to the target protocol to obtain encapsulated data includes:
assembling the request parameter and the responder port identification through the local integration packet according to a target protocol to obtain assembled data;
and packaging the assembled data to obtain packaged data.
In one embodiment, the selecting a target protocol corresponding to the data call request from among a plurality of preset protocols includes:
detecting network parameters when the local application program runs to obtain a detection result;
and selecting a target protocol corresponding to the data call request from a plurality of preset protocols according to the detection result.
In one embodiment, the method further comprises:
acquiring registration data of a requester, and sending the registration data of the requester to a registration server so that the registration server generates a remote interface according to the registration data of the requester;
calling the remote interface, and sending the data acquisition request to a responder terminal according to the target protocol;
and receiving the service data returned by the responder terminal according to the data acquisition request through the remote interface, and calling an application interface corresponding to the local application program to acquire the service data.
In one embodiment, the request parameter and the responder port identifier include a responder port identifier, and after the intercepting the data call request, the method further includes:
sending the data calling request to a registration server, and enabling the registration server to search a corresponding responder terminal identifier in a database according to the responder port identifier;
receiving a responder terminal identification sent by the registration server;
and searching a corresponding responder terminal according to the responder terminal identifier.
A service data invocation apparatus, said apparatus comprising:
the loading module is used for starting a local application program and loading a local integrated package, wherein the local integrated package comprises a plurality of preset protocols;
the receiving module is used for receiving a data calling request, and the data calling request carries a request parameter and a responder port identifier;
the selection module is used for intercepting the data calling request and selecting a target protocol corresponding to the data calling request from a plurality of preset protocols;
the encapsulation module is used for encapsulating the request parameter and the responder port identifier through the local integration packet according to the target protocol to obtain encapsulated data;
the generating module is used for generating a data acquisition request according to the encapsulated data;
the communication module is used for sending the data acquisition request to a responder terminal according to the target protocol so as to enable the responder terminal to acquire corresponding service data according to the data acquisition request; and receiving the service data returned by the responder terminal.
In one embodiment, the encapsulation module is further configured to assemble the request parameter and the responder port identifier according to a target protocol by using the local integrated packet, so as to obtain assembled data; and packaging the assembled data to obtain packaged data.
In one embodiment, the selection module is further configured to detect a network parameter when the local application runs, so as to obtain a detection result; and selecting a target protocol corresponding to the data calling request from a plurality of preset protocols according to the detection result.
A computer device comprising a memory storing a computer program and a processor implementing the steps of the various embodiments described above when executing the computer program.
A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the respective embodiments described above.
The service data calling method, the service data calling device, the computer equipment and the storage medium can provide various preset protocols for the requester terminal by loading the local integrated package, so that the protocols can be freely changed. By intercepting the data call request, a target protocol corresponding to the data call request is selected from multiple preset protocols, and data transmission is facilitated according to the target protocol required by the data call request. By encapsulating the request parameter and the responder port identifier, the request parameter and the responder port identifier can be hidden, and the safety of service data calling is improved. The data acquisition request is generated according to the packaged data, the data acquisition request is transmitted to the responder terminal according to the target protocol, so that the responder terminal acquires corresponding service data according to the data acquisition request, the service data returned by the responder terminal is received, and the requester terminal and the responder terminal can perform corresponding data processing according to the same target protocol, so that the encoding rule and the decoding rule in the service data calling process are consistent, large-scale code modification and configuration are not required, the modification workload of the requester terminal is reduced, and the calling efficiency of the service data is improved.
Drawings
FIG. 1 is a diagram illustrating an exemplary implementation of a method for invoking business data;
FIG. 2 is a flow diagram illustrating a method for invoking business data in one embodiment;
FIG. 3 is a block diagram of a service data invocation device in one embodiment;
FIG. 4 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The service data calling method provided by the application can be applied to the application environment shown in fig. 1. Wherein the requestor terminal 102 communicates with the registration server 104 over a network and the registration server 104 communicates with the responder terminal 106 over a network. The requestor terminal 102 has a local application installed therein. When the local application program is started, a local integrated package is loaded, and the local integrated package comprises a plurality of preset protocols. And after the local application program is started, the requesting party terminal acquires a request instruction and receives a data calling request according to the request instruction. The requester terminal 102 parses the data call request to obtain a request parameter and a responder port identifier. The requester terminal 102 intercepts the data call request, and selects a target protocol corresponding to the data call request from a plurality of preset protocols. The requester terminal 102 encapsulates the request parameter and the responder port identifier according to the target protocol by using the local integration packet, so as to obtain encapsulated data. The requester terminal 102 generates a data acquisition request according to the encapsulated data, and sends the data acquisition request to the responder terminal 106 according to the target protocol, so that the responder terminal 106 acquires corresponding service data according to the data acquisition request. The requester terminal 102 receives the service data returned by the responder terminal 106. The modification workload of the requester terminal can be reduced, and the calling efficiency of the service data is improved. The requesting terminal 102 and the responding terminal 106 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, and the registration server 104 may be implemented by an independent server or a server cluster composed of a plurality of servers.
In an embodiment, as shown in fig. 2, a service data invoking method is provided, which is described by taking an example that the method is applied to a requester terminal in fig. 1, and includes the following steps:
step 202, starting a local application program, and loading a local integrated package, wherein the local integrated package comprises a plurality of preset protocols.
Step 204, receiving a data call request, where the data call request carries a request parameter and a responder port identifier.
And step 206, intercepting the data calling request, and selecting a target protocol corresponding to the data calling request from a plurality of preset protocols.
And 208, encapsulating the request parameter and the port identifier of the responder through the local integration packet according to the target protocol to obtain encapsulated data.
And step 210, generating a data acquisition request according to the packaged data.
Step 212, sending the data acquisition request to the responder terminal according to the target protocol, so that the responder terminal acquires the corresponding service data according to the data acquisition request.
And step 214, receiving the service data returned by the responder terminal.
The local application program is pre-installed in the requester terminal. When the local application program is started, a local integrated package is loaded, and the local integrated package comprises a plurality of preset protocols. The local integration package may be a service framework jar package. For example, the local integrated packet may be a spring packet. The preset protocol may be a data transfer protocol. The preset protocol may include an http protocol, an rpc protocol, and the like. The http protocol may be an application layer protocol based on a request and response mode. The http protocol may be employed under the Jersey framework. The rpc protocol can be applied to remote services, and the requesting terminal can send a data calling request to a remote server through the rpc protocol. The rpc protocol can be employed under the Dubbo framework. The local integration package can provide a plurality of optional preset protocols when the service data is called, so that the requesting terminal can realize the replacement between the preset protocols through the local integration package.
And after the local application program is started, the requesting party terminal acquires a request instruction and receives a data calling request according to the request instruction. And the requester terminal analyzes the data call request to obtain a request parameter and a responder port identifier. The responder port identification may be an identification used to distinguish between different ports. The responder port identifier may be a terminal port identifier capable of providing service data corresponding to the request parameter, that is, a port identifier of a corresponding responder terminal. For example, the responder port identification may be the port number of the responder terminal. One responder terminal may correspond to multiple ports. The requesting program identification may be a program identification of the providing application of the responder terminal.
The requester terminal can call the local integrated package to start the protocol change script, and the data call request is automatically intercepted through the protocol change script. The protocol change script may be a protocol change switch. And the requester terminal analyzes the intercepted data call request to obtain a request parameter and a responder port identifier. The request parameters and the responder port identification may include a request parameter, a responder port identification, a requester identification, and the like. The requester terminal selects a target protocol corresponding to the data call request from a plurality of preset protocols of the local integrated package according to the network parameters by detecting the network parameters when the local application program runs. Network parameters may include network speed, network stability, firewall rules, etc. The target protocol may be a data transmission protocol required by the local application for service data call.
Furthermore, the requester terminal can also send the intercepted data call request to the registration server, so that the registration server can obtain the corresponding responder terminal identification according to the data call request. The requesting terminal establishes communication with the responding terminal according to the responding terminal identification, and then access and call of the specified service data are realized.
When the requester terminal selects the target protocol, the requester terminal can automatically change the protocol through the protocol change script. For example, when the rpc protocol is not supported for data transmission, the requesting terminal may automatically change the rpc protocol to the http protocol for data transmission through the protocol change script. The protocol switching script can support the registration server and the requester terminal to start the script, is favorable for online control of the data transmission state, and can timely process faults occurring in the data transmission process.
And the requester terminal encapsulates the request parameters, such as the request parameters, the responder port identifiers and the like in the data calling request and the responder port identifiers according to the target protocol by calling the local integration packet. In one embodiment, the obtaining the encapsulated data by encapsulating the request parameter and the port identifier of the responder by the local integration packet according to the target protocol includes: assembling the request parameters and the port identification of the response party through a local integration packet according to a target protocol to obtain assembled data; and packaging the assembled data to obtain packaged data. In the process of encapsulating the request parameter and the responder port identifier, the requester terminal may assemble the request parameter and the responder port identifier according to a target protocol to obtain assembled data. The assembled data may include request parameters, header files, responder port identification, status data of the requester terminal, etc. The header file may be a carrier file containing the function, data interface declaration. And the requester terminal encapsulates the assembled data into an object so as to obtain encapsulated data. An object may be a variable having a class type. A class may be a blueprint for creating objects and may be a software template for methods and variables in an object of a particular type. Classes may encapsulate assembled data and operations on assembled data together. The requesting party terminal realizes the hiding of the request parameter and the responding party port identification by packaging the request parameter and the responding party port identification, prevents the request parameter, the responding party port identification and the corresponding code from being randomly accessed by the code defined by the external class, and improves the safety of service data calling.
The requester terminal generates a data acquisition request according to the encapsulated data, and can send the data acquisition request to the responder terminal according to the target protocol. The responder terminal is preconfigured with a responder integration packet. And after the responder terminal receives the data acquisition request, calling the responder integration package to analyze the data acquisition request to obtain data such as request parameters, a header file, a responder port identifier, a request program identifier, state data of the requester terminal and the like. And the responder terminal encapsulates the analyzed data into a request object, calls a request interface corresponding to the request program identifier according to the request object and acquires service data corresponding to the request parameter. The responder terminal encapsulates the service data into a response object, and sends the service data to the requester terminal in a response object mode. The requesting terminal can receive the service data returned by the responding terminal by calling the remote interface, and call the application interface corresponding to the local application program to acquire the service data, so as to realize service data calling.
In this embodiment, the requester terminal may provide multiple preset protocols to the requester terminal by loading the local integration packet, so as to implement free replacement of the protocols. The requester terminal intercepts the data call request, selects a target protocol corresponding to the data call request from a plurality of preset protocols, and is favorable for data transmission according to the target protocol required by the data call request. The requester terminal encapsulates the request parameter and the responder port identifier according to the target protocol through the local integration packet, so that the request parameter and the responder port identifier can be hidden, and the safety of service data calling is improved. And the requester terminal generates a data acquisition request according to the encapsulated data, and transmits the data acquisition request to the responder terminal according to a target protocol so that the responder terminal acquires corresponding service data according to the data acquisition request. The requester terminal receives the service data returned by the responder terminal, and the requester terminal and the responder terminal can perform corresponding data processing according to the same target protocol, so that the encoding rule and the decoding rule in the service data calling process are consistent, large-scale code modification and configuration are not required, the transformation workload of the requester terminal is reduced, and the calling efficiency of the service data is improved.
In one embodiment, selecting a target protocol corresponding to the data call request from a plurality of preset protocols includes: detecting network parameters when a local application program runs to obtain a detection result; and selecting a target protocol corresponding to the data calling request from a plurality of preset protocols according to the detection result.
When the requester terminal selects the target protocol, the network parameters of the local application program during operation can be detected to obtain a detection result. Network parameters may include network speed, network stability, firewall rules, etc. The preset protocol may include an http protocol, an rpc protocol, and the like. The target protocol may be a data transmission protocol required by the local application for service data call. And the requester terminal selects a target protocol according to each network parameter in the detection result. For example, when the number of firewalls is greater when the local application is running, it indicates that the corresponding access is more restricted. If the data transmission is rejected, the http protocol can be selected for data transmission. For another example, when the network speed is fast and stable, the rpc protocol may be used for data transmission. When the network speed is slow and the network is unstable, the http protocol can be adopted for data transmission. For another example, when the request parameter carried in the data call request and the port identifier of the responder are files with large capacity, the http protocol may be used for data transmission. When the request side terminal selects the http protocol for data transmission, the load balancer F5 and the reverse proxy server Nginx can be adopted to realize service data calling.
The requester terminal starts a protocol change script by calling the local integration packet, and calls a target protocol through the protocol change script. For example, when the rpc protocol is not supported for data transmission, the requesting terminal may automatically change the rpc protocol to the http protocol for data transmission through the protocol change script. The protocol switching script can support the registration server and the requester terminal to start the script, is favorable for online control of the data transmission state, and can timely process faults occurring in the data transmission process.
In this embodiment, the requester terminal selects the target protocol by detecting a network parameter when the local application program runs, and can automatically change the protocol according to the running state of the local application program, thereby implementing free change among multiple protocols, and avoiding the influence on service data call when a network service system and network storage are in trouble.
In one embodiment, the method further comprises: acquiring registration data of a requester, and sending the registration data of the requester to a registration server so that the registration server generates a remote interface according to the registration data of the requester; calling a remote interface, and sending a data acquisition request to a responder terminal according to a target protocol; and receiving the service data returned by the responder terminal according to the data acquisition request through the remote interface, and calling the application interface corresponding to the local application program to acquire the service data.
The requester terminal obtains requester registration data, loads a local integrated package when a local application program is started, and sends the requester registration data to the registration server. The registration server may store the requestor registration data in a database. The registration server generates a remote interface based on the requestor registration data. The requester registration data may include a requester terminal identification, a requester port identification. The requestor terminal may then invoke the remote interface to transmit the data acquisition request to the responder terminal. The request side terminal can call the remote interface, receive the service data returned by the response side terminal according to the data acquisition request, and then call the application interface corresponding to the local application program to acquire the service data, thereby realizing the service data call.
Further, the responder terminal is pre-installed with a responder application and is pre-configured with a responder integrated packet. The responder terminal obtains responder registration data. The responder registration data may include a responder terminal identification, a responder port identification. When the local application is started, the responder application may be started at the same time. And when the application program of the responder is started, loading the integrated package of the responder, sending the registration data of the responder to the registration server, and generating a realization interface by the registration server according to the registration data of the responder. The registration server can store the registration data of the responder in the database, so that the registration server searches the corresponding responder terminal identifier in the database according to the data call request sent by the requester terminal, and the requester terminal searches the corresponding responder terminal according to the responder terminal identifier. And the responder terminal sends the service data to the requester terminal by calling the implementation interface. The registration server automatically generates the implementation interface, so that the management and development cost can be reduced. The registration server realizes the connection between the requester terminal and the responder terminal by generating a remote interface of the requester terminal and a realization interface of the responder terminal.
In the embodiment, the requester terminal sends the requester registration data to the registration server, so that the registration server generates the remote interface according to the requester registration data, integrated packet exchange between the requester terminal and the responder terminal is not required when service data is called, and management and development costs are reduced.
In one embodiment, after intercepting the data call request, the method further comprises: sending the data calling request to a registration server, and enabling the registration server to search a corresponding responder terminal identifier in a database according to the responder port identifier; receiving a responder terminal identification sent by a registration server; and searching a corresponding responder terminal according to the responder terminal identifier.
And after the requester terminal sends the intercepted data call request to the registration server, the registration server analyzes the data call request to obtain a request parameter and a responder port identifier. The registration server can be used for connecting the requester terminal and the responder terminal, and searching the corresponding responder terminal identification in the database according to the responder port identification obtained by analysis. Only under the condition that the local integrated package is loaded by the requester terminal and the response integrated package is loaded by the responder terminal, the corresponding responder terminal identification can be searched in the database by the registration server according to the responder port identification. The responder terminal identification may be an identification for distinguishing different devices, and may be identified by one or more combinations of numbers, letters or character strings. The responder terminal identification may be a service address. For example, the responder terminal identification may be an IP Address (Internet Protocol). The IP address may be a uniform address format provided by the IP protocol, and is a logical address assigned to each network and each host on the internet. The registration server sends the identifier of the responder terminal to the requester terminal, and the requester terminal searches the corresponding port of the responder terminal according to the identifier of the responder terminal, so as to search the corresponding responder terminal.
Further, if the registration server does not find the identifier of the responder terminal corresponding to the identifier of the responder port, it means that any one of the requester terminal and the responder terminal is not loaded with the corresponding integrated packet. At this time, the requester terminal selects a pre-configured protocol among a plurality of preset protocols for transmission. For example, the requesting terminal transmits the data by using an http protocol, and may use load balancing F5 and reverse proxy service Nginx to implement the invocation of the service data.
In this embodiment, the requester terminal sends the data call request to the registration server, receives the identifier of the responder terminal sent by the registration server, and can determine whether the corresponding integrated packet is loaded by the requester terminal and the responder terminal, thereby determining the target protocol. The requesting terminal searches the corresponding responding terminal according to the responding terminal identifier, so as to establish network communication with the requesting terminal, and facilitate the subsequent data transmission after encapsulation.
In one embodiment, the requestor terminal may also be health tested. Specifically, the requester terminal is pre-deployed with a target script, and the requester terminal loads the target script and performs a health test on the requester terminal through the target script. The test mode can be various, and can be a real-time test or a timing test. The requesting party terminal obtains the self health parameters through the health test and transmits the obtained health parameters to the registration server. The health parameters are used for judging whether the terminal is in a normal operation state or not. The health parameters may include parameters of whether data loading was successful, whether application startup was successful, and the like. The registration server may determine whether the requester terminal is in a normal operation state according to the received health parameter. And if so, receiving and responding to a data call request sent by the requester terminal. The requester terminal performs the health test on the requester terminal, sends the health parameters obtained through the test to the registration server, and can further judge whether the health parameters of the requester terminal are in a normal running state, so that the safety of service data calling is improved.
In one embodiment, the requester terminal may also send heartbeat data to the registration server periodically, that is, send a data call request to the registration server at a certain frequency, so that the registration server searches for the identifier of the responder terminal in the database according to the heartbeat data, and sends the identifier to the requester terminal. The heartbeat data indicates that a data calling channel established between the requester terminal and the responder terminal keeps normal connection. And if the requesting terminal does not receive the identifier of the responding terminal returned from the registration server, indicating that the data call request fails. If the requester terminal does not send heartbeat data to the registration server within the preset time, the registration server automatically disconnects the connection with the requester terminal, and simultaneously generates an instruction for deleting the requester terminal and sends the instruction to the database to instruct the database to delete the requester registration data of the requester terminal. At this time, if the requester terminal initiates the data call request again, the registration server reestablishes the connection with the requester terminal, and meanwhile, the requester registration data of the requester terminal needs to be stored in the database, so that the security of service data call is improved.
In one embodiment, the requesting terminal may further select a corresponding target registration server from a plurality of preset registration servers to send the data call request to the target registration server, so as to obtain a responder terminal identifier corresponding to the data call request, and implement access and call of the specified service data. Specifically, the requestor terminal receives a plurality of monitoring results. And the requester terminal calls the target script, analyzes and processes the received monitoring result, and screens out the target server. And the requester terminal searches the monitoring result corresponding to the target server to obtain the registrant identification corresponding to the target server. And the requester terminal sends the data call request to the target server according to the identifier of the register.
The monitoring result may be a monitoring result of the operation state of the preset registration server. Each monitoring result may correspond to one preset registration server. The monitoring result comprises a registration party identifier corresponding to the preset registration server, a data center and an operation load. The target script may be a library of functions that includes a plurality of static files. The target script can be deployed on the requester terminal in advance and used for screening the target server according to the running state monitoring result. The target server is a preset registration server which can be screened out from a plurality of preset registration servers and can be used for responding to the data calling request based on the operation state monitoring results of the plurality of preset registration servers.
And the requester terminal judges the operation load in each monitoring result through the target script, and screens other preset registration servers from the monitoring results when the operation load of the preset registration server in the monitoring results exceeds a threshold value. And the requester terminal sends the data call request to the screened target server through the target script to respond to the data call request. For example, if the monitoring result may be {183.15.176.74, IDC1, normal operation }, it indicates that the address of the registrar server a is 183.15.176.74, the data center to which the registrar server a belongs is IDC1, and the operation load of the registrar server a does not exceed the threshold, the requester terminal may use the registrar server a as a target server, and further send a data call request.
Furthermore, each preset registration server is pre-deployed with a corresponding monitoring script, and when the preset registration server is started, the preset registration server calls the monitoring script to monitor the running state of the preset registration server, so as to obtain the monitoring result of the preset registration server. And each preset registration server sends the monitoring result to the requester terminal through the monitoring script. The monitoring script may be a library of functions that includes a plurality of static files. The monitoring script is used for monitoring the running state of the preset registration server and sending the running state monitoring result to the requester terminal, and is also used for receiving requester registration data of the preset registration server, the requester terminal and the responder terminal. The monitoring mode may be real-time monitoring of the operation state of the preset registration server, or timing monitoring of the operation state of the preset registration server.
In this embodiment, the requester terminal screens out the target server most suitable for receiving the response data call request according to the monitoring result, which effectively solves the problem that the requester terminal can arbitrarily select the target server from a plurality of preset registration servers to respond to the data call request, that is, the registration center can successfully respond to the data call request sent by the requester terminal as long as one preset registration server operates normally, and improves the availability of the preset registration servers, thereby improving the call efficiency of the service data.
It should be understood that, although the steps in the flowchart of fig. 2 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a portion of the steps in fig. 2 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
In one embodiment, as shown in fig. 3, there is provided a service data invoking device 300, including: a loading module 302, a receiving module 304, a selecting module 306, an encapsulating module 308, a generating module 310, and a communication module 312, wherein:
the loading module 302 is configured to start a local application program, and load a local integrated package, where the local integrated package includes multiple preset protocols.
A receiving module 304, configured to receive a data call request, where the data call request carries a request parameter and a responder port identifier.
The selecting module 306 is configured to intercept the data call request, and select a target protocol corresponding to the data call request from multiple preset protocols.
And the encapsulating module 308 is configured to encapsulate the request parameter and the port identifier of the responder according to the target protocol through the local integration packet, so as to obtain encapsulated data.
A generating module 310, configured to generate a data obtaining request according to the encapsulated data.
A communication module 312, configured to send a data acquisition request to a responder terminal according to a target protocol, so that the responder terminal acquires corresponding service data according to the data acquisition request; and receiving the service data returned by the responder terminal.
In one embodiment, the encapsulation module 308 is further configured to assemble the request parameter and the port identifier of the responder according to the target protocol through the local integration packet, so as to obtain assembled data; and packaging the assembled data to obtain packaged data.
In one embodiment, the selecting module 306 is further configured to detect a network parameter when the local application runs, so as to obtain a detection result; and selecting a target protocol corresponding to the data call request from a plurality of preset protocols according to the detection result.
In one embodiment, the apparatus further comprises:
and the acquisition module is used for acquiring the registration data of the requester and sending the registration data of the requester to the registration server so that the registration server generates a remote interface according to the registration data of the requester.
The communication module 312 is further configured to invoke a remote interface, and send a data acquisition request to a responder terminal according to a target protocol; and receiving returned service data sent by the responder terminal according to the data acquisition request through the remote interface, and calling an application interface corresponding to the local application program to acquire the service data.
In one embodiment, the apparatus further includes:
the communication module 312 is further configured to send the data call request to the registration server, so that the registration server searches the database for a corresponding responder terminal identifier according to the responder port identifier; and receiving the identification of the responder terminal sent by the registration server.
And the searching module is used for searching the corresponding responder terminal according to the responder terminal identifier.
For specific limitations of the service data invoking device, reference may be made to the above limitations of the service data invoking method, which is not described herein again. All or part of each module in the service data calling device can be realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 4. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operating system and the computer program to run on the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a business data invocation method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the configuration shown in fig. 4 is a block diagram of only a portion of the configuration associated with the present application, and is not intended to limit the computing device to which the present application may be applied, and that a particular computing device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory storing a computer program and a processor implementing the steps of the above-described method embodiments when the processor executes the computer program.
In an embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which computer program, when being executed by a processor, carries out the steps of the respective method embodiment as described above.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include non-volatile and/or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), rambus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, and these are all within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method of service data invocation, the method comprising:
starting a local application program, and loading a local integrated package, wherein the local integrated package comprises a plurality of preset protocols;
receiving a data calling request, wherein the data calling request carries a request parameter and a responder port identifier;
intercepting the data call request, and selecting a target protocol corresponding to the data call request from a plurality of preset protocols;
packaging the request parameter and the responder port identification according to the target protocol by the local integrated package to obtain packaged data;
generating a data acquisition request according to the encapsulated data;
sending the data acquisition request to a responder terminal according to the target protocol so that the responder terminal acquires corresponding service data according to the data acquisition request;
receiving the service data returned by the responder terminal;
the method further comprises the following steps:
acquiring registration data of a requester, and sending the registration data of the requester to a registration server so that the registration server generates a remote interface according to the registration data of the requester;
calling the remote interface, and sending the data acquisition request to the responder terminal according to the target protocol;
receiving the service data returned by the responder terminal according to the data acquisition request through the remote interface, and calling an application interface corresponding to the local application program to acquire the service data;
the response party terminal returns the service data, which comprises the following steps: the responder terminal acquires responder registration data and sends the responder registration data to the registration server, so that the registration server generates a realization interface according to the responder registration data, and the responder terminal sends the service data to the requester terminal by calling the realization interface.
2. The method of claim 1, wherein encapsulating the request parameter and the responder port identifier according to the target protocol by the local integration packet to obtain encapsulated data comprises:
assembling the request parameter and the responder port identification through the local integration packet according to a target protocol to obtain assembled data;
and packaging the assembled data to obtain packaged data.
3. The method according to claim 1, wherein the selecting a target protocol corresponding to the data call request from a plurality of preset protocols comprises:
detecting the network parameters when the local application program runs to obtain a detection result;
and selecting a target protocol corresponding to the data calling request from a plurality of preset protocols according to the detection result.
4. The method of claim 1, after intercepting the data call request, further comprising:
sending the data calling request to a registration server, and enabling the registration server to search a corresponding responder terminal identifier in a database according to the responder port identifier;
receiving a responder terminal identification sent by the registration server;
and searching a corresponding responder terminal according to the responder terminal identifier.
5. A service data invocation apparatus, characterized in that said apparatus comprises:
the loading module is used for starting a local application program and loading a local integrated package, wherein the local integrated package comprises a plurality of preset protocols;
the receiving module is used for receiving a data calling request, and the data calling request carries a request parameter and a responder port identifier;
the selection module is used for intercepting the data calling request and selecting a target protocol corresponding to the data calling request from a plurality of preset protocols;
the encapsulation module is used for encapsulating the request parameter and the port identifier of the responder through the local integration packet according to the target protocol to obtain encapsulated data;
the generating module is used for generating a data acquisition request according to the packaged data;
the communication module is used for sending the data acquisition request to a responder terminal according to the target protocol so as to enable the responder terminal to acquire corresponding service data according to the data acquisition request; receiving the service data returned by the responder terminal;
the device further comprises:
the acquisition module is used for acquiring registration data of a requester and sending the registration data of the requester to a registration server so that the registration server generates a remote interface according to the registration data of the requester;
the communication module is also used for calling the remote interface and sending the data acquisition request to the responder terminal according to the target protocol; receiving the service data returned by the responder terminal according to the data acquisition request through the remote interface, and calling an application interface corresponding to the local application program to acquire the service data;
the step of returning the service data by the responder terminal comprises the following steps: the responder terminal acquires responder registration data and sends the responder registration data to the registration server, so that the registration server generates a realization interface according to the responder registration data, and the responder terminal sends the service data to the requester terminal by calling the realization interface.
6. The apparatus of claim 5, wherein the encapsulation module is further configured to assemble, by the local integrated packet, the request parameter and the responder port identifier according to a target protocol to obtain assembled data; and packaging the assembled data to obtain packaged data.
7. The apparatus according to claim 5, wherein the selection module is further configured to detect a network parameter when the local application runs, and obtain a detection result; and selecting a target protocol corresponding to the data calling request from a plurality of preset protocols according to the detection result.
8. The apparatus of claim 5, further comprising:
the communication module is also used for sending the data calling request to a registration server, so that the registration server searches a corresponding responder terminal identifier in a database according to the responder port identifier; receiving a responder terminal identification sent by the registration server;
and the searching module is used for searching the corresponding responder terminal according to the responder terminal identification.
9. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor when executing the computer program performs the steps of the method according to any of claims 1 to 4.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 4.
CN201911268759.7A 2019-12-11 2019-12-11 Service data calling method and device, computer equipment and storage medium Active CN111193716B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911268759.7A CN111193716B (en) 2019-12-11 2019-12-11 Service data calling method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911268759.7A CN111193716B (en) 2019-12-11 2019-12-11 Service data calling method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111193716A CN111193716A (en) 2020-05-22
CN111193716B true CN111193716B (en) 2023-04-07

Family

ID=70710968

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911268759.7A Active CN111193716B (en) 2019-12-11 2019-12-11 Service data calling method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111193716B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113722115A (en) * 2020-05-26 2021-11-30 北京沃东天骏信息技术有限公司 Method, device, equipment and computer readable medium for calling interface
CN111782306A (en) * 2020-06-30 2020-10-16 平安银行股份有限公司 Interface calling information processing method and device, electronic equipment and storage medium
CN112559213B (en) * 2020-12-18 2023-07-21 深圳云之家网络有限公司 Application communication method, device, computer equipment and storage medium
CN112950370A (en) * 2021-02-25 2021-06-11 未鲲(上海)科技服务有限公司 Service processing method, device, equipment and storage medium
CN113450217A (en) * 2021-06-25 2021-09-28 未鲲(上海)科技服务有限公司 Transaction request processing method and device, electronic equipment and storage medium
CN113407366A (en) * 2021-07-15 2021-09-17 北京字节跳动网络技术有限公司 Remote calling method, device and system
CN113938531B (en) * 2021-09-23 2023-10-31 北京车和家信息技术有限公司 Data transmission method, device, equipment and medium
CN115665246B (en) * 2022-09-01 2024-03-08 浪潮通信信息系统有限公司 Registration request processing method, device, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101155190A (en) * 2006-09-29 2008-04-02 戴尔产品有限公司 Dynamic loading of protocol adapters on a client
CN102098296A (en) * 2010-12-29 2011-06-15 北京新媒传信科技有限公司 Method and system for realizing remote call
US8812733B1 (en) * 2010-08-19 2014-08-19 Google Inc. Transport protocol independent communications library
CN107682327A (en) * 2017-09-25 2018-02-09 深圳市见康云科技有限公司 Data Transport Protocol method for transformation, device, equipment and readable storage medium storing program for executing
CN109525661A (en) * 2018-11-14 2019-03-26 北京奇艺世纪科技有限公司 Data transmission method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101155190A (en) * 2006-09-29 2008-04-02 戴尔产品有限公司 Dynamic loading of protocol adapters on a client
US8812733B1 (en) * 2010-08-19 2014-08-19 Google Inc. Transport protocol independent communications library
CN102098296A (en) * 2010-12-29 2011-06-15 北京新媒传信科技有限公司 Method and system for realizing remote call
CN107682327A (en) * 2017-09-25 2018-02-09 深圳市见康云科技有限公司 Data Transport Protocol method for transformation, device, equipment and readable storage medium storing program for executing
CN109525661A (en) * 2018-11-14 2019-03-26 北京奇艺世纪科技有限公司 Data transmission method and device

Also Published As

Publication number Publication date
CN111193716A (en) 2020-05-22

Similar Documents

Publication Publication Date Title
CN111193716B (en) Service data calling method and device, computer equipment and storage medium
CN110602169B (en) Service calling method and device, computer equipment and storage medium
CN108256118B (en) Data processing method, device, system, computing equipment and storage medium
CN112104754B (en) Network proxy method, system, device, equipment and storage medium
WO2016184175A1 (en) Database processing method and apparatus
CN111835789B (en) Service authentication method, device, equipment, system and storage medium
CN111176803B (en) Service processing method, device, server and storage medium
CN109246235B (en) Method and device for receiving monitoring data and data monitoring system
CN112612595A (en) Method and device for establishing micro-service calling relationship, computer equipment and storage medium
CN113676563B (en) Scheduling method, device, equipment and storage medium of content distribution network service
CN110708247A (en) Message routing method, message routing device, computer equipment and storage medium
CN108595280B (en) Interface adaptation method and device, computer equipment and storage medium
CN114205342A (en) Routing method, electronic device, medium, and program product for service debugging
CN112202795A (en) Data processing method, gateway equipment and medium
CN113923008B (en) Malicious website interception method, device, equipment and storage medium
CN112699034B (en) Virtual login user construction method, device, equipment and storage medium
CN112235300B (en) Cloud virtual network vulnerability detection method, system, device and electronic equipment
CN110968400B (en) Application program execution method and device, computer equipment and storage medium
CN111600755B (en) Internet access behavior management system and method
CN113342767A (en) Log generation method, device, equipment and storage medium
CN114584629B (en) Transaction message processing method and device
CN112162873B (en) Remote calling method, electronic device and storage medium
CN112769845A (en) Vulnerability testing method and device, electronic device and computer equipment
CN112632534A (en) Malicious behavior detection method and device
US10581916B2 (en) System and method for identifying cyber-attacks

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
TR01 Transfer of patent right

Effective date of registration: 20230904

Address after: 518000 05A, floor 3, building a, Baoan Bay Zhichuang Park, No. 24, 1st lane, Xin'an Third Road, Dalang community, Xin'an street, Bao'an District, Shenzhen, Guangdong Province

Patentee after: Shenzhen Xingxing Xinhang Technology Co.,Ltd.

Address before: 200120 floor 15, No. 1333, Lujiazui Ring Road, Shanghai pilot Free Trade Zone

Patentee before: Weikun (Shanghai) Technology Service Co.,Ltd.

TR01 Transfer of patent right